Re: Introspecting the variable bound to a function argument

2023-02-22 Thread Greg Ewing via Python-list
On 23/02/23 9:12 am, Hen Hanna wrote: On Wednesday, February 22, 2023 at 2:32:57 AM UTC-8, Anton Shepelev wrote: def f(a): print(black_magic(a))# or black_magic('a') f(v1)# prints: v1 f(v2)# prints: v2 the

Re: Introspecting the variable bound to a function argument

2023-02-22 Thread Thomas Passin
On 2/22/2023 3:12 PM, Hen Hanna wrote: On Wednesday, February 22, 2023 at 2:32:57 AM UTC-8, Anton Shepelev wrote: Hello, all. Does Python have an instrospection facility that can determine to which outer variable a function argument is bound, e.g.: v1 = 5; v2 = 5; do some Python coders

Re: Introspecting the variable bound to a function argument

2023-02-22 Thread Hen Hanna
On Wednesday, February 22, 2023 at 2:32:57 AM UTC-8, Anton Shepelev wrote: > Hello, all. > > Does Python have an instrospection facility that can > determine to which outer variable a function argument is > bound, e.g.: > > v1 = 5; > v2 = 5; do some Python coders like to end lines with

Re: Introspecting the variable bound to a function argument

2023-02-22 Thread Barry
please do not use an email address on a public list that cannot be replied to. > On 22 Feb 2023, at 14:43, Anton Shepelev wrote: > > Hello, all. > > Does Python have an instrospection facility that can > determine to which outer variable a function argument is > bound, e.g.: There is no

Introspecting the variable bound to a function argument

2023-02-22 Thread Anton Shepelev
Hello, all. Does Python have an instrospection facility that can determine to which outer variable a function argument is bound, e.g.: v1 = 5; v2 = 5; def f(a): print(black_magic(a)) # or black_magic('a') f(v1) # prints: v1 f(v2) # prints: v2 -- () ascii ribbon