lpython icon indicating copy to clipboard operation
lpython copied to clipboard

use istitle , isalpha on string literal

Open Agent-Hellboy opened this issue 2 years ago • 5 comments

fixes #2376

Agent-Hellboy avatar Oct 14 '23 11:10 Agent-Hellboy

This looks good to me @Agent-Hellboy! Thank you so much for the contributions! Can you add some tests for the istitile() and isalpha() on compile time strings? (I think the tests refactored in this PR are for runtime strings.)

ubaidsk avatar Oct 14 '23 16:10 ubaidsk

Can you add some tests for the istitile() and isalpha() on compile time strings? (I think the tests refactored in this PR are for runtime strings.)

Hi @Shaikh-Ubaid, I didn't understand much, so the test added in test_str_attribute is for execution happening at asr, I guess that's compile time, for runtime where do I need to add those tests?

Agent-Hellboy avatar Oct 15 '23 03:10 Agent-Hellboy

@Agent-Hellboy What is the status of this PR? Resolve the conflicts and reviews. After that mark it as Ready for review.

We can add both compile time and run time in the same test. Example:

"abc".istitle() # compile time
s: str = "abc"
s.istitle() # runtime

I think @Shaikh-Ubaid suggested to keep the test removed from test_str_01.py

Thirumalai-Shaktivel avatar Mar 05 '24 12:03 Thirumalai-Shaktivel

@Agent-Hellboy What is the status of this PR? Resolve the conflicts and reviews. After that mark it as Ready for review.

We can add both compile time and run time in the same test. Example:

"abc".istitle() # compile time
s: str = "abc"
s.istitle() # runtime

I think @Shaikh-Ubaid suggested to keep the test removed from test_str_01.py

sure, let me do it.

Agent-Hellboy avatar Mar 05 '24 15:03 Agent-Hellboy

Hi @Thirumalai-Shaktivel Actually I made a fresh clone and fetched the PR and have made some changes, now I am stuck in a git issue.

git pull myclone main
From https://github.com/Agent-Hellboy/lpython
 * branch                main       -> FETCH_HEAD
 * [new branch]          main       -> myclone/main
Current branch redo_ismethods is up to date.

as you can see redo_ismethods is in sync still i am getting the below error

git push myclone redo_ismethods
Username for 'https://github.com': Agent-Hellboy
Password for 'https://[email protected]':
To https://github.com/Agent-Hellboy/lpython.git
 ! [rejected]            redo_ismethods -> redo_ismethods (non-fast-forward)
error: failed to push some refs to 'https://github.com/Agent-Hellboy/lpython.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Agent-Hellboy avatar Mar 05 '24 16:03 Agent-Hellboy