Skip to content

Regression : ValueError: Invalid co_name '_results_bag' for created function on python 2  #91

Closed

Activity

  1. smarie commented on Feb 23, 2023

    @smarie
    OwnerAuthor

    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
    
  2. added a commit that references this issue on Feb 23, 2023
    10f9108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions