Skip to content

chore(jalai.py): cleanup the code - #140

Merged
slashmili merged 1 commit into
slashmili:mainfrom
5j9:jalali.py
Aug 2, 2023
Merged

slashmili merged 1 commit into
slashmili:mainfrom
5j9:jalali.py

Conversation

@5j9

@5j9 5j9 commented Apr 6, 2023 •

Copy link
Copy Markdown
Contributor
  • Remove unneeded global statements.
  • Remove unneeded intermediate variable declarations.
  • Do not call int on floor division result. This is not needed in Python 3. Floor division of ints always returns
    an integer in Python 3.
  • Use augmented arithmetic assignments (%=, -=, etc.) when possible.
  • Add a test for conversion on leap gregorian years. I noticed that there are no tests for this particular situation.

* Remove unneeded global statements.
* Remove unneeded intermediate variable declarations.
* Do not call int on floor division result.
  This is not needed in Python 3. Floor division always returns
  an integer in Python 3.
* Use augmented arithmetic assignments (%=, -=, etc.) when possible.
* Add a test for conversion on leap gregorian years.
  I noticed that there are no tests for this particular situation.
@5j9

5j9 commented Apr 6, 2023

Copy link
Copy Markdown
Contributor Author

Some changes are perhaps a little subjective. Feel free to reject if the old code looks more readable to you.

@hramezani hramezani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't check it in detail but in general LGTM 👍

@slashmili

Copy link
Copy Markdown
Owner

Thanks!

@slashmili
slashmili merged commit a347a0a into slashmili:main Aug 2, 2023
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