mirror of
https://github.com/python/cpython.git
synced 2026-05-16 23:40:45 +00:00
gh-137967: Fix "Whats New" doc example (#138028)
This commit is contained in:
parent
539a4ca1b9
commit
ba8e20b5f2
1 changed files with 3 additions and 3 deletions
|
|
@ -190,11 +190,11 @@ Improved error messages
|
|||
return pi * self.radius**2
|
||||
|
||||
class Container:
|
||||
def __init__(self, inner: Any) -> None:
|
||||
def __init__(self, inner: Circle) -> None:
|
||||
self.inner = inner
|
||||
|
||||
square = Square(side=4)
|
||||
container = Container(square)
|
||||
circle = Circle(radius=4.0)
|
||||
container = Container(circle)
|
||||
print(container.area)
|
||||
|
||||
Running this code now produces a clearer suggestion:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue