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 string.py with constants #2746

Merged
merged 1 commit into from
Jul 25, 2024
Merged

add string.py with constants #2746

merged 1 commit into from
Jul 25, 2024

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Jun 23, 2024

These are a few constants copied from cpython Lib/string.py.

@certik
Copy link
Contributor

certik commented Jun 24, 2024

I think this looks great. Let's add some tests to ensure it actually works? You can put them into integration_tests.

@wolfv wolfv changed the title add strings.py with constants add string.py with constants Jun 25, 2024
Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think this is good, thanks!

@certik certik merged commit 0e2a5ba into lcompilers:main Jul 25, 2024
15 checks passed
@wolfv wolfv deleted the strings branch July 25, 2024 13:47
@wolfv wolfv changed the title add string.py with constants add strings.py with constants Jul 25, 2024
@wolfv wolfv changed the title add strings.py with constants add string.py with constants Jul 25, 2024
@@ -0,0 +1,7 @@
from string import ascii_lowercase, ascii_letters

def test_string():
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to call the function below ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ouch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in #2788

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps one can write a custom flake8 plugin using https://pypi.org/project/flake8-plugin-utils/ that checks all functions that are defined, are being called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it has to be custom. You could probably use ruff, too :)

Copy link
Contributor

Choose a reason for hiding this comment

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

LPython itself should give a warning for something like this.

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