Skip to content

Instantly share code, notes, and snippets.

@Marlysson
Last active August 24, 2016 19:51
Show Gist options
  • Save Marlysson/1de5088e5f9d9ae4551d59016c67c06b to your computer and use it in GitHub Desktop.
Save Marlysson/1de5088e5f9d9ae4551d59016c67c06b to your computer and use it in GitHub Desktop.
Abstração de Tipo Build-in
class Data(object):
def __init__(self,dia=None,mes=None,ano=None):
if all([dia != None, mes != None , ano != None]):
self.dia = dia
self.mes = mes
self.ano = ano
else:
from datetime import date
hoje = date.today()
self.dia = hoje.day
self.mes = hoje.month
self.ano = hoje.year
def nativo(self):
from datetime import date
return date(self.ano,self.mes,self.dia)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment