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

Piotr Dobrogost p at google-groups-2013.dobrogost.net
Wed Dec 4 17:13:12 EST 2013


On Wednesday, December 4, 2013 10:41:49 PM UTC+1, Neil Cerutti wrote:
> On 2013-12-04, Piotr Dobrogost <> wrote:
> 
> > Right. If there's already a way to have attributes with these
> > "non-standard" names (which is a good thing)
> 
> At best its a neutral thing. You can use dict for the same
> purpose with very little effort and no(?) loss of efficiency.

As much as many people in this topic would like to put equal sign between attributes and dictionary's keys they are not the same thing. AFAIK descriptor protocol works only with attributes, right?

Regards,
Piotr



More information about the Python-list mailing list