File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,22 @@ def is_phone_number_normalized(phone_number):
2222 return min_phone_number_digits <= total_digits <= max_phone_number_digits
2323
2424
25+ # Accessing an enum member is ~3x slower than accessing a non-enum member in Python 3.11.
26+ # This was improved in Python 3.12 but there's still a performance overhead (~44% slower).
27+ # That's why this class isn't an enum.
28+ # https://github.com/python/cpython/issues/93910#issuecomment-1165503032
29+ class EmailParsingState :
30+ Starting = 1
31+ Pre = 2
32+ SubDomain = 3
33+
34+
2535def normalize_email_string (email ):
2636 pre_sb = []
2737 pre_sb_specialized = []
2838 sb = []
2939 ws_buffer = []
3040
31- class EmailParsingState :
32- Starting = 1
33- Pre = 2
34- SubDomain = 3
35-
3641 parsing_state = EmailParsingState .Starting
3742
3843 in_extension = False
You can’t perform that action at this time.
0 commit comments