STINNER Victor <vstin...@python.org> added the comment:
> Depends on the definition of "sandbox". In bpo-36220, it clearly means "execute untrusted code": hide access to the filesystem for example. > I for example interested in study of some properties of corpus of Python code. This issue is a feature request: you ask to modify Python so you can pass dict subclasses as namespaces and expect CPython to respect the mapping protocol (__getitem__/__setitem__, rather than accessing directly dict internals (well, don't call overriden __getitem__/__setitem__ methods). Currently, we are in a gray area: it's supported in some places, but not everywhere. Implementing such features which require to introduce new code, which means increasing the maintenance burden, and it will slow down Python, since every access to a namespace would require to check if the namespace is a dict or a dict subclass. Paul: you're are in front of 3 core developers who are rejecting your feature request. It doesn't mean that it is not valid. It means that we don't consider your use case as important enough to justify to slow down Python for everything and to increase the maintenance burden. Namespace performances are really critical for overall Python performances. My idea is only to reject the feature in CPython implementation, not the in Python language specification. It means that other Python implementation would be free to decide to implement it. You're free to fork Python and modify the C code to implement your use case, to study Python internals. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32615> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com