Guido van Rossum
df5c64e247
Add StopAsyncIteration; also add StopIteration.value.
2016-07-19 19:45:36 -07:00
Daniel F Moisset
ba349199d7
More general types for frozenset methods ( #277 )
...
Fixes #276 .
2016-07-18 17:17:57 -07:00
speezepearson
534837e1ee
add __{cause,context,traceback}__ to BaseException, per PEP 3134 ( #369 )
2016-07-13 15:26:55 -07:00
Eklavya Sharma
bca4c81b70
builtins: Remove Exception.message. ( #363 )
...
It's not present in 3.4 either, so this looks good to me.
2016-07-13 16:11:51 +01:00
Michael Lee
adc6bf5f94
Update set methods to take multiple iterables ( #349 )
...
As of Python 2.7, you can pass in multiple iterables into some set
methods like union, intersection, difference, and update. So, for
example, `new_set = a.union(b, c)`.
2016-07-07 11:52:22 -07:00
Guido van Rossum
25a45d6daf
Revert "WIP: Mapping.{get,pop} can return default type ( #223 )"
...
This reverts commit d43adbe97e .
Here's a simple example of code that breaks with this PR:
from typing import Mapping, Dict, Tuple
a = {('0', '0'): 42} # type: Mapping[Tuple[str, str], int]
b = a.get(('1', '1'), 0)
This gives an error on the last line:
error: No overload variant of "get" of "dict" matches argument types [Tuple[builtins.str, builtins.str], builtins.int]
2016-05-30 11:55:30 -07:00
Valérian Rousset
d43adbe97e
WIP: Mapping.{get,pop} can return default type ( #223 )
...
* Mapping.{get,pop} can return default type
* Mapping values are covariant
2016-05-30 10:05:44 -07:00
Guido van Rossum
355143851a
Use __delete__, not __del__, in class property. See comments on #199 .
2016-05-17 11:26:14 -07:00
beckjake
70389d14ee
Make property a type ( #199 )
2016-05-16 13:24:55 -07:00
Jakub Stasiak
cd12f6e255
Add some missing "type" attributes ( #200 )
2016-05-14 10:18:36 -07:00
rwbarton
2b80cdf75e
Use overloading rather than Union for MutableMapping.update ( #174 )
...
See https://github.com/python/mypy/issues/1430 for motivation.
2016-05-01 17:50:01 +01:00
Guido van Rossum
79554d6da2
Add type.__call__. Fix #158 . ( #159 )
2016-04-25 16:22:00 +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
tharvik
3c92450972
add __dict__ attribute to class instance
2016-04-04 08:46:04 +02:00
David Fisher
d390ef3161
Make all function annotations accessible from builtins complete
2016-03-11 14:27:28 -08:00
Jakub Stasiak
41f0e7c8b6
Define three argument type() overload (Python 3)
...
This was missing for some reason while the Python 2.7 stubs have it.
Sample test code:
% cat testtype.py
A = type('A', (), {})
print(A.__name__)
Results before:
% python -m mypy --py2 testtype.py
% python -m mypy testtype.py
testtype.py:1: error: Too many arguments for "type"
%
Results after: type checking passes in both modes.
2016-03-03 09:19:59 +00:00
Hong Minhee
9f1ea9c412
Specify attribute types of SyntaxError
2016-02-29 13:35:30 +09:00
David Fisher
48b3b260d1
Remove invalid Python 3 syntax
2016-02-18 16:25:30 -08:00
Robert T. McGibbon
9933080b04
Update builtins.pyi
2016-02-03 15:20:03 -08:00
Robert T. McGibbon
8739c4a188
Improvements to builtins min/max
2016-02-03 15:16:52 -08:00
Guido van Rossum
e40c3eb8c9
Revert "Fix min()/max() overloading with key= parameter. Fixes #1150."
...
It has other problems, e.g. complains about max(x, 10) when the type of x is Any.
This reverts commit 6a47ac7116 .
2016-01-27 11:10:40 -08:00
Guido van Rossum
6a47ac7116
Fix min()/max() overloading with key= parameter. Fixes #1150 .
2016-01-26 11:13:14 -08:00
Guido van Rossum
17d8f20fd5
Add message attribute to class BaseException.
2016-01-25 16:32:47 -08:00
Guido van Rossum
cf82278301
Use plain bytes instead of ByteString in 3/builtins.pyi.
2016-01-25 08:12:46 -08:00
Ismail
fd4d063bb4
Implement fromhex and maketrans method
2016-01-25 15:43:06 +00:00
Matthias Kramm
25a3fac0fd
Fix default parameter syntax.
...
Use 'x:bool = ...' instead of 'x:bool = True' or 'x:bool = False'.
2016-01-22 16:39:15 -08:00
Guido van Rossum
8c2118bace
Move contents of builtins/* to stdlib/*. This simplifies finding stubs.
2016-01-12 12:53:18 -08:00
Ben Longbons
56fe787c74
Update a bunch of stubs
2015-10-19 20:02:10 -07:00
Ben Longbons
f2a12774ee
Use SupportsBytes
2015-10-12 10:45:04 -07:00
Matthias Kramm
337abed05a
add (overwrite with) mypy stubs, if available
2015-09-30 09:59:44 -07:00