Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unifiy datetime import #4577

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

Closed
Bibo-Joshi opened this issue Nov 25, 2024 · 2 comments Β· Fixed by #4605
Closed

Unifiy datetime import #4577

Bibo-Joshi opened this issue Nov 25, 2024 · 2 comments Β· Fixed by #4605
Assignees
Labels
πŸ›  code-quality change type: code-quality
Milestone

Comments

@Bibo-Joshi
Copy link
Member

The imports of the datetime module are all over the place. We currently have at least the following styles in our lib:

  • import datetime
  • import datetime as dtm
  • from datetime import datetime, timedelta

Let's unify that to import datetime as dtm. I prefer this option since

  1. Since there is datetime.datetime, a standalone datetime can be confusing. Using the toplevel module is preferable IMO.
  2. dtm is shorter that datetime, plus it make dtm.datetime unambiguous`
@Bibo-Joshi Bibo-Joshi added the πŸ›  code-quality change type: code-quality label Nov 25, 2024
@Bibo-Joshi Bibo-Joshi added this to the v22.0 milestone Nov 25, 2024
@cuevasrja
Copy link
Contributor

Hi, my class group and I want to work in this Issue.

Group:
@Jeam-zx
@Migueldsc12
@AnyaMarcanito
@henryg311
@cuevasrja

@Bibo-Joshi
Copy link
Member Author

Assigned to you. As noted in the group, please get started with this one. #4580 and #4575 require a bit more understanding of PTBs code base, so I'd like to first see how this one works out :)

@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
πŸ›  code-quality change type: code-quality
Projects
None yet
2 participants