Something like this:
> \>\>\> class Movement:
> ...     def __eq__(self, x):
> ...         return type(x) is Movement
> ... 
> \>\>\> dummy = Movement()
> \>\>\> # suppose `bar` is a list of every recorded action in a game
> \>\>\> if dummy in bar:
> ...     if dummy is in bar: # check if the dummy value is in the actions
> ...         raise TypeError("cannot put dummy value in actions log")
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TGWTHLQQMZPEZKKDB7O2V3LDWF5MWTPD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to