A few comments between imports were removed or moved to the top of the
import block, due to behavioral differences between black and isort. See
psf/black#251 for details.
In two instances @overloads at the top of the file needed to be moved
due to psf/black#1490.
The CPython _lsprof module implementation uses the keyword arguments
'timer' and 'timeunit' instead of 'custom_timer' and 'time_unit' for
__init__. In profiler_init, the keyword argument parsing looks like the
following:
static char *kwlist[] = {"timer", "timeunit",
"subcalls", "builtins", 0};
This is the case ever since _lsprof was added in version 2.5.
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.)
* 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
- While this appears to be private, it's also documented as available
to set here: https://docs.python.org/3/howto/logging.html#optimization
- Did *not* update `logging.logThreads` et al to match the
documentation as it may be more appropriate to update the
documentation to set to `False` rather than to `0` based on how these
are used
Type further narrowed based on known type of a parameter to
`os.normcase`