Python Forum
function/method keyword argument alias
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function/method keyword argument alias
#1
is there a way to handle function/method keyword aliasing other than using **kwargs and coding the logic to handle it? for example i might have position= for a defined function/method but also want to allow pos= to be the same thing. what about multiple aliases? what if the caller uses more than one of them?

    putfoo(bar,position=5,pos=3)
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
function/method keyword argument alias - by Skaperen - Dec-01-2019, 02:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  extracting a function/class/method from code Skaperen 5 2,237 Mar-30-2022, 12:13 AM
Last Post: Skaperen
  omitting arguments in function/method calls Skaperen 10 3,963 Nov-24-2019, 10:13 PM
Last Post: Gribouillis
  Is that possible to have a new feature: dynamic return with using function argument kouui 2 2,056 Aug-26-2019, 10:05 AM
Last Post: kouui

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020