You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression : ValueError: Invalid co_name '_results_bag' for created function on python 2 #91
The problem is that the is_identifier function proposed is too restrictive:
def is_identifier(string):
"""
Replacement for `str.isidentifier` when it is not available (e.g. on Python 2).
:param string:
:return:
"""
if len(string) == 0 or string[0].isdigit():
return False
return all([s.isalnum() for s in string.split("_")])
# problem with double underscores or leading underscores
is_identifier("_hello") # False
is_identifier("hell__o") # False
Activity
smarie commentedon Feb 23, 2023
The problem is that the
is_identifierfunction proposed is too restrictive:Fixed `ValueError: Invalid co_name` happening on python 2 when the na…