Skip to content

Instantly share code, notes, and snippets.

@acwoss
Created June 8, 2018 15:56
Show Gist options
  • Save acwoss/306a4b40f1bdb16ba613d4622ee266d7 to your computer and use it in GitHub Desktop.
Save acwoss/306a4b40f1bdb16ba613d4622ee266d7 to your computer and use it in GitHub Desktop.
FinancialMagnificentBracket created by acwoss - https://repl.it/@acwoss/FinancialMagnificentBracket
class Idade(object):
def __init__(self, value=None):
self.value = value
def __get__(self, obj, objtype):
return self.value
def __set__(self, obj, val):
if val < 0:
raise ValueError
self.value = val
class Pessoa(object):
idade = Idade(30)
m = Pessoa()
m.idade = -3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment