arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.64k stars 667 forks source link

Be consistent with the pluralisation of units #1115

Closed Kaju-Bubanja closed 2 years ago

Kaju-Bubanja commented 2 years ago

Feature Request

In version 1.2.2 the function replace takes the units without the ending s and the shift function takes it with the s.

# exception
arrow.now().shift(second=3)
# works
arrow.now().shift(seconds=3)
# works
arrow.now().replace(second=3)
# exception
arrow.now().replace(seconds=3)
systemcatch commented 2 years ago

Hi @Kaju-Bubanja this is partly due to the old versions of arrow combining replace and shift. At this point I don't think this is worth altering.

Kaju-Bubanja commented 2 years ago

So is the idea to completely replace one of the functions?

systemcatch commented 2 years ago

replace and shift used to be one function which had different actions based on use of plurals. This made errors based on input very likely, so the function was split into replace and shift.

We are not planning to make any changes to these.