On Thu, Jun 12, 2008 at 1:01 PM, Willem Broekema <metawilm at gmail.com> wrote: > On Thu, Jun 12, 2008 at 9:46 PM, Guido van Rossum <guido at python.org> wrote: >> The intention was for these dicts to be used as namespaces. I think of >> it as follows: >> >> (a) Using non-string keys is a no-no, but the implementation isn't >> required to go out of its way to forbid it. > > That will allow easier and more efficient implementation, good! > >> (b) Using non-empty string keys that aren't well-formed identifiers >> should be allowed. > > ok. > > Is it allowed to "normalize" subclasses of strings to regular string, > e.g. after: > > class mystring(str): pass > class C: pass > > x = C() > setattr(x, mystring('foo'), 42) > > is it allowed that the dict of x contains a regular string 'foo' > instead of the mystring instance? I think yes, as this would allow for a more efficient implementation of the custom dict class. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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