New submission from Karl Kornel <k...@kornel.us>:

Hello!

In https://github.com/python/cpython/blob/master/Lib/typing.py#L115-L117, there 
is a note about the io and re classes not being included in typing.__all__.  I 
am a relatively new user of typing, and I did `from typing import *` in my 
code.  I ran the code through mypy first, which reported no problems, but then 
running Python 3.6 failed with a NameError (name 'IO' is not defined).

Reading through the typing source, it's clear that this was an intentional 
decision.  So, instead of reporting a bug, I'd like to request a documentation 
enhancement!

The docs for typing make no mention of typing.io or typing.re.  So, my request 
is: In the sections for the IO/TextIO/BinaryIO and Pattern/Match classes, 
include text warning the user that these types are not imported when you do 
`from typing import *`.

----------
assignee: docs@python
components: Documentation
messages: 353763
nosy: Karl Kornel, docs@python
priority: normal
severity: normal
status: open
title: In typing docs, note explicit import needed for IO and Pattern/Match
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38352>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to