arrow
arrow copied to clipboard
Fix type signature of Arrow.__getattr__
Pull Request Checklist
- [ ] 🧪 Added tests for changed code.
- [x] 🛠️ All tests pass when run locally (run
tox
ormake test
to find out!). - [x] 🧹 All linting checks pass when run locally (run
tox -e lint
ormake lint
to find out!). - [ ] 📚 Updated documentation for changed code.
- [x] ⏩ Code is up-to-date with the
master
branch.
Description of Changes
Arrow's __getattr__
provides access to datetime
attributes that aren't handled by Arrow.
It has this signature:
def __getattr__(self, name: str) -> int
It should return Any
, as not all attributes from datetime
are int
s.
For example, in arrow.now().tzname()
, tzname
is a function.
I noticed that __getattr__
implements two undocumented attributes: week
and quarter
. The should be split into their own methods, with a docstring.