[Python-ideas] Python 3.9.9 - The 'I Have A Dream' Version

Chris Angelico rosuav at gmail.com
Wed Apr 15 16:00:54 CEST 2015


On Wed, Apr 15, 2015 at 11:54 PM, Simon Kennedy <sffjunkie at gmail.com> wrote:
> On Wednesday, 15 April 2015 14:22:10 UTC+1, Steven D'Aprano wrote:
>>
>> I believe the distinction you want is "data" versus "code", or
>> perhaps "values" versus "functions".
>>
>> The trouble is that in Python, functions are values too. You can pass a
>> function to a function and manipulate it. The term usually used to
>> describe this is "functions are first-class values".
>
>
> This is probably what I should have used "First class values"

That's still pretty much everything in Python. Off the top of my head,
the only manipulable things that aren't first-class are name bindings
themselves, and those can usually be simulated - most namespaces are
representable as dictionaries, and other bindings are
__[gs]et{item,attr}__ calls; the notable exception is function locals,
which you can't easily mutate from outside the function.

ChrisA


More information about the Python-ideas mailing list