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

Method __new__

example_code/item_064.py:94–100  ·  view source on GitHub ↗
(meta, name, bases, class_dict)

Source from the content-addressed store, hash-verified

92print("Example 6")
93class Meta(type):
94 def __new__(meta, name, bases, class_dict):
95 for key, value in class_dict.items():
96 if isinstance(value, Field):
97 value.column_name = key
98 value.internal_name = "_" + key
99 cls = type.__new__(meta, name, bases, class_dict)
100 return cls
101
102
103print("Example 7")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected