I'm seeing an issue while running the Django test suite that I can't 
explain.

If you add print(functions) before
from django.db.models.manager import Manager
in 
https://github.com/django/django/blob/master/django/db/models/__init__.py#L15, 
it gives name 'functions' is not defined  as I would expect.

However, if you add the same print on the line after, it gives <module 
'django.db.models.functions' from 
'/home/tim/code/django/django/db/models/functions/__init__.py'>. A 
"functions" variable is magically defined!

Why does importing django.db.models.manager have this side effect? 
manager.py imports django.db.models.query which imports 
django.db.models.functions. If I move the functions import to an inner 
import in query.py as done in https://github.com/django/django/pull/7348, 
there's no more magic "functions" variable available in 
db/models/__init__.py.

Can you explain this? I checked all the "from *" imports in 
models/__init__.py to rule that out.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d8247cc5-e9e8-4725-9714-8a30b0ebc60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to