Commit 18b3312
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.1 parent b991d19 commit 18b3312
1 file changed
+8
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
1357 | 1357 | | |
1358 | 1358 | | |
1359 | 1359 | | |
1360 | | - | |
1361 | | - | |
| 1360 | + | |
1362 | 1361 | | |
1363 | 1362 | | |
1364 | 1363 | | |
| |||
1785 | 1784 | | |
1786 | 1785 | | |
1787 | 1786 | | |
1788 | | - | |
| 1787 | + | |
1789 | 1788 | | |
1790 | | - | |
| 1789 | + | |
1791 | 1790 | | |
1792 | 1791 | | |
1793 | 1792 | | |
| |||
2024 | 2023 | | |
2025 | 2024 | | |
2026 | 2025 | | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
| 2026 | + | |
2030 | 2027 | | |
2031 | 2028 | | |
2032 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
2033 | 2032 | | |
2034 | 2033 | | |
2035 | 2034 | | |
| |||
0 commit comments