Commit Graph

19 Commits

Author SHA1 Message Date
Yusuke Miyazaki
86883d3df9 Remove unused import statements (#2282) 2018-06-27 20:14:57 -07:00
Jelle Zijlstra
f789ee25ad make EnumMeta instantiable (#2118)
part of #1476. Verified that len(Enum) is still allowed by mypy.
2018-06-11 14:02:16 -07:00
Ethan Smith
e9600db2ec Remove symlinks! (#2132) 2018-05-15 15:18:59 -04:00
Elazar Gershuni
b41c6dafee Make Enum Iterable (etc.) only structurally (#1755)
Can't express the precise type nominally - see mypy#3210 for details

* Make self generic in __contains__
2017-12-21 13:32:10 -08:00
Elazar Gershuni
97fb265a4c Avoid over-constraining selftype of EnumMeta (#1770)
This is needed for python/mypy#4311, and is sound.
2017-12-04 11:21:57 -08:00
Elazar Gershuni
d4b21efbe8 Derive EnumMeta from ABCMeta (#1598)
Avoid inconsistent metaclass structure for enum mixins due to #1595 - e.g. mypy/#2824
2017-09-10 17:44:53 -07:00
Jelle Zijlstra
16aa0651ae Revert "Add __new__ to str and int stubs in both Pythons. (#1352)" (#1466)
This reverts commit fed4e03e53.
2017-07-06 14:21:54 -07:00
Semyon Proshev
fed4e03e53 Add __new__ to str and int stubs in both Pythons. (#1352)
* Update default values to `...` in `__init__` and `__new__` in `int` and `str`.
* Add `__new__` to `enum.IntEnum` to override inherited `__new__`.
* Add `type: ignore` comment to `IntEnum`
2017-06-12 20:53:32 -07:00
mistermocha
2053e5882f Completing functionality for enum.auto (#1331)
Full context: https://github.com/python/mypy/pull/3441

Closes python/mypy#3434.
2017-05-27 15:06:00 -07:00
Jelle Zijlstra
4f2dd0f446 remove unused type ignore flags (#1346)
Verified that none of those are necessary for pytype.
2017-05-26 08:28:51 -07:00
Jelle Zijlstra
e3f495b7e9 Add missing enum attributes (#1195)
Fixes #854 (unless there's more I'm missing).
2017-04-24 15:30:59 -07:00
Jelle Zijlstra
f7e4cb8c79 make enums support len() (#1139) 2017-04-05 08:22:28 -07:00
Guido van Rossum
f44e461d19 Use a separate type variable for unique() (#1138)
* Use a separate type variable for unique()

See https://github.com/python/typeshed/pull/1136#discussion_r109727053

* actually use the new typevar
2017-04-04 23:48:19 -07:00
Guido van Rossum
7027c3e4e8 Support enum iteration (#1136)
* Support enum iteration.

Fixes python/mypy#2305.

* Make EnumMeta inherit from type, not ABCMeta.
2017-04-04 10:17:52 -07:00
Lukasz Langa
bbc7594ec7 Add Flag, IntFlag and auto to enum stubs
Fixes python/mypy#2609
2016-12-28 11:34:56 -08:00
Guido van Rossum
896110fd54 The value member of an IntEnum object is an int. 2016-09-29 09:48:43 -07:00
Alvaro Caceres
d0ac66f5f8 Use "..." for attribute values, instead of None, [], {} 2016-06-15 14:10:04 -05:00
Matthias Kramm
d2a3d4a4ed Use explicit "# type: str" instead of '' shortcut. 2015-11-09 07:59:24 -08:00
Matthias Kramm
337abed05a add (overwrite with) mypy stubs, if available 2015-09-30 09:59:44 -07:00