[New-bugs-announce] [issue30372] Status of __builtins__ is not totally clear

Malcolm Smith report at bugs.python.org
Mon May 15 12:20:38 EDT 2017

New submission from Malcolm Smith:

https://docs.python.org/3.6/reference/executionmodel.html#builtins-and-restricted-execution describes the various things you can do with __builtins__, but then says "Users should not touch __builtins__; it is strictly an implementation detail." If this is so, the entire section should be marked "CPython implementation detail", not just that last paragraph.

Elsewhere, https://docs.python.org/3.6/reference/import.html#replacing-the-standard-import-system suggests that the __import__ function could be replaced "at the module level to only alter the behaviour of import statements within that module". Is there any way of doing this other than manipulating the module's __builtins__? If not, this is encouraging the programmer to rely on a CPython implementation detail without marking it as such.

assignee: docs at python
components: Documentation
messages: 293722
nosy: Malcolm Smith, docs at python
priority: normal
severity: normal
status: open
title: Status of __builtins__ is not totally clear
versions: Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list