Sebastian Rittau <srit...@rittau.biz> added the comment:

typing.io is not referenced in either the tests or the implementation for 
pydoc. What happens is basically: typing.io is a class, so its derived from 
object. When formatting the docstring for object, the formatter queries the 
__module__ attribute of all sub-classes of object, including typing.io, so that 
it can include the sub-classes in its output:

--------------

Help on class object in module builtins:

class object
 |  The base class of the class hierarchy.
 |  
 |  When called, it accepts no arguments and returns a new featureless
 |  instance that has no instance attributes and cannot be given any.
 |  
 |  Built-in subclasses:
 |      anext_awaitable
 |      async_generator
 |      async_generator_asend
 |      async_generator_athrow
 |      ... and 88 other subclasses
 |  
[...]

--------------

Before the PR this failed, as accessing any typing.io.__module__ printed the 
warning.

----------

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

Reply via email to