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

Make methods in times available at the top level of human_readable #528

Merged
merged 1 commit into from
Jan 29, 2023

Conversation

kitsuyui
Copy link
Contributor

@kitsuyui kitsuyui commented Jan 29, 2023

This is a fix for #526. This makes methods in times available at the top level of human_readable. Until now, date_time and precise_delta were imported, but the following methods were not available -- contrary to the content of the documentation.

  • time_delta
  • time_of_day
  • timing
  • year
  • day
  • date

This PR makes these methods available at the top level of human_readable. It's just adding them to __all__ in human_readable/__init__.py.

result

>>> import human_readable
>>> human_readable.time_delta
<function time_delta at 0x1007bf420>
>>>

Note

If my PR is not appropriate and you can do it directly, please do so without hesitation.
(Please choose the way that is easier for you)

This is a fix for staticdev#526. This makes methods in times available at the top level of human_readable.
Until now, `date_time` and `precise_delta` were imported, but the following methods were not available -- contrary to the content of the documentation.

- time_delta
- time_of_day
- timing
- year
- day
- date

This PR makes these methods available at the top level of human_readable.
It's just adding them to `__all__` in `human_readable/__init__.py`.

 # result

```python
>>> import human_readable
>>> human_readable.time_delta
<function time_delta at 0x1007bf420>
>>>
```
Copy link
Owner

@staticdev staticdev left a comment

Choose a reason for hiding this comment

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

That is perfect, thanks. Do you mind also adding listing from lists. I noticed it is also missing.

@kitsuyui
Copy link
Contributor Author

@staticdev Thank you for your review!

https://github.com/staticdev/human-readable/pull/528/files#diff-14364be259734ce659f5922beca8a91e5b0118b264540fef8b7310f8ffc6124bR5
https://github.com/staticdev/human-readable/pull/528/files#diff-14364be259734ce659f5922beca8a91e5b0118b264540fef8b7310f8ffc6124bR33

It seems that listing was already included in __all__ from the above 2 places.
It works fine even with the current code. What do you think?

@staticdev
Copy link
Owner

My mistake @kitsuyui. I will approve as soon as the checks pass.

@staticdev staticdev merged commit 21bb55d into staticdev:main Jan 29, 2023
@kitsuyui kitsuyui deleted the add-times-to-init branch January 29, 2023 15:37
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