Skip to content

Commit

Permalink
Admite resposta com Union
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorgs committed Sep 27, 2023
1 parent b3dea6e commit f97015f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion poo/ex/20232/07-mypy.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ print(inscreve(Pessoa('Sozinho')))
<div class="testcode">
try:
from typing import Optional
assert inscreve.__annotations__ == {'dono': Pessoa, 'pet': Optional[Pet], 'return': str}, 'Anotações de tipo incorretas'
assert inscreve.__annotations__ == {'dono': Pessoa, 'pet': Optional[Pet], 'return': str} or inscreve.__annotations__ == {'dono': Pessoa, 'pet': Union[Pet, None], 'return': str}, 'Anotações de tipo incorretas'

assert inscreve(Pessoa('Fulano'), Pet('Rex', 'cachorro')) == 'Inscrição realizada: Fulano e Rex'
assert inscreve(Pessoa('Sozinho')) == 'Inscrição realizada: Sozinho'
Expand Down

0 comments on commit f97015f

Please sign in to comment.