Skip to content

Commit 42d422e

Browse files
committed
cap13: revisão de estilo
1 parent 2b24e25 commit 42d422e

File tree

3 files changed

+338
-250
lines changed

3 files changed

+338
-250
lines changed

code/13-protocol-abc/typing/vector2d_v4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,6 @@ def __complex__(self):
167167
return complex(self.x, self.y)
168168

169169
@classmethod
170-
def fromcomplex(cls, datum):
171-
return cls(datum.real, datum.imag) # <1>
170+
def fromcomplex(cls, n):
171+
return cls(n.real, n.imag) # <1>
172172
# end::VECTOR2D_V4_COMPLEX[]

code/13-protocol-abc/typing/vector2d_v5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def __complex__(self) -> complex: # <2>
168168
return complex(self.x, self.y)
169169

170170
@classmethod
171-
def fromcomplex(cls, datum: SupportsComplex) -> Vector2d: # <3>
172-
c = complex(datum) # <4>
171+
def fromcomplex(cls, n: complex | SupportsComplex) -> Vector2d: # <3>
172+
c = complex(n) # <4>
173173
return cls(c.real, c.imag)
174174
# end::VECTOR2D_V5_COMPLEX[]

0 commit comments

Comments
 (0)