A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-June/080158.html below:

[Python-Dev] Assignment to None

[Python-Dev] Assignment to None [Python-Dev] Assignment to None"Martin v. Löwis" martin at v.loewis.de
Mon Jun 9 07:19:44 CEST 2008
> So, it's okay to setattr the attribute name "None" but not okay to set
> it directly?  Is this deliberate or is it an unintentional side effect
> of parser changes to prevent assignment to None?

It's deliberate. setattr(o, "foo bar", "baz") also works, even though
"foo bar" is not an identifier. setattr doesn't take the Python grammar
into account, but only the object's structure.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4