MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / key_not_string

Function key_not_string

mongoengine/fields.py:1015–1021  ·  view source on GitHub ↗

Helper function to recursively determine if any key in a dictionary is not a string.

(d)

Source from the content-addressed store, hash-verified

1013
1014
1015def key_not_string(d):
1016 """Helper function to recursively determine if any key in a
1017 dictionary is not a string.
1018 """
1019 for k, v in d.items():
1020 if not isinstance(k, str) or (isinstance(v, dict) and key_not_string(v)):
1021 return True
1022
1023
1024def key_starts_with_dollar(d):

Callers 1

validateMethod · 0.85

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected