* 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.
When we import typeshed internally at Dropbox, somehow the fact that
these files are all stubs gets lost (it's a long story...). This
causes errors like this:
.../stdlib/2/ast.pyi:6: error: Name 'typing' already defined (by an import)
The quickest way around this is to rename the import to _typing.
* 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.
In Python 3, `builtins.compile` takes 6 arguments (`source`, `filename`, `mode`, `flags=0`, `dont_inherit=False`, `optimize=-1`). This change adds the last `optimize` parameter, which is new since Python 2.
* 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.
Give it enough information to determine that addinfourl
is iterable and that iteration and read methods return bytes.
Modeled after what is in stdlib/3/urllib/response.pyi after confirming
by looking at Python 2.7 stdlib code.
In Python 3, just as in Python 2, the expected exception argument to
assertRaises() and assertRaisesRegex() must be a subtype of
BaseException, not just of Exception.
Closes#2593