Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
  • Loading branch information
BvB93 and Fidget-Spinner authored Aug 5, 2021
commit ab3a89f1d74408cbef146afa44199d1fb8a7678f
4 changes: 1 addition & 3 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,9 +1244,7 @@ def __subclasscheck__(self, cls):

def __reduce__(self):
func, (origin, args) = super().__reduce__()
if self._name == "Optional":
args = args[1] if args[0] is type(None) else args[0]
return func, (origin, args)
return func, (Union, args)


def _value_and_type_iter(parameters):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Fixed an issue wherein the `__name__` and `__qualname__` attributes of
subscribed specialforms could be `None`.
Fixed an issue wherein the ``__name__`` and ``__qualname__`` attributes of
subscribed specialforms could be ``None``.