Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Conversation

densmirn
Copy link
Contributor

@densmirn densmirn commented Dec 8, 2019

No description provided.

if not isinstance(sub, (StringLiteral, UnicodeType)):
ty_checker.raise_exc(sub, 'str', 'sub')

accepted_types = (Integer, IntegerLiteral, NoneType, Omitted)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm not mistaken IntegerLiteral is inherited from Integer, so just (Integer, NoneType, Omitted) would be enough. But it is better to check

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also I'm not sure if it is better to explicitly add IntegerLiteral as supported type or not. On one hand it makes the code more clear, on another, it is confusing that in some places it is specified and in another is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. IntegerLiteral is inherited of Integer.

ty_checker.raise_exc(end, 'None, int', 'end')

def hpat_pandas_stringmethods_find_impl(self, sub, start=0, end=None):
if start != 0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why we are not supporting start and end? UnicodeString doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Numba 0.46 doesn't support str.find with extra parameters.

IntegerLiteral is inherited of Integer
Copy link
Collaborator

@AlexanderKalistratov AlexanderKalistratov left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexanderKalistratov AlexanderKalistratov merged commit dedb0a9 into IntelPython:master Dec 8, 2019
@AlexanderKalistratov AlexanderKalistratov added FullyApproved Mark PR if all required approval exists and removed Waiting on CI labels Dec 8, 2019
@densmirn densmirn deleted the feature/str_find branch June 9, 2020 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

FullyApproved Mark PR if all required approval exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants