MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / __init__

Method __init__

suds/sax/date.py:60–73  ·  view source on GitHub ↗

Constructor. @param value: The date value of the object. @type value: (datetime.date|str) @raise ValueError: When I{value} is invalid.

(self, value)

Source from the content-addressed store, hash-verified

58 __slots__ = ('value', )
59
60 def __init__(self, value):
61 """Constructor.
62
63 @param value: The date value of the object.
64 @type value: (datetime.date|str)
65 @raise ValueError: When I{value} is invalid.
66
67 """
68 if isinstance(value, datetime.date):
69 self.value = value
70 elif isinstance(value, str):
71 self.value = self.parse(value)
72 else:
73 raise ValueError('invalid type for Date(): %s' % (type(value), ))
74
75 @staticmethod
76 def parse(value):

Callers 1

__init__Method · 0.45

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected