-
-
Save parzibyte/bf3d2c960a1bb45ab39de03cc94e80c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://parzibyte.me/blog | |
""" | |
class Juego: | |
def __init__(self, nombre, precio): | |
self.nombre = nombre | |
self.precio = precio | |
def __eq__(self, otro_juego): | |
# Aquí puedes comparar cualquier cosa de los dos objetos. Debes regresar un Booleano | |
print("Llamada a __eq__!") | |
return otro_juego.nombre == self.nombre and otro_juego.precio == self.precio | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment