Commit Graph

66 Commits

Author SHA1 Message Date
Max 534c911d7a Update generic class attribute and type variable usage (#239)
See https://github.com/python/mypy/issues/2878
2017-05-10 20:54:35 -07:00
Jelle Zijlstra a7e294d3b4 PEP 484: Add implicit promotions for Python 2.7 (#245)
This was discussed in https://github.com/python/typeshed/issues/270#issuecomment-296411726. Both mypy and pytype behave as described already. We should document this behavior in the PEP to make sure people are aware of it and promote uniformity.

Mypy also implicitly promotes bytearray to bytes in both Python 2 and 3. Not sure if that's worth codifying in the PEP too.

@vlasovskikh Is this also OK for PyCharm?
2017-04-24 08:24:24 -07:00
Ivan Levkivskyi 257e909cae PEP 484: Clarify scoping of type variables (#231) 2017-03-24 08:35:10 -07:00
Ivan Levkivskyi 881c6bebdb PEP 484: Add NoReturn type (#218)
As discussed in python/typing#165.
2017-03-17 13:46:55 -07:00
Ivan Levkivskyi ccae12b0ba PEP 484: Clarify type erasure and instantiation of concrete collections (#193)
Fixes python/typing#367
2017-01-31 16:27:53 -08:00
Ivan Levkivskyi 07aa25d192 PEP 484: add an example of iterable unpacking with type comments (#190)
Fixes python/typing#363
2017-01-27 14:29:16 -08:00
Mariatta f67dd4a759 Remove extra backticks (#184) 2017-01-19 10:00:52 -08:00
Nick Nystrom 7bdfb0006d Spelling (gneric > generic) (#178) 2017-01-11 09:18:56 +11:00
Naomi Seyfer 26b4086667 Document `__foo` syntax for positional-only args (#147) 2016-12-03 16:02:52 -08:00
Naomi Seyfer 22d8c63e03 Fix transposed letters in `agrument` (#146) 2016-12-02 17:16:35 +11:00
Ivan Levkivskyi 6a74c9ebaf PEP 484: Add a note that misplaced type comments are errors for typecheckers (#133)
Fixes python/typing#210.

This behaviour with --fast-parser is in mypy since mid-May. It looks like nobody is complaining.
2016-11-06 10:54:51 -08:00
Ivan Levkivskyi ada7d3566e PEP 484: Allow annotating first argument of instance and class methods (#89) 2016-11-01 08:15:17 -07:00
Ivan Levkivskyi a1cd7fb7c8 Clarify per-argument type comments in PEP 484 (#126) 2016-11-01 08:12:17 -07:00
Ivan Levkivskyi bf827dc23d [WIP] Add Coroutine ABC to PEP 484 (#125)
* Simpler example for Coroutine
2016-11-01 08:07:53 -07:00
Ivan Levkivskyi d309d32728 Soften restriction for runtime generics in PEP 484 (#120)
Fixes https://github.com/python/typing/issues/303.

See also https://github.com/python/mypy/pull/2302 (which removes the restriction from mypy).

As a motivation, in Python one always can substitute expressions, so that if ``IntNode = Node[int]; IntNode()`` works, then it is reasonable to also allow ``Node[int]``, but say that the first way is preferred.
2016-10-24 10:29:40 -07:00
Guido van Rossum 2ec55d541d Change "iff" -> "if" in example docstrings. 2016-10-20 21:35:42 -07:00
Ivan Levkivskyi 68ef9a665b Update the type alias example in PEP 484 (#118) 2016-10-18 08:07:44 -07:00
Ivan Levkivskyi 0f5e998985 Tweak the scope of type: ignore comment (#114)
Fixes python/typing#292
2016-10-10 13:20:42 -07:00
Ivan Levkivskyi c1dc44b21f Updates for PEPs 484 and 483 (#111) 2016-09-30 16:25:26 -07:00
Ivan Levkivskyi 5f30d8f81a Clarify meaning of bare Tuple, etc. (#110)
Fixes python/typing#284
2016-09-27 08:34:50 -07:00
Ivan Levkivskyi a919235364 [WIP] Semantics of variance in type variables and notation conventions (#68)
* Semantics of variance in type variables and notation conventions

* Notation convention for type variables in PEP 8
2016-08-03 11:33:00 -07:00
Ivan Levkivskyi 78478bc886 Add scoping rules for type variables to PEP 484 (#63)
Also clarify the description of NewType() a bit.

Fixes python/typing#249
2016-07-29 16:53:04 -07:00
Marti Raudsepp 04a6af2ab1 Fix various typos, spelling and grammar errors
Errors detected using Topy (https://github.com/intgr/topy), all changes
verified by hand.
2016-07-11 18:35:35 +03:00
Guido van Rossum bf22a02332 Add explanation of singletons in unions to PEP484
By Ivan Levkivskyi (https://github.com/python/typing/pull/240).
2016-07-05 09:35:49 -07:00
Guido van Rossum 75be7047af Add typing.TYPE_CHECKING to PEP 484. 2016-06-08 11:13:41 -07:00
Guido van Rossum 02a9d6de10 The type of an empty tuple is spelled Tuple[()]. Fixes upstream #231. 2016-06-06 13:43:37 -07:00
Guido van Rossum 2ec3031a74 Fix an indentation error in the rST for NewType (Ryan Gonzalez). 2016-06-06 08:49:12 -07:00
Guido van Rossum 7596c54962 Add NewType() to PEP 484. 2016-06-01 18:02:33 -07:00
Guido van Rossum 18fe9797e6 Add Type and ContextManager to list of everything in typing.py. 2016-05-27 12:01:20 -07:00
Guido van Rossum 07067f64e3 Add annotation to async def example. 2016-05-26 09:20:48 -07:00
Guido van Rossum 014a869a2a Short subsection on annotating coroutines (Ivan L, #225). 2016-05-24 12:18:54 -07:00
Guido van Rossum 9fd8df6d0c Improve wording on covariance of Type[] (Ivan L, #107). 2016-05-20 11:33:13 -07:00
Guido van Rossum e70675917d Clarify a sentence that mentioned LoggedVar[t]. 2016-05-19 10:15:48 -07:00
Guido van Rossum 92eb68bca0 Add section to PEP 484 on new feature Type[C]. 2016-05-18 10:04:22 -07:00
Guido van Rossum 1b9ff5e69b Fix some cursive markup. 2016-05-09 20:42:47 -07:00
Guido van Rossum aee868bdea Edits by Ivan Levkivskyi to be more precise about types vs. classes.
From https://github.com/python/typing/pull/214.
2016-05-06 16:06:56 -07:00
Serhiy Storchaka 3dad438872 Issue #26916: Fixed words duplications. 2016-05-03 12:03:16 +03:00
Guido van Rossum 6372e0621d Rip out the promotion from bytearray/memoryview to bytes. See http://bugs.python.org/issue26800. 2016-04-24 17:55:04 -07:00
Guido van Rossum 348da7712a Add Text alias. 2016-04-05 16:35:54 -07:00
Guido van Rossum 3f5669021e Add DefaultDict to PEP 484. 2016-04-05 09:16:06 -07:00
Guido van Rossum 9f33fa7793 Update the section on type erasure to disallow Node[int]() -- you must use a type alias. 2016-04-04 17:39:26 -07:00
Guido van Rossum 11e9267809 Show example of 2.7 syntax for argument-less function, and mention skipping 'self'. 2016-03-22 18:12:14 -07:00
Guido van Rossum 6ce45f1256 Give an explicit example for how to annotate *args, **kwds. 2016-03-22 14:54:38 -07:00
Guido van Rossum cf6962bc20 Clarify what's allowed in the base classes when making a new generic class. 2016-03-22 08:56:19 -07:00
Guido van Rossum db9caac261 Relax constraints on @overload. It may occur in modules if followed by a non-@overload version. 2016-03-21 13:51:08 -07:00
Guido van Rossum f81fd32c43 Updates to PEP 484 concerning the syntax for Python 2.7 and straddling code. 2016-03-21 13:31:02 -07:00
Guido van Rossum 70a63a4751 Moved ambv/typehinting repo to python/typing. Yeah! 2016-01-22 16:26:17 -08:00
Guido van Rossum 238df5a182 Update PEP 484 with recommended Python 2 alternative. 2016-01-11 09:36:24 -08:00
Guido van Rossum 0edb99f346 Add Awaitable, AsyncIterable, AsyncIterator to PEP 484 (to be released 3.5.2). 2015-12-03 15:27:36 -08:00
Ethan Furman b3a934952e fix typo 2015-10-30 08:45:05 -07:00