Skip to content

Add Element to the type of delimiter#23

Merged
joente merged 2 commits intocesbit:masterfrom
dk949:master
Mar 16, 2023
Merged

Add Element to the type of delimiter#23
joente merged 2 commits intocesbit:masterfrom
dk949:master

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.

dk949 added 2 commits March 16, 2023 02:11
`_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