Jukka Lehtosalo
f296b37e80
Fixes to unittest stubs ( #1024 )
...
* Fixes to unittest stubs
* Make types more precise
2017-03-18 14:35:33 -07:00
Jukka Lehtosalo
f2579e532f
Update signature of dict.get ( #852 )
...
Without this change, mypy can't infer proper types for cases like
`d.get(k, [])` where it needs type context to infer the type of
`[]`. We add the value type to the second argument to `get` using
union types, and this provides the context. This doesn't affect
the effective signature of `get`, other than providing the type
context for mypy.
Also removed some related redundant method definitions where we can
just inherit the base class definition. This makes it easier to
keep the method signatures consistent.
Note that this requires a few mypy PRs before mypy will be able to
use this effectively:
* https://github.com/python/mypy/pull/2718
* https://github.com/python/mypy/pull/2715
2017-01-20 07:41:54 -08:00
Jukka Lehtosalo
c577c84a17
Add stub for cryptography.hazmat.primitives.serialization ( #851 )
...
This makes the stubs for cryptoraphy less incompelete. Created using
stubgen. I don't know what the types are.
2017-01-20 07:40:30 -08:00
Jukka Lehtosalo
35978a7ca5
Make signature of DictMixin.get consistent with Mapping.get ( #838 )
2017-01-17 14:08:49 +00:00
Jukka Lehtosalo
734ad44a11
Make MRO of UserDict.DictMixin consistent with Mapping ( #837 )
...
This fixes MRO conflicts produced by mypy when using multiple
inheritance.
2017-01-17 13:55:31 +00:00
Jukka Lehtosalo
f39f9bf694
Make object_hook of json.load and json.loads optional (Python 2) ( #757 )
2016-12-07 13:32:56 -08:00
Jukka Lehtosalo
e05edb60f1
Mypy stub fixes for strict optional mode ( #366 )
2016-07-13 09:38:40 -07:00
Jukka Lehtosalo
b98580d299
Don't use basestring in tempfile stub ( #205 )
...
Fixes #202 .
2016-05-24 16:45:48 -07:00
Jukka Lehtosalo
d3d6a47302
Accept more unicode in 2.7 tempfile stubs ( #201 )
2016-05-16 13:37:15 +01:00
Jukka Lehtosalo
292447bd62
Misc stub fixes ( #181 )
2016-05-04 16:54:57 -07:00
Jukka Lehtosalo
a5d5dcc4f4
Fixes to os.environ ( #172 )
...
Add os.environ.copy() to Python 2 stubs. Fix return
type of os.environ.copy().
2016-04-28 11:53:51 +01:00
Jukka Lehtosalo
8df19841bb
Make Queue generic in Python 2, similar to Python 3 ( #155 )
2016-04-22 15:49:02 +01:00
Jukka Lehtosalo
5eaf522cde
Fixes to urllib2 stubs ( #154 )
2016-04-22 13:19:37 +01:00
Jukka Lehtosalo
fcef262a9b
Support keyword arguments for dict() (Python 2) ( #148 )
2016-04-17 13:07:54 +01:00
Jukka Lehtosalo
70c2274e94
Update dict(...) to accept keyword arguments ( #147 )
...
We can't describe the fact that a keyword argument results in a 'str'
dictionary key in a stub. This needs to be handled elsewhere.
2016-04-16 16:30:15 +01:00
Jukka Lehtosalo
bd36a37481
Add __setattr__ to object
2015-12-05 15:44:28 -08:00
Jukka Lehtosalo
4c547fc4f6
Add object.__new__
...
Not entirely sure about the right signature, though.
2015-11-29 12:18:42 -08:00
Jukka Lehtosalo
d3efa5d6bc
Add missing definitions to Python 3 'traceback'
2015-11-23 21:49:51 -08:00
Jukka Lehtosalo
9640fe569d
Add directories for Python 2 and Python 3 stubs
2015-03-04 20:57:49 -08:00
Jukka Lehtosalo
893f49bd80
Initial commit
2015-03-04 20:51:28 -08:00