Joshua Haberman wrote: > Python as a language has chosen to "lock down" built-in > objects... If it's > important for the built-in types, why should it be less important for > mine? I'm not really sure why so much trouble is taken to lock down builtin types -- it seems to go against Python's general consenting-adults philosophy. I suppose it's felt that you should be able to rely on builtin types not changing their behaviour. This is probably more important for the core types than those in extension modules. Many of the standard library classes are written in Python, so this protection doesn't extend to them. > I don't want my type to be a second-class citizen just because I happen > to be dynamically allocating it. I don't think anyone will regard your types as second-class because they allow you to do *more* with them. The only real concern would be if it were somehow possible to crash the interpreter by modifying the type dict. I don't see how that could happen -- but maybe someone else on python-dev knows more about this? -- Greg
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