Created
May 21, 2012 08:15
-
-
Save alvesjnr/2761130 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
class Obj: | |
def _validate(self): | |
raise NotImplemented("The object %s has not an implemented validation function." % self) | |
def dump(self): | |
return {} #some valid dictionary | |
@classmethod | |
def load1(cls, dct): | |
o = cls() | |
#do what need to do with o | |
return o | |
@staticmethod | |
def load2(dct): | |
o = Obj() | |
#do what need to do with o | |
return o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment