[Python-ideas] Re: def variable = value

2021-10-24 Thread Stephen J. Turnbull
Serhiy Storchaka writes: > They have. Both function and type classes have constructors Ah, right. "First-class values", of course they do. Thanks! Steve ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to pytho

[Python-ideas] Re: def variable = value

2021-10-24 Thread Jonathan Fine
Hi Serhiy Thank you for so clearly explaining how names get passed to function and class constructors. You also wrote: > We do not have generalized way to call arbitrary constructor with > automatically passing __name__, __qualname__ and __module__. And it would > be convenient. > > create n

[Python-ideas] Re: def variable = value

2021-10-24 Thread Serhiy Storchaka
24.10.21 15:20, Stephen J. Turnbull пише: > What do you mean by "constructor" here? Normally that word refers to > methods that populate the attributes of instances (in Python, __init__ > and__new__). But functions and methods don't have such, so you must > mean something else? They have. Both f

[Python-ideas] Re: def variable = value

2021-10-24 Thread Stephen J. Turnbull
Jonathan Fine writes: > >From my phone. > > An important thing about def x and class A is that the strings x and A are > made available to the constructor for x and A respectively. What do you mean by "constructor" here? Normally that word refers to methods that populate the attributes of in

[Python-ideas] Re: def variable = value

2021-10-23 Thread Jonathan Fine
>From my phone. An important thing about def x and class A is that the strings x and A are made available to the constructor for x and A respectively. The same is not true for x=val. Jonathan ___ Python-ideas mailing list -- python-ideas@python.org To u

[Python-ideas] Re: def variable = value

2021-10-23 Thread Steven D'Aprano
Why would anyone want to type: def variable = value when they could just type: variable = value instead? Perhaps if I was being paid by the character typed... def my__really__good__variable = ( value )# Assign value to my__really__good__variable. *wink* But all joking