8000 PEP 655: Add Discussions-To link to the actual thread · python/peps@c33ec7e · GitHub
[go: up one dir, main page]

Skip to content

Commit c33ec7e

Browse files
committed
PEP 655: Add Discussions-To link to the actual thread
1 parent d54740c commit c33ec7e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pep-0655.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PEP: 655
22
Title: Marking individual TypedDict items as required or potentially-missing
33
Author: David Foster <david at dafoster.net>
44
Sponsor: Guido van Rossum <guido at python.org>
5-
Discussions-To: typing-sig at python.org
5+
Discussions-To: https://mail.python.org/archives/list/typing-sig@python.org/thread/53XVOD5ZUKJ263MWA6AUPEA6J7LBBLNV/
66
Status: Draft
77
Type: Standards Track
88
Content-Type: text/x-rst
@@ -315,7 +315,7 @@ Usage in Python <3.11
315315
If your code supports Python <3.11 and wishes to use ``Required[]`` or
316316
``NotRequired[]`` then it should use ``typing_extensions.TypedDict`` rather
317317
than ``typing.TypedDict`` because the latter will not understand
318-
``(Not)Required[]``. In particular ``__required_keys__`` and
318+
``(Not)Required[]``. In particular ``__required_keys__`` and
319319
``__optional_keys__`` on the resulting TypedDict type will not be correct:
320320

321321
Yes (Python 3.11+ only):
@@ -346,11 +346,11 @@ No (Python <3.11 and 3.11+):
346346

347347
from typing import TypedDict # oops: should import from typing_extensions instead
348348
from typing_extensions import NotRequired
349-
349+
350350
class Movie(TypedDict):
351351
title: str
352352
year: NotRequired[int]
353-
353+
354354
assert Movie.__required_keys__ == frozenset({'title', 'year'}) # yikes
355355
assert Movie.__optional_keys__ == frozenset() # yikes
356356

@@ -464,7 +464,7 @@ as the type of a variable which is only conditionally defined:
464464

465465
class MyClass:
466466
attr: int|Missing
467-
467+
468468
def __init__(self, set_attr: bool) -> None:
469469
if set_attr:
470470
self.attr = 10
@@ -533,7 +533,7 @@ or a check against ``locals()`` for local variables:
533533
packet_bytes: Union[str, Missing]
534534
if packet_data is not None:
535535
packet_bytes = packet.data.encode('utf-8')
536-
536+
537537
if 'packet_bytes' in locals():
538538
reveal_type(packet_bytes) # bytes
539539
socket.send(packet_bytes)

0 commit comments

Comments
 (0)
0