Python Forum
Why can package names differ from module name?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why can package names differ from module name?
#1
I am new to Python/Django, so maybe I do get something terribly wrong.

I was handed a project without complete requirements.txt and needed to install the modules/packages needed.

It wasn't that hard to find out that 'dal' actually is the package 'django autocomplete light'

Then I was looking for "filters" and found a bunch of modules. But the package name of the module "filters" acutally was "filter"...WTH, why would I choose such a different name?

The real problem was 'menu'. I found a 'menu' package, error was gone and I was happy, everything worked fine. Exported requirements, imported on new machine and it was broken. What happened: I installed "menu" package, "django-simple-menu" later orverwrote the folder. On the new machine, obviously "django-simple-menu" was installed first, wrong "menu" package overwrote it and broke the project.

To me, naming the package and module differently feels like "worst practice" and I am surprised it is even allowed.
Reply


Messages In This Thread
Why can package names differ from module name? - by PlanB - Sep-23-2019, 12:17 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020