Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added APIs isalnum() and isnumeric() in string object #2582

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

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

Kishan-Ved
Copy link
Contributor

Towards: #2356

APIs added:

  • isalnum()
  • isnumeric()

These have been tested extensively, for both compile time and run time tests.

@@ -366,7 +366,69 @@ def is_space():
s = ""
assert s.isspace() == False

def is_alnum():
Copy link
Collaborator

Choose a reason for hiding this comment

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

For future, I would suggest adding changes in integration tests in a separate commit. That can/would help avoid/resolve conflicts in integration tests. If there are conflicts and you are unable to resolve them, you can simply drop the specific conflicting commit and then rebase without any conflicts. Later manually add changes for the dropped commit.

I am sharing this since you experienced some conflicts in your pervious PR #2572.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll follow this from now on. Thank you.

res6: bool = f.isalnum()
res7: bool = g.isalnum()

assert res == True
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 also print the obtained result values before the assert. That helps in debugging if there is any failure later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll add print statements. Please let me know why a particular CI check fails. It's related to PIP installable packages.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please let me know why a particular CI check fails. It's related to PIP installable packages.

It is probably a fluke.

Copy link
Collaborator

@ubaidsk ubaidsk left a comment

Choose a reason for hiding this comment

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

It looks good to me! Thanks for this! Amazing work @Kishan-Ved!

@ubaidsk ubaidsk enabled auto-merge March 7, 2024 08:52
@Kishan-Ved
Copy link
Contributor Author

It looks good to me! Thanks for this! Amazing work @Kishan-Ved!

Thank you! I'm happy to contribute 😊.

@ubaidsk ubaidsk merged commit 605e1d0 into lcompilers:main Mar 7, 2024
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