Skip to content

Commit

Permalink
Add typing in so mypy can actually catch the incorrect BASIC_ALLOWED_…
Browse files Browse the repository at this point in the history
…ATTRS
  • Loading branch information
danthedeckie committed Oct 31, 2024
1 parent 32f1bfc commit c4e1a61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion simpleeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
import sys
import warnings
from random import random
from typing import Type, Dict, Set, Union

########################################
# Module wide 'globals'
Expand Down Expand Up @@ -144,7 +145,7 @@

# Opt-in type safety experiment. Will be opt-out in 2.x

BASIC_ALLOWED_ATTRS = {
BASIC_ALLOWED_ATTRS: Dict[Union[Type, None], Set] = {
int: {
"as_integer_ratio",
"bit_length",
Expand Down

0 comments on commit c4e1a61

Please sign in to comment.