PEP 675: Add explicit `circumference` method (#2618)
Not adding a `radius` attribute, because the Circle class needs to be instantiable from just the `scale` config value. So, I'm going with a method.
This commit is contained in:
parent
5df9e7c829
commit
2b791d84e0
|
@ -227,7 +227,8 @@ value of type ``Shape``, when in fact it should be ``Circle``:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
class Circle(Shape): ...
|
class Circle(Shape):
|
||||||
|
def circumference(self) -> float: ...
|
||||||
|
|
||||||
shape = Shape.from_config({"scale": 7.0})
|
shape = Shape.from_config({"scale": 7.0})
|
||||||
# => Shape
|
# => Shape
|
||||||
|
|
Loading…
Reference in New Issue