`logging.getLevelName()` can take either an `int` and returns a `str` or
a `str` and returns an `int` when the level name (`str`) or level
(`int`) is one of the registered log levels. If the value passed in
isn't one of the registered log levels, it returns the string `"level
%s" % lvl` where `lvl` is the value passed in to the function.
* logging: Add logging.Logger().fatal()
fatal() is an alias for critical(): It is just another name for the same
implementation.
* logging: Fix logging.Logger().warn()
warn() was an alias for warning(), but got deprecated with Python3.
In Python2 warn() is just another name for the same method.
In Python3 they have their own implementations, which adds a deprecation
warning before calling the new function.
PS: LoggerAdapter in Python2 never has the warn() method, but Python3
still implements the deprecation wrapper function.
* Use _ArgsType for logging.makeRecord
* The "args" argument is passed to LogMessage, so passing a tuple in is fine as
well.
* Use Mapping rather than Dict, see https://bugs.python.org/issue21172
It should be possible to ask for every object whether it looks like
an element. If only Elements are accepted, this function would always
return True.
Fixes#2629
There does not seem to be an easy way to express that the array needs to be of a 1-byte type ('b', 'B', or 'c' in Python 2 only), so it is a bit more permissive than it should be.
* Allow only _CData subclasses as ctypes.Array elements
* Change type of ctypes.Array.raw and .value to Any (Closes#2111)
.raw and .value don't exist on all arrays. On c_char arrays, both exist
and have type bytes; on c_wchar arrays, only .value exists and has
type Text; on all other arrays neither one exists.
This is impossible to describe properly in a stub, so marking .value as
Any is the best that can be done.
This allows passing bytearray() objects to the base64 encode and decode functions, on both Python 2.7 and 3.4.
This also simplifies the code by ignoring 3.2 and 3.3, which are out of scope.
* Add FileWrapper protocol to wsgiref.types
* Annotate werkzeug's wrap_file and FileWrapper
* Remove empty line at end of file
* Fix _Readable protocols