This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pablogsal, pfalcon, ppperry, terry.reedy, vstinner
Date 2020-01-16.21:38:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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.
Date User Action Args
2020-01-16 21:38:19vstinnersetrecipients: + vstinner, terry.reedy, pfalcon, ppperry, pablogsal
2020-01-16 21:38:19vstinnersetmessageid: <>
2020-01-16 21:38:19vstinnerlinkissue32615 messages
2020-01-16 21:38:19vstinnercreate