Why is there no natural syntax for accessing attributes with names not being valid identifiers?

Ethan Furman ethan at stoneleaf.us
Wed Dec 4 15:22:59 EST 2013


On 12/04/2013 12:07 PM, Piotr Dobrogost wrote:
>
> If there ought to be only one way to access attributes then it should
>  be dot notation.

Not "only one way", it's "one obvious way".

The obvious way to deal with objects that do not have legal identifier names is with a dict.

--
~Ethan~



More information about the Python-list mailing list