MCPcopy Index your code
hub / github.com/qiwsir/StarterLearningPython / __init__

Method __init__

python3code/chapter04/temperature.py:8–12  ·  view source on GitHub ↗
(self, **kargs)

Source from the content-addressed store, hash-verified

6class Temperature:
7 coefficient = {"c": (1.0, 0.0, -273.15), "f": (1.8, -273.15, 32.0)}
8 def __init__(self, **kargs):
9 assert set(kargs.keys()).intersection("kfcKFC"), "invalid arguments {0}".format(kargs)
10 name, value = kargs.popitem()
11 name = name.lower()
12 setattr(self, name, float(value))
13
14 def __getattr__(self, name):
15 try:

Callers

nothing calls this directly

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected