-
Notifications
You must be signed in to change notification settings - Fork 17
Return inherited type #14
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
Conversation
pinnymz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding/fixing this! One minor comment on the test approach, would be happy to merge if you can resolve that.
test/test_jewish_calendar.py
Outdated
| self.assertEqual(calendar.sof_zman_kiddush_levana_between_moldos().toordinal(), expected_time.toordinal()) | ||
|
|
||
| def test_date_arithmetic_returns_inherited_type(self): | ||
| for instance, type in [(JewishCalendar(5783, 1, 1), JewishCalendar), (JewishDate(5783, 1, 1), JewishDate)]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep other types out of this batch of tests, JewishCalendar alone should suffice here. An alternative approach would be to test the method in TestJewishDate, and create a dummy class to ensure the type isn't being lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duly noted, indeed keeps the code-base clean.
|
Replaced by PR#15 |
Return an instance of the sub-classed
JewishDatetype when applying any of the baseJewishDatemethods (__add__and__sub__).