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

Method __init__

suds/sax/date.py:170–183  ·  view source on GitHub ↗

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

(self, value)

Source from the content-addressed store, hash-verified

168 __slots__ = ('value', )
169
170 def __init__(self, value):
171 """Constructor.
172
173 @param value: The datetime value of the object.
174 @type value: (datetime.datetime|str)
175 @raise ValueError: When I{value} is invalid.
176
177 """
178 if isinstance(value, datetime.datetime):
179 self.value = value
180 elif isinstance(value, str):
181 self.value = self.parse(value)
182 else:
183 raise ValueError('invalid type for DateTime(): %s' % type(value))
184
185 @staticmethod
186 def parse(value):

Callers

nothing calls this directly

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected