Re-export the types from wsgiref.types for now to avoid breaking
existing code. wsgiref.types should be removed eventually.
Also, reduce the boilerplate description in _typeshed/wsgi.pyi as it
mirrors the description in _typeshed/__init__.pyi.
In Python 3.6, the SSLContext.options flags were converted from int to
EnumFlag values.
In addition, add the missing OP_ENABLE_MIDDLEBOX_COMPAT constant
introduced in version 3.6.
In addition, add the missing OP_NO_RENEGOTIATION constant introduced in
version 3.7.
The SocketCAN BCM option flag constants were added in version 3.9,
and only backported to version 3.8, despite the documentation's claims
of supporting all BCM-related constants starting from version 3.4.
Note: The CAN_FD_FRAME flag option was only introduced in the 4.8.x
kernel series, while the rest of the constants were available since the
Broadcast Manager was mainlined in the kernel as part of the SocketCAN
patches.
* make io classes inherit from typing IO classes
This makes these classes usable if type annotations are given as "IO"
or "TextIO". In the future, we'll then be able to move open() to
return a concrete class instead (#3951).
* open: introduce concrete return types
Fixes#3951.
We use the values of the "mode" and "buffering" arguments to figure out
the concrete type open() will return at runtime. (Compare the CPython
code in https://github.com/python/cpython/blob/master/Modules/_io/_iomodule.c#L231.)
This makes these classes usable if type annotations are given as "IO"
or "TextIO". In the future, we'll then be able to move open() to
return a concrete class instead (#3951).
* compileall: add stripdir, prependdir and limit_sl_dest
* compileall: compile_dir's default value is now None
* compileall: update for current py39 (as of beta1)
Co-authored-by: hauntsaninja <>
* Allow unicode objects throughout urlparse.py
Functions such as `urlparse()`, if given a unicode object,
will happily return a ParseResult of unicode components.
Relatedly, functions like `unquote()` will accept any of
bytes/str/unicode and return an object of the same type
or a composite containing that type.
* Allow unicode in several places in Thread
`name` and `kwargs` to Thread.__init__ function perfectly
well with unicode, not just str.
Note: the .name attribute will always be str even
if the constructor is passed something else, since
__init__ calls:
self.__name = str(name or _newname())
* Use typing.AnyStr properly
...rather than defining a new TypeVar unncessarily.
* Use typing.Text properly
Text is behaviorally equivalent to Union[str, unicode]
for Python 2 argument types.
* Remove outdated import & definition
* [check file consistent] copy changes to _dummy_threading.pyi