Kaydet (Commit) d0169000 authored tarafından Victor Stinner's avatar Victor Stinner

Merge heads

This diff is collapsed.
...@@ -112,6 +112,9 @@ This module provides an interface to the mechanisms used to implement the ...@@ -112,6 +112,9 @@ This module provides an interface to the mechanisms used to implement the
Return a new empty module object called *name*. This object is *not* inserted Return a new empty module object called *name*. This object is *not* inserted
in ``sys.modules``. in ``sys.modules``.
.. deprecated:: 3.4
Use :class:`types.ModuleType` instead.
.. function:: reload(module) .. function:: reload(module)
......
...@@ -107,9 +107,35 @@ Standard names are defined for the following types: ...@@ -107,9 +107,35 @@ Standard names are defined for the following types:
C".) C".)
.. data:: ModuleType .. class:: ModuleType(name, doc=None)
The type of modules. The type of :term:`modules <module>`. Constructor takes the name of the
module to be created and optionally its :term:`docstring`.
.. attribute:: __doc__
The :term:`docstring` of the module. Defaults to ``None``.
.. attribute:: __loader__
The :term:`loader` which loaded the module. Defaults to ``None``.
.. versionchanged:: 3.4
Defaults to ``None``. Previously the attribute was optional.
.. attribute:: __name__
The name of the module.
.. attribute:: __package__
Which :term:`package` a module belongs to. If the module is top-level
(i.e. not a part of any specific package) then the attribute should be set
to ``''``, else it should be set to the name of the package (which can be
:attr:`__name__` if the module is a package itself). Defaults to ``None``.
.. versionchanged:: 3.4
Defaults to ``None``. Previously the attribute was optional.
.. data:: TracebackType .. data:: TracebackType
......
This diff is collapsed.
This diff is collapsed.
...@@ -123,6 +123,9 @@ Core and Builtins ...@@ -123,6 +123,9 @@ Core and Builtins
Library Library
------- -------
- Issue #17907: Document imp.new_module() as deprecated in favour of
types.ModuleType.
- Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document as deprecated - Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document as deprecated
imp.get_magic(). imp.get_magic().
...@@ -378,6 +381,8 @@ Library ...@@ -378,6 +381,8 @@ Library
- Implement PEP 443 "Single-dispatch generic functions". - Implement PEP 443 "Single-dispatch generic functions".
- Implement PEP 435 "Adding an Enum type to the Python standard library".
Tests Tests
----- -----
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment