Re: [Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-04 Thread Daniel Moisset
I think the documentation is correct but you misinterpreted the intent of that code. The code you're quoting, which is an example, is not about ending up with a custom dict within the instance, the intent of the author was just to captur the memeber_names list. So what it does for that is customizi

Re: [Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-03 Thread Amit Green
Thanks Daniel, I found my answer here (using your link): https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace """ When a new class is created by type.__new__, the object provided as the namespace parameter is copied to a new ordered mapping and the original object is

Re: [Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-03 Thread Daniel Moisset
Sorry, should have replied to the list too On Sat, 3 Nov 2018, 23:55 Daniel Moisset If I understood correctly what you want, it's possible with a metaclass. > Check the __prepare__ method at > https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace > and Pep 3115 > > On S

[Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-03 Thread Joy Diamond
Team, Are we supposed to be able to have our own class dictionary in python 3? If we currently cannot -- do we want to be able to? That we can have out own class dictionary in python 3 is strongly implied in the following at https://www.python.org/dev/peps/pep-3115/ where it says: """ # Th