Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Element to the type of delimiter #23

Merged
merged 2 commits into from
Mar 16, 2023
Merged

Add Element to the type of delimiter #23

merged 2 commits into from
Mar 16, 2023

Conversation

dk949
Copy link
Contributor

@dk949 dk949 commented Mar 16, 2023

The main point of the PR is to allow delimiter argument of List to be an Element. At present, if the user wants to use an element as a delimiter, the have to use typing.cast (or # type: ignore) to avoid a type error.

The PR also adds str as a possible type of the argument to _validate_element.

Neither of these should cause any change to the runtime behaviour of the library.

`_validate_element` will convert a sting passed to it to a `Token`, so
`str` should also be a valid type of the parameter.
The `delimiter` argument of `List` can be either a string or an
`Element`, but the type only specifies `str`.
Copy link
Member

@joente joente left a comment

Choose a reason for hiding this comment

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

This is correct, thanks for the pr 👍

@joente joente merged commit 1bd9bae into cesbit:master Mar 16, 2023
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