MCPcopy Create free account
hub / github.com/cdgriffith/Box / _camel_killer

Function _camel_killer

box/box.py:75–85  ·  view source on GitHub ↗

CamelKiller, qu'est-ce que c'est? Taken from http://stackoverflow.com/a/1176023/3244542

(attr)

Source from the content-addressed store, hash-verified

73
74
75def _camel_killer(attr):
76 """
77 CamelKiller, qu'est-ce que c'est?
78
79 Taken from http://stackoverflow.com/a/1176023/3244542
80 """
81 attr = str(attr)
82
83 s1 = _first_cap_re.sub(r"\1_\2", attr)
84 s2 = _all_cap_re.sub(r"\1_\2", s1)
85 return re.sub(" *_+", "_", s2.lower())
86
87
88def _recursive_tuples(iterable, box_class, recreate_tuples=False, **kwargs):

Callers 5

test_camel_killerMethod · 0.90
__getitem__Method · 0.85
__setitem__Method · 0.85
__delitem__Method · 0.85
_safe_attrMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_camel_killerMethod · 0.72