Looked at https://github.com/requests/requests/blob/master/requests/structures.py.
The "data" argument to the CaseInsensitiveDict constructor is passed as is to .update(),
so I accept the same argument types as MutableMapping.update.
LookupDict is strangely named and implemented but the point seems to be that you
setattr its keys, and then can access them with both attribute access and subscripting.
See its usage in d1fb1a29ab/requests/status_codes.py (L102).
* Make {C,WIN,PY}FUNCTYPE's restype argument optional (for void returns)
* Make WinError return WindowsError
* Don't have Array explicitly inherit from Sized
(since inheriting from classes with different metaclasses causes problems,
and it is a protocol anyways)
* Have Array.__iter__ properly return an Iterator instead of an Iterable
* Support additional argument types for c_void_p parameters
* Don't allow passing bytes where a writable c_void_p is expected
* Fix type of ctypes._CDataMeta.__[r]mul__
* Rename ctypes._cparam to _CArgObject to match the real type name
* Fix value type of ctypes.HRESULT
* Add stub for ctypes.wintypes
* Fix trailing whitespace in ctypes.wintypes
* Add a workaround to ctypes.Array to fix incorrect typing in some cases
* Expand multiple assignments so mypy recognizes them as type aliases
* Rename ctypes._Pointer to pointer so it can be used externally
This is in our style guide. This is the last piece of offending code; I just submitted ambv/flake8-pyi#10 to enforce the rule in the linter in the future.
This was introduced in a recent version (so it doesn't affect us right now but will if we upgrade the flake8 version used in tests). It gives errors like:
```
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/stdlib/3/re.pyi:21:9: E741 ambiguous variable name 'I'
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/stdlib/3/re.pyi:39:5: E741 ambiguous variable name 'I'
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/stdlib/3/re.pyi:58:5: E741 ambiguous variable name 'I'
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/third_party/2/OpenSSL/crypto.pyi:43:5: E741 ambiguous variable name 'O'
```
These aren't useful for typeshed, because regardless of whether it's good style, these libraries really do contain variables named `I` and `O`.
* ArgumentParser's add_argument returns the Action that was created.
* Make add_argument's dest parameter Optional. _ArgumentGroup's add_argument should also return the Action.
- Made deque.maxlen read-only
- We don't support 3.2, so we don't care about signature changes in it
- There don't seem to be any missing set operations (I compared the dir() of this class to that of builtins.set)
In python3 `RotatingFileHandler` is a subclass of `BaseRotatingHandler` which is a subclass of `FileHandler` which is a subclass of `StreamHandler` which as a `terminator` property but I'm getting a `"RotatingFileHandler" has no attribute "terminator"` error on my code.
A call like this:
```
from attr import attrib
from attr.validators import optional, instance_of
c = attrib(default=None, validator=optional(instance_of(bytes)))
```
Was returning no return value, because the first overload was T -> T.
The solution was to change the ordering so that the first overload is
None -> T and infer the type from the other arguments.
The generic type of the futures provided to the wait method cannot
currently be preserved through this definition. For now deleting the
unused NamedTuple is the best approach.
* Convert type comments to variable annotations in ctypes.__init__
* Add missing List import in ctypes.__init__
* Add missing bound kwarg to _CT TypeVar in ctypes.__init__
* Fix ctypes._CData classmethod definitions
* Fix ctypes Structure/Union __getattr__ definitions
Both Structure's metaclass and Structure itself define a __getattr__.
The former returns field objects (each representing a field definition
in the Structure), while the latter can return anything (the value of
the field in a specific Structure instance).
Structure also defines a __setattr__, while Structure's metaclass
does not.
BigEndianStructure, LittleEndianStructure and Union support the same
operations as Structure does, but the semantics obviously differ.
Depending on the system endianness, exactly one of the EndianStructures
is an alias for Structure, and the other one is a special Structure
subclass. For simplicity, both EndianStructures are considered
subclasses of Structure here, even though this is technically not
always accurate.
* Fix swapped parameter types in ctypes._CData.in_dll
* Add limited support for ctypes._CData.__class__.__mul__
It's not possible to specify the correct return type for __mul__ and
__rmul__ here - see comments for explanation.
* Make ctypes._FuncPtr extend ctypes._CData
* Improve typing of ctypes.cast
* Mark class attributes with ClassVar in ctypes.__init__
* Mark ctypes._CData.from_buffer[_copy] offset arg as optional
* Remove trailing whitespace in ctypes.__init__
* Don't export ctypes.UnionT
* Add ctypes._DLL.__getitem__
* Make ctypes._DLL.__get(attr|item)__ return _FuncPtr instead of Any
* Change ctypes DLL inheritance hierarchy to match the real one better
* Add some missing attributes to ctypes.CDLL
* Rename ctypes._FuncPtr so it doesn't conflict with CDLL._FuncPtr
* Fix type of ctypes.CDLL._FuncPtr
* Merge _FuncProto into _FuncPointer
The function pointer types returned by CFUNCTYPE and friends are the
same as those encountered elsewhere, so there's no need to treat them
differently.
* Fix some leftover references to ctypes._DLL
* Simplify definition of ctypes._DLLT
* Add ctypes.LibraryLoader.__get(attr|item)__
* Use Text instead of str where appropriate in ctypes.__init__
* Make ctypes.c_char accept ints
* Make ctypes.c_[w]char_p accept None
* Remove unneeded Generic base from ctypes.py_object
* Make ctypes.cast accept _cparam
* Fix ctypes._PF being declared too late
* Remove incorrect ctypes.PyDLL.__init__ override