MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / convert

Method convert

example_code/item_065.py:210–213  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

208print("Example 12")
209class StringField(Field):
210 def convert(self, value):
211 if not isinstance(value, str):
212 raise ValueError
213 return value
214
215class FloatField(Field):
216 def convert(self, value):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected