There were two problems AFAICT:
- There are multiple Loader classes without a common base class,
so this should really be a union or a protocol.
- The argument is supposed to be a class, not an instance.
Rather than figuring out a fix (which would probably require some
nasty refactoring) I'm just going back to the old situation where
these arguments are implicitly annotated with `Any`.
See also https://github.com/python/typeshed/pull/1657#pullrequestreview-72049880
* Replace `self` with `cls` in classmethod
* Group classmethods together, as in the actual stub
* Use float instead of Union[int, float] in coding style example
* Add stub for unittest.mock.patch.multiple()
* Use ... for default arguments in unittest.mock.patch() et al.
* Tighten type of create argument to patch() et al.
I disagree with the recommendation that users create incomplete stubs, because such stubs lead to false positive type checker errors (see for example #525). I would like to instead set a norm that all stubs should contain all public objects in the library they cover.
Makes heavier use of generics to minimize code. Fixes some incorrect
types. Also reordered to allow easy comparison against class listings
and documentation.
It also improves the type checking of contained values. Some methods
were removed because they are implemented by a base class (i.e.,
*__iter__()*, *__str__()*, and *__contains__()*). *__hash__()* was
removed because arrays are unhashable types.
This commit adds a few missing return types to the Python 3 textwrap
stubs and fleshes out the Python 2 textwrap stubs so they're on par with
the Python 3 version.
This change:
1. Changes the order of the arguments in Python 2 and Python 3
to match the order from the source code instead of the
documentation.
2. Adds other undocumented attributes besides whitespace_trans
(for consistency).
3. Moves the '*' argument in TextWrapper.__init__ for Python 3
to match the source code.
4. Made function stub formatting consistent with typeshed style
conventions.
* Add new methods to socket stubs.
Also fix a couple of invalid types in recv*_into() socket methods.
* Add double-underscores to parameters for position-only arguments
Fixes the following issues:
* Literals rather than ... for default values
* None rather than ... for default value of typed variable
* Literals rather than ... # type for top level constants
* # Foo rather than # type: Foo
* return value of init not set to None