Last active
August 24, 2016 19:51
-
-
Save Marlysson/1de5088e5f9d9ae4551d59016c67c06b to your computer and use it in GitHub Desktop.
Abstração de Tipo Build-in
This file contains hidden or 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
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