Commit Graph

9135 Commits

Author SHA1 Message Date
Matthew Rahtz 68794b15c3
PEP 646: Update based on typing-sig discussions (#1781)
* PEP 646: Simplify based on typing-sig discussions

Feature removals:
* Remove `Map` (to be added in a separate PEP)
* Remove support for all forms of concatenation other than simply prefixing of a single `TypeVarTuple` (fancier forms of concatenation to also be added in a separate PEP)

Semantic changes:
* Try switching `Ts` back to mean the 'unpacked' version (such that `Ts = int, str; Tuple[Ts] = Tuple[int, str]`) to see whether everything still works. (Might revert this, pending future discussion in typing-sig.)

* PEP 646: Clarify that prefixing is not allowed in Callable

* Update PEP 646 based on discussions in typing-sig

Semantic changes:
* Switch back to `Ts` meaning types packed in a `Tuple`
* Disallow unpacked usages of `Ts`
* Unparameterised `Tensor` behaves like `Tensor[Any, ...]`

Clarifications:
* `TypeVarTuple`s are invariant
* `TypeVarTuple`s can not be bound to unknown-length types (e.g. `Tuple[int, ...]`
* `TypeVarTuple`s can not be bound to unions of types
* Empty `*args` behaves like `Tuple[()]`
* `TypeVarTuple`s can not appear in slices

Readability changes:
* Reorder some sections for better flow

* Update PEP 646 with Eric's suggestions and other tweaks

Semantic changes:
* Revert to `*args: *Ts` for new behaviour, and `*args: Tuple[*Ts]` for old behaviour

Fixes:
* Unpacking in Aliases/Ideal Array Type sections
* Various typo/grammar fixes

Other:
* State explicitly that TypeVarTuples can be used in callback protocols
2021-02-07 08:29:17 -08:00
Brett Cannon 6f091c5969
PEP 648: some touch-ups (#1801) 2021-02-06 14:30:43 -08:00
Stefano Borini cdfc88bebe
PEP 637 Added "how to teach" section (#1800) 2021-02-06 10:18:02 -08:00
Brett Cannon 9e81dc8092
PEP 427: clarify how the build tag plays into wheel file selection (#1798) 2021-02-05 14:36:00 -08:00
Hugo van Kemenade a2890cf4bc
PEP 621, 635, 637, 639, 642, 644, 645, 647, 650: Fix single backticks (#1797) 2021-02-05 08:09:26 -08:00
Inada Naoki 814daa8aea
PEP 624: Update alternative ideas (#1793)
Add note about we can avoid creating a temporary Unicode object
in deprecated APIs for some codecs.
2021-02-04 17:39:05 +09:00
Barry Warsaw d3f48ed58f
Fix case of "Python" in PEP 637 (#1794) 2021-02-03 19:22:25 -08:00
Dustin Ingram 3b0098ad9a
PEP 650: Fix typos, improve example (#1792) 2021-02-03 14:35:49 -08:00
Marti Raudsepp 9b64c6ea75
Various typo/grammar/style fixes (#1789)
Changes detected by Topy (https://github.com/intgr/topy), all changes
verified by hand, false positives have been omitted.

These range from straight-out misspellings to debatable hyphen placement.
The hyphen changes are supported by grammar manuals of style.
2021-02-03 06:06:23 -08:00
Pablo Galindo 4dac5c2699 PEP-619: Update the date of the release of Python3.10.0a5 2021-02-03 11:05:36 +00:00
Kevin P. Fleming faf6247812
PEP 639: Changes for clarity and consistency (#1780) 2021-02-02 12:58:38 -08:00
Stefano Borini 476f8b8703
PEP 637: Added clause for star unpacking leaving the index as a tuple (GH-1790) 2021-02-01 09:33:55 -08:00
Inada Naoki 6c41262962
PEP 597: Refinement (#1791) 2021-01-31 12:44:30 +09:00
Inada Naoki b2ce9f86f5
PEP 597: Add EncodingWarning (#1788) 2021-01-30 18:18:19 +09:00
Christopher Wilcox e13d3c1998
Update 3.10.0a4 to be released (#1786) 2021-01-30 00:13:09 +00:00
Brett Cannon 449e75c90c
PEP 629: mark as Final (#1785) 2021-01-28 12:55:19 -08:00
Mario Corchero dc57e02ccd
PEP 648: Add entry points as rejected alternative (#1784) 2021-01-27 13:30:18 -08:00
Nick Coghlan 54a71cd7c3
PEP 558: Make it clear tracing mode is being eliminated (#1783)
The initial version of the PEP entrenched the tracing mode distinction,
and was worded accordingly.

Now that tracing mode is only relevant as a historical artifact that is
being eliminated, the wording should make that clear.

Also removes a stale mention of Python 3.9.
2021-01-27 23:59:56 +10:00
Brett Cannon f096682452
Accept PEP 629 (#1782) 2021-01-26 13:19:45 -08:00
Pradyun Gedam e5ccf9cb7b
PEP 610: Mark as Final (#1779) 2021-01-26 12:55:57 -08:00
Steve Dower 0b7e157a54
PEP 632: Accepted! (#1777) 2021-01-25 17:44:41 +00:00
Mark Shannon 8ab726ddf7
PEP 651: Improve wording a bit. Suggested by Larry Hastings. (#1776) 2021-01-25 10:32:38 +00:00
Brett Cannon 6982646dd8
Update PEP 650 based on reviewer comments (#1778) 2021-01-22 17:10:23 -08:00
Mark Shannon 9d08c18a92
PEP 651: Clarifications, as suggested by GvR. (#1775) 2021-01-22 16:48:00 +00:00
Stefano Borini e5689eb37b
PEP-637 Added notation use case for star arguments on PEP-646 (#1774) 2021-01-21 15:50:03 -08:00
Dustin Ingram 602c9f5691
PEP 650: Updates to the API (#1770) 2021-01-20 11:58:34 -08:00
Guido van Rossum b897f87fc2
PEP 651: Change title to clarify topic (#1773) 2021-01-20 17:12:42 +00:00
Mark Shannon 135af1a54f
PEP 651: Revise C-API (#1772)
*Removes Py_CheckStackDepthWithHeadRoom and makes Py_EnterRecursiveCall call Py_CheckStackDepth.
2021-01-20 16:23:53 +00:00
Mark Shannon 62b03c20a0
PEP 651: Clarify that examples in abstract refer to the PEP being accepted, not now. (#1771) 2021-01-20 15:20:35 +00:00
Ken Jin 9d778c6b28
PEP 646: Fix minor typo (#1769) 2021-01-19 09:58:41 -08:00
Mark Shannon 13b8bb4c5d
PEP 651: Add a couple of missing words. (#1768) 2021-01-19 17:53:22 +00:00
Mark Shannon cc47b869b7
PEP 651: Robust Overflow Handling (#1767)
* First draft of robust overflow handling PEP.

* Edits

* Assign PEP number 651.

* Final edit before publication.
2021-01-19 12:46:22 +00:00
Eric Traut 28fc05c35a
PEP 647: Incorporated feedback from Guido about terminology and type relationship between bool and TypeGuard (#1765) 2021-01-15 20:55:07 -08:00
Brett Cannon a59cc3121c
PEP 650: update post-history and discussions-to (#1764) 2021-01-14 14:01:16 -08:00
Brett Cannon 67ab198c25
PEP 650: Specifying Installer Requirements for Python Projects (#1762) 2021-01-13 17:40:00 -08:00
Chris Angelico 19af5f8f0d
PEP 12: Clean up and modernize guidelines. (#1759)
* PEP 12: Clean up and modernize guidelines.

The peps@python.org list has been shut down, and everything is done via
GitHub pull requests. Also, we no longer need some of the older steps,
and it's easier to read if some of the obscure/unusual options are
buried away in parentheses.

Open to discussion, can split this up if it's controversial.

* PEP 12: Describe number allocation system

* Derp, best to lead people correctly! Thanks Brett

Co-authored-by: Brett Cannon <brett@python.org>

* Don't exclude non-mailing-list discussion targets

Thanks Brett

Co-authored-by: Brett Cannon <brett@python.org>

* PEP 12: Be inclusive of non-mailing-list forums again

* PEP 12: Recommend the use of GitHub's issue tracker for questions

Co-authored-by: Brett Cannon <brett@python.org>
2021-01-13 05:04:05 +11:00
Mario Corchero a1ab0610e8
PEP 648: Add copyright notice (#1760)
Co-authored-by: Chris Angelico <rosuav@gmail.com>

Co-authored-by: Chris Angelico <rosuav@gmail.com>
2021-01-13 04:26:30 +11:00
Larry Hastings 9a4b7c6071 Clarify 649 wrt annotations inside flow control. 2021-01-11 16:14:32 -08:00
Larry Hastings 33b7bdcf94 Minor formatting touch-ups for PEP 649. 2021-01-11 12:23:40 -08:00
Larry Hastings 3227c9aa8f Added PEP 649, Deferred Evaluation Of Annotations...
...zzzz.
2021-01-11 10:25:13 -08:00
Ned Deily b687b1ea91
schedule 3.7.10 and 3.6.13 2021-01-10 14:01:04 -05:00
Mario Corchero e5026ebc42
PEP-648: Change implementation to folder with scripts (#1758)
Moving away from namespace packages after receiving feedback.
2021-01-05 09:58:14 -08:00
Guido van Rossum 7f4bb58481
Revert "PEP 635: Add a rebuttal of PEP 642 (GH-1691)" (#1757)
This reverts commit aafca24693.

PEP 642 was updated and the commentary here is out of date.
IMO we needn't address it here.
2021-01-04 07:37:59 -08:00
Mario Corchero 863c034899
PEP 648: Target Python 3.10 + minor wording fixes (#1754)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-01-04 11:49:52 +00:00
Nick Coghlan 84b1972292
PEP 642 v3: Explicit pattern matching syntax (#1756)
* requires that all uses of bare names be qualified with the user's intent
* ensures that all name binding operations in patterns use the as keyword
* drops alignment with iterable unpacking syntax (always requires square brackets)
* drops alignment with class instantiation syntax (defines a new dedicated instance attribute matching syntax instead)
2021-01-03 23:45:20 +10:00
방성범 (Bang Seongbeom) cdbac8e836
PEP 612: Fix typo (#1755) 2021-01-02 20:39:50 -08:00
Matthew Rahtz f507e8870f
PEP 646: Various updates (#1751)
Naming:
* Rename Tuple
* Rename Tensor -> Array (it's less jargony, and I think it's the more general term)
* Rename Expand -> Unpack (to be consistent with the terminology for normal tuples)
* Rename ArgTs -> Ts, ReturnT -> R
* Rename 'type tuple variable' -> 'type variable tuple'

Semantic:
* Explicitly state that a TypeVarTuple can hold *zero* or more types
* Explicitly state that TypeVarTuple doesn't support variance or bound yet
* Support Union[*Ts]
* Support concatenating multiple unpacked TypeVarTuple when there's no ambiguity
* Support aliases
* Remove support for class overloads; replace with overloads of individual methods

Pedagogical:
* Reorder introductory material to make it clearer how TypeVarTuples behave when not unpacked, and to make it clearer that using them without unpacking them is a perfectly valid thing to do
* Remove example of unpacking being used with a regular Tuple rather than a TypeVarTuple (my main reason for wanting to include it was to emphasise that a TypeVarTuple behaves like a Tuple, but I think this is emphasised better in previous sections now, and since I don't think it has any use cases, it seems better to remove it to keep things shorter and more to the point)
* Replace Tuple[*Ts] with just Ts (now that we've settled on Ts definitely meaning "A Tuple filled with types", writing Tuple[*Ts] is redundant - it's exactly the same as Ts, but with more keystrokes)
* State explicitly that TypeVarTuple can be used with Callable
* Changes args_to_tuples example to args_to_lists (so it's clearer where the Tuple comes from)
* Show more examples of where Map can be used
* Move section on nesting Map to the 'Rationale and Rejected Ideas' section (it's complicated enough to be too distracting if it were in the main section, and since there isn't an obvious use-case, we leave it as an optional feature)
* Add section on a full example of an array type
* Remove ideas for future PEPs (to reduce length)
* Add more detail on the range of type concatenations that are allowable

Other:
* Add Pradeep to the authors list, since he's contributed so much :)
* Add Eric Traut in the acknowledgements
* Update Post-History
* Fix some references
* Fix first Array example to remove the need for a cast
* Various wording tweaks
2021-01-01 17:08:20 -08:00
Guido van Rossum 951dfad2d0 PEP 647: Fix nits found by David Foster 2021-01-01 16:41:42 -08:00
Eric Traut 1f1928e4f6
PEP 647: Added clarification about the type narrowing mechanics (#1753) 2020-12-30 14:26:05 -08:00
Pablo Galindo bb84af267d PEP 648: Fix date format 2020-12-30 21:40:47 +00:00