On 22 Feb 2023, at 14:43, Anton Shepelev <anton.txt@g{oogle}mail.com> 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;
def f(a):
print(black_magic(a)) # or black_magic('a')
f(v1) # prints: v1
f(v2) # prints: v2
--
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments
--
https://mail.python.org/mailman/listinfo/python-list
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
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 ; ?
def f(a):
print(black_magic(a)) # or black_magic('a') >>
f(v1) # prints: v1
f(v2) # prints: v2
the term [call by name] suggests this should be possible.
30 years ago... i used to think about this type of thing A LOT ---
------- CBR, CBV, CBN, (call by value), (call by name).... etc.
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 term [call by name] suggests this should be possible.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 77:52:50 |
Calls: | 6,716 |
Files: | 12,247 |
Messages: | 5,357,740 |