Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2befd24

Browse files
committed
Don't encourage 'from types import *' in the types module's docs.
1 parent 6d199ef commit 2befd24

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Doc/library/types.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
This module defines names for some object types that are used by the standard
1010
Python interpreter, but not for the types defined by various extension modules.
1111
Also, it does not include some of the types that arise during processing such as
12-
the ``listiterator`` type. It is safe to use ``from types import *`` --- the
13-
module does not export any names besides the ones listed here. New names
14-
exported by future versions of this module will all end in ``Type``.
12+
the ``listiterator`` type. New names exported by future versions of this module
13+
will all end in ``Type``.
1514

1615
Typical use is for functions that do different things depending on their
1716
argument types, like the following::
1817

19-
from types import *
18+
from types import IntType
2019
def delete(mylist, item):
2120
if type(item) is IntType:
2221
del mylist[item]

0 commit comments

Comments
 (0)