Re: Exporting some of the `datetime` functions from `django.utils.timezone`

2023-03-21 Thread Bogdan Barna
Agree with Mariusz and Adam. The 2 modules are not the same. At most, we can say `django.utils.timezone` has an unfortunate naming. Just my 2c. On Monday, March 20, 2023 at 5:44:38 PM UTC+2 Adam Johnson wrote: > I agree with Mariusz. Encouraging alternative import paths for standard > library

Re: Exporting some of the `datetime` functions from `django.utils.timezone`

2023-03-20 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I agree with Mariusz. Encouraging alternative import paths for standard library functions can only lead to confusing code. On Mon, Mar 20, 2023 at 11:47 AM Mariusz Felisiak < felisiak.mari...@gmail.com> wrote: > > I find it confusing that we have to import now from django.utils.timezone, > but ti

Re: Exporting some of the `datetime` functions from `django.utils.timezone`

2023-03-20 Thread Mariusz Felisiak
I find it confusing that we have to import now from django.utils.timezone, but timedelta from Python's internal datetime. This btw. is a violation of the Law of Demeter , hence I agree with Suayip's proposal. – Jacob There is a big difference be

Re: Exporting some of the `datetime` functions from `django.utils.timezone`

2023-03-20 Thread Jacob Rief
I find it confusing that we have to import now from django.utils.timezone, but timedelta from Python's internal datetime. This btw. is a violation of the Law of Demeter , hence I agree with Suayip's proposal. – Jacob On Monday, March 20, 2023 at 10

Re: Exporting some of the `datetime` functions from `django.utils.timezone`

2023-03-20 Thread Mariusz Felisiak
Hi, > I would say we should at least consider exporting `timedelta` What do you think? I'm strongly against it. Things should be imported from source modules, not cross-imported from Django modules just because we use them. This is confusing to the users who might have the impression that `dj