Commit Graph
7 Commits
Author SHA1 Message Date
Jia ChenandGitHub ece1a3e525 Remove pyre-extensions (#5001) 2021-02-02 11:43:21 -08:00
Jia ChenandGitHub 02b3a48313 Annotate load_entry_point() (#4775) 2020-12-14 17:20:40 +01:00
Jia ChenandGitHub 92fa4e799c Using dunder parameter name in builtins._SupportsLessThan (#4264) 2020-06-25 21:02:00 +02:00
Jia ChenandGitHub db2ee3cf3c Replace value assignments with import statements in requests.__init__ (#3941) 2020-04-25 13:18:03 +02:00
Jia ChenandJelle Zijlstra c4b249c9a8 Use dunder parameter name in _Writer.write (#2954) 2019-05-04 22:51:39 -04:00
Jia ChenandJelle Zijlstra ec16e435eb Use dunder parameter name in Container.__contains__ (#2953)
According to Ivan, PEP 544 intentionally did not specify whether method conformance check in protocol inference should look at parameter names. For example, it's up to the type checker to decide whether a class with method defined as `def foo(self, x: int)` would implement a protocol with method `def foo(self, y: int)`.
Mypy decided to ignore parameter names altogether, but we Pyre team decided to be more strict and refuse to match different parameter names (as it is unsound to do so when those methods are invoked with named parameters). Since we rely on the typeshed stubs, we want to make sure at least the important stubs on typeshed conform to our standard. 
This PR changes `Container.__contains__` to use dunder (i.e. positional-only) parameter name specified in PEP484. This change should not affect mypy since it ignores parameter names, but will make Pyre happy as it eliminate the naming requirement for all classes that want to conform to the `Container` protocol.
2019-05-04 22:00:47 -04:00
Jia ChenandSebastian Rittau cda204a151 Remove MutableMapping from requests.Session.cookies's type (#2946) 2019-05-02 10:39:42 +02:00