the global keyword:
Steven D'Aprano
steve at pearwood.info
Sat Jun 11 23:38:20 EDT 2016
On Sun, 12 Jun 2016 11:26 am, Random832 wrote:
> On Sat, Jun 11, 2016, at 20:09, MRAB wrote:
>> Not true. Importing doesn't copy the value.
>>
>> Importing a name creates a new name in the local scope that refers to
>> the same object that the imported name referred to.
MRAB is correct here.
> Yes, the value of a variable is a reference to an object. Can we not
> have another round of this right now?
Sure, if you stop spreading misinformation about variables in Python and
cease the insanity of claiming that the value of a variable is not the
value you assign to it, but some invisible, unreachable "reference".
x = 999
The value of x is 999, not some invisible reference.
x = []
The value of x is an empty list, not some invisible reference.
--
Steven
More information about the Python-list
mailing list