Skip to content

Conversation

terencehonles
Copy link

  • Tests added: Please use assert_type() to assert the type of any return value

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

Hi @terencehonles , thank you for the proposal. Having checked the Pandas documentation, and it seems that data can indeed be an Iterator.

Comment on lines +159 to +163
check(
assert_type(pd.Series(iter([1.0])), "pd.Series[float]"),
pd.Series,
float,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Several __new__'s have been retyped, but only one test has been added. Please complete the new tests. Alternatively, you can split the old test function into two.

def __new__(
cls,
data: Sequence[_str],
data: Iterator[_str],
Copy link
Contributor

Choose a reason for hiding this comment

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

Iterator[_str] can be ambiguous, because _str is an Iterable in its own right. However, I don't have more insights how to improve this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use Iterator[SequenceNotStr[_str]]

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.

3 participants