Skip to content

Commit ba00969

Browse files
authored
Merge branch 'main' into update-generics-pep695
2 parents 1d49b93 + b90ee6b commit ba00969

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/spec/enums.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ behaviors::
7878
reveal_type(Color["RED"]) # Revealed type is 'Literal[Color.RED]' (or 'Color')
7979
reveal_type(Color(3)) # Revealed type is 'Literal[Color.BLUE]' (or 'Color')
8080

81-
Unlike most Python classes, Calling an enum class does not invoke its constructor.
81+
Unlike most Python classes, calling an enum class does not invoke its constructor.
8282
Instead, the call performs a value-based lookup of an enum member.
8383

8484
An Enum class with one or more defined members cannot be subclassed. They are
@@ -266,10 +266,10 @@ tuple values and the constructor signature::
266266
self.mass = mass
267267
self.radius = radius
268268

269-
MERCURY = (1, 3.303e+23, 2.4397e6)
270-
VENUS = (2, 4.869e+24, 6.0518e6)
271-
EARTH = (3, 5.976e+24, 6.37814e6)
272-
MARS = (6.421e+23, 3.3972e6) # Type checker error (optional)
269+
MERCURY = (1, 3.301e+23, 2.4397e6)
270+
VENUS = (2, 4.867e+24, 6.0518e6)
271+
EARTH = (3, 5.972e+24, 6.37814e6)
272+
MARS = (6.417e+23, 3.3962e6) # Type checker error (optional)
273273
JUPITER = 5 # Type checker error (optional)
274274

275275
reveal_type(Planet.MERCURY.value) # Revealed type is Literal[1] (or int or object or Any)
@@ -302,7 +302,7 @@ checkers should enforce this declared type when values are assigned to
302302
def __init__(self, value: int, mass: float, radius: float):
303303
self._value_ = value # Type error
304304

305-
MERCURY = (1, 3.303e+23, 2.4397e6)
305+
MERCURY = (1, 3.301e+23, 2.4397e6)
306306

307307
If the literal values for enum members are not supplied, as they sometimes
308308
are not within a type stub file, a type checker can use the type of the

0 commit comments

Comments
 (0)