Skip to content

Conversation

ekorchmar
Copy link

  • ran the tests (pytest)
  • all style issues addressed (flake8)
  • your changes are covered by tests
  • your changes are documented, if needed

In addition, please take care to provide a proper description
on what your change does, fixes or achieves when submitting the
pull request.

Description

Closes issue #795

The method behaves as expected, but documentation was describing the wrong behavior.

Copy link

@Imran-imtiaz48 Imran-imtiaz48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The match function in the given code snippet is designed to check whether a token matches specified criteria, including token type, values, and optional regex-based matching. It first verifies if the token type (ttype) matches, returning False immediately if not. The function allows for a single value or a list of values, treating them case-insensitively if the token type is Keyword. When regex is enabled, the values are compiled into regular expressions, with case insensitivity applied only if the token is a keyword. However, there is a TODO comment indicating that a test for regex matching with is_keyword = False is missing, which suggests an area for improvement in test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants