Skip to content

Commit

Permalink
Agregar opción __contains__
Browse files Browse the repository at this point in the history
  • Loading branch information
julienmalard committed Apr 7, 2020
1 parent 4b5c8f7 commit bfc6986
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tinamit/geog/región.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ def __getitem__(símismo, itema):

raise KeyError(itema)

def __contains__(símismo, itema):
try:
return símismo[itema] is not None
except KeyError:
return False

def __str__(símismo):
return símismo.nombre

Expand Down

0 comments on commit bfc6986

Please sign in to comment.