You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pattern plays better with type checkers, and makes it clearer that NoMatch is a singleton value rather than a singleton type (i.e. consumers should check for is NoMatch rather than isinstance(x, NoMatch)).
This pattern plays better with type checkers, and makes it clearer that
NoMatchis a singleton value rather than a singleton type (i.e. consumers should check foris NoMatchrather thanisinstance(x, NoMatch)).This way if we ever wanted to type annotate the
matchmethods below, their signature could be:See https://peps.python.org/pep-0484/#support-for-singleton-types-in-unions for reference.
Originally posted by @jcrist in #6041 (comment)
The text was updated successfully, but these errors were encountered: