Skip to content

Commit

Permalink
Move FieldOverrides creation outside of _user_overrides_or_exts (#225)
Browse files Browse the repository at this point in the history
* add lru_cache to useroverrides function

* remove lru_cache due to hashing issue, move namedtuple creation to outside of function

Co-authored-by: Justin Austin <[email protected]>
  • Loading branch information
Justin Austin and Justin Austin authored Jun 7, 2020
1 parent d7d8bb8 commit 3814d6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dataclasses_json/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

Json = Union[dict, list, str, int, float, bool, None]

confs = ['encoder', 'decoder', 'mm_field', 'letter_case', 'exclude']
FieldOverride = namedtuple('FieldOverride', confs)


class _ExtendedEncoder(json.JSONEncoder):
def default(self, o) -> Json:
Expand All @@ -48,9 +51,6 @@ def default(self, o) -> Json:


def _user_overrides_or_exts(cls):
confs = ['encoder', 'decoder', 'mm_field', 'letter_case', 'exclude']
FieldOverride = namedtuple('FieldOverride', confs)

global_metadata = defaultdict(dict)
encoders = cfg.global_config.encoders
decoders = cfg.global_config.decoders
Expand Down

0 comments on commit 3814d6a

Please sign in to comment.