Thanks to visit codestin.com
Credit goes to github.com

Skip to content

In json_encoder.py, in _get_type_module(), the regex compilation should be at the module level. #28

@bpietropaoli

Description

@bpietropaoli

Hey there,

The compilation is done in the function instead of at the module level.
As such, it defeats the purpose of the compilation because it'll be executed every single call.
By putting it at the module level (before the function declaration as in the original unijson package), the compilation is executed only once at import time and the regex can be executed fast after that.

Kind regards,
Bastien

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions