File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,14 +88,3 @@ def get_legacy_py_generator_body_template():
8888 # else:
8989 _y = _i.send(_s) # let the implementation decide if None means "no new input" or "new input = None"
9090"""
91-
92-
93- def is_identifier (string ):
94- """
95- Replacement for `str.isidentifier` when it is not available (e.g. on Python 2).
96- :param string:
97- :return:
98- """
99- if len (string ) == 0 or string [0 ].isdigit ():
100- return False
101- return all ([s .isalnum () for s in string .split ("_" )])
Original file line number Diff line number Diff line change 1616from types import FunctionType
1717
1818
19+ if sys .version_info >= (3 , 0 ):
20+ is_identifier = str .isidentifier
21+ else :
22+ def is_identifier (string ):
23+ """
24+ Replacement for `str.isidentifier` when it is not available (e.g. on Python 2).
25+ :param string:
26+ :return:
27+ """
28+ if len (string ) == 0 or string [0 ].isdigit ():
29+ return False
30+ return all ([s .isalnum () for s in string .split ("_" )])
31+
1932try : # python 3.3+
2033 from inspect import signature , Signature , Parameter
2134except ImportError :
@@ -1558,9 +1571,3 @@ def compile_fun_manually(target,
15581571 new_f .__source__ = source_lines
15591572
15601573 return new_f
1561-
1562-
1563- if sys .version_info >= (3 , 0 ):
1564- is_identifier = str .isidentifier
1565- else :
1566- from makefun ._main_legacy_py import is_identifier
You can’t perform that action at this time.
0 commit comments