Commit Graph

104 Commits

Author SHA1 Message Date
James Hilton-Balfe 5fd06047be
PEP 484: Add missing def to NewType example function (#2890) 2022-11-16 14:15:09 -08:00
Jelle Zijlstra 83b976da18
Add Typing Topic (#2670)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-06 17:36:39 -07:00
Hugo van Kemenade 85c4c86532
PEP 484: Fix citation references (#2638) 2022-06-10 21:06:29 +01:00
CAM Gerlach a6336e9d74
Lint: Update headers and checks per current guidance & provide helpful feedback (#2484)
* Lint: Disable a couple potentially problematic/unneeded hooks

* Lint: Refine regex for existing Content-Type and PEP references checks

* Lint: Refine regex for Python-Version check and fix a couple deviations

* Lint: Refine regex for Created check and fix a couple deviations

* Lint: Refine regex for Resolution check and fix a few deviations

* Lint: Add new check for Post-History header

* Lint: Add check for Discussions-To header link

* Lint: Add basic check for PEP title presense & excessive length

* Lint: Add check for PEP/BDFL-Delegate header

* Lint: Add check for Sponsor header

* Lint: Add check for legacy Author field format

* Lint: Add check for RST Author field

* Lint: Use more helpful, user-oriented descriptions for header checks

* PEP 245: Add historical note and archive links to wiki page/email lsit

* PEP 628: Add direct link to resolution in acceptance message

* Lint: Explictly allow all valid RFC 2822 line continuations in headers

* Lint: Tweak Post-History and Resolution checks to accept fragments
2022-04-20 04:53:08 -05:00
CAM Gerlach 6c980148f2
PEP 484: Mark as Final (#2380) 2022-03-04 18:32:08 +00:00
Adam Turner 42f88f1ce2
Display list names in Resolution and Discussions-To headers (#2361) 2022-02-27 14:46:36 -08:00
Adam Turner 113e490701
Several PEPs: Use explicit `:pep:` and `:rfc:` roles (#2209) 2022-01-21 11:03:51 +00:00
Guido van Rossum 0f7f6400a1
PEP 484: Clarify that 'import ... as ...' means 'X as X' (#1630) 2020-09-30 19:46:20 -07:00
Matt a04c3acd3f
PEP 484: Fix upper bound example (#1421)
The example in the PEP was incorrect: it does not work since it would require `Comparable` to be defined as a Protocol, which were introduced in a later PEP (PEP 544).

For more info see #1419.
2020-06-05 21:30:54 -07:00
Matt Colen e35f18e370
PEP 484: Add missing single quote to sample code (#1413) 2020-05-26 16:11:55 +10:00
Guido van Rossum 67642567c6 PEP 484: Fix other occurrences of 'parametriz' 2020-02-24 20:21:41 -08:00
Ethan Smith 73b35bb7ff
PEP 483, 484, 585: Use parameterized instead of parametrized (#1318)
Google prefers "parameterize" and PEP 484 uses it in a majority of cases. So does the stdlib. So PEP 585 has to follow.
2020-02-24 20:18:17 -08:00
Goutham Bhat 8067cb323e PEP 484: Remove square brackets around ellipsis (#1263) 2019-12-28 21:05:26 -07:00
Jelle Zijlstra a2ae50206b PEP 484: Change the consent requirement to be informational (#1218) 2019-11-05 12:07:33 -08:00
Ben Kooiman-Cox d824da7cd8 Add missing words in pep-0484 (#1107) 2019-06-14 19:54:19 -07:00
Peter Schmidt 6e970b9522 PEP 484: Fixed typos, IOW, apply PEP8 inline comment space (#1106) 2019-06-13 22:15:08 -07:00
Jelle Zijlstra eb6282b4a7 Change specification for `# type: ignore` (#1072)
As discussed on the typing-sig mailing list, the currently specified behavior for `# type: ignore` on a line by itself has remained mostly unimplemented and doesn't seem useful. Instead, the PEP now mandates a syntax for ignoring all errors in a specific file, which is more obviously useful.

I considered adding a sentence like "Individual type checkers may add additional syntax for silencing errors", but it didn't seem particularly useful since type checkers in general are free to add extensions to what PEP 484 specifies.

While I was at it I added a reference to PEP 526 to an out-of-date sentence adjacent to the modified paragraph.
2019-05-22 08:22:39 -07:00
Sebastian Rittau 696664643d PEP 484: Add @type_check_only (#858)
Per discussion in python/typing#597.
2019-04-12 15:31:37 -07:00
Sebastian Rittau cd1efca559 PEP 484: Remove mention of typing.io and .re (#821) 2018-10-29 16:36:42 +00:00
Jelle Zijlstra 18b3312574 PEP 484: Clarify definition of AnyStr (#744)
The definition of AnyStr as given makes sense only in Python 3, as observed by @srittau. To prevent confusion, this PR changes the definition to use Text instead of str.

I also changed the two places where AnyStr was defined as an example, and made a few other related adjustments:
- Remove mention of None as modifying the type, which is not true as of #689.
- Move Text up in the list of convenience definition because we now need it for the definition of AnyStr.
- Modify definition of Optional to use `None` instead of `type(None)`, because the latter is not a valid static type.
2018-09-12 11:48:04 -07:00
Jelle Zijlstra 0630155b47 PEP 484: Do not require type checkers to treat a None default specially (#689)
Following discussion in python/typing#275, there is a consensus that it is better to require optional types to be made explicit. This PR changes the wording of PEP 484 to encourage
type checkers to treat a None default as implicitly making an argument Optional.
2018-07-09 21:22:44 -07:00
Nick Coghlan 307dda38d4
PEP 1: Add a separate "Provisional" PEP status (#577)
This adds an explicit "Provisional" status for PEPs, making
it easier to track which PEPs are truly Final, and which
are pending further further public feedback based on
their initially published reference implementations.
2018-07-08 11:50:57 +10:00
Guido van Rossum bb9ca321dc Accept PEP 561 and link to it from the relevant section in PEP 484 2018-06-27 16:19:14 -07:00
Jelle Zijlstra 26926a0ba8 Arguments that end with `__` are not positional-only (#670)
This came up in python/mypy#5156; we agreed that it was an oversight in the original specification of this feature to not allow this.
2018-06-06 17:01:24 +01:00
Mariatta 941b0580b3
PEP 484: Fix a typo in code example (GH-591) 2018-03-13 09:43:20 -07:00
Davydenko Myroslav 5920dc1117 PEP 484: Fix the example code (GH-583) 2018-03-03 13:19:13 -08:00
Davydenko Myroslav 2d317ff215 Fix syntax error (#582) 2018-02-28 05:36:10 +11:00
Łukasz Langa cea4966702 lukasz@langa.pl -> lukasz@python.org 2018-01-27 13:19:45 -08:00
Ivan Levkivskyi a81f56f751 Add coding style recommendations for variable annotations (#548) 2018-01-18 19:33:13 -08:00
Guido van Rossum e7fea64f2b
Add links to PEP 563. (#451)
Mention an updated schedule for non-provisional status and the end of
non-typing annotations in PEP 563, and link there for the __future__
statement as well.
2017-12-04 08:46:27 -08:00
Ethan Smith e4b790c194 Add suggestion about multiple comment syntax (#476)
Describing the status quo.
2017-11-17 15:49:25 -08:00
Mariatta cf3bad5ab3
Revert "Rename all .txt PEP files to .rst (GH-462)" (GH-464)
This reverts commit bb0e518ed3.
2017-11-11 11:28:55 -08:00
Huang Huang bb0e518ed3 Rename all .txt PEP files to .rst (GH-462)
For https://github.com/python/peps/issues/1
2017-11-11 10:30:43 -08:00
Iustin Pop 29e825f0c2 A few wording fixed to pep-0484 (#339) 2017-09-12 16:29:16 -07:00
Ethan Smith ee64ced217 PEP 484: Clarify Python versioning in stub file search path (#410) 2017-09-09 20:56:06 -07:00
Matthias Kramm 1a92d6ea0d PEP 484: Remove statement about unicode, in the python2.7 section. (#302)
See https://github.com/python/typing/issues/418#issuecomment-313753006.
Let's leave it up to type-checkers whether they want `unicode`, in Python 2
code, to mean "only unicode" or "str or unicode".
2017-07-18 13:59:39 -07:00
Jelle Zijlstra 7221386f27 PEP 484: Clarify that submodules in a package are exported (#309)
See discussion in https://github.com/python/typeshed/pull/1484#discussion_r127114355.
2017-07-17 15:51:21 -07:00
Ivan Levkivskyi 25b7a873f8 Allow deriving NewType from another unique type (#271)
See discussion in python/mypy#3465
2017-05-30 09:56:56 -07:00
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