Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i have a function with an argument that needs to be highly flexible. it already has various cases for ints and strings and True and False. i am wondering if i can also use ... as a caller provided value, is it safe?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
(Mar-07-2022, 07:27 AM)ndc85430 Wrote: You haven't shown any code,
the function is very large and would easily divert people off topic. there would be a lot of distracting talk about other aspects of the code.
(Mar-07-2022, 07:48 AM)Gribouillis Wrote: Syntactically, you cannot use ... where a name is expected, but the value ... or Ellipsis can be passed to a function call. It is an object like any other Python object.
i was thinking of using it as a
value being passed and then in the function, checking for it like:
if foo is ...:
or:
if foo is Ellipsis:
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
and the function is a "work in progress".
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
are we changing the topic of this thread or starting a new one?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.