Why are we still discussing this? Hasn’t PEP 582 already been rejected by the steering council member and Python 3.12 release manager Thomas Wouters?
I guess this is too big of a paradigm shift for the current Python 3.x version. It would need Python 4.0 for this to be implemented, if at all. Don’t get me wrong, it’s a great idea, by all means, but all the intricate details haven’t been worked out, so it fell.
I personally don’t see what is so wrong with the current site-packages
to introduce such a (funda)mental change? There was a hint in one of this discussion’s thread expressing __pypackages__ == site-packages
. I think it says it all. It seems to me that apart from renaming site-packages
to __pypackages__
, the latter naming might indicate to a Python developer that __pypackages__
could be redefined in a class (for some strange reason?) as
import pkg_resources
class MyClass:
def __pypackages__(self) -> list[str]:
return [
distribution.project_name for distribution in pkg_resources.working_set
] + ["imposter"]
Was this the intention for the dunder naming to communicate to Python developers that they can manipulate __pypackages__
in a certain way, like in the example above?
The naming is bad, especially if the intention is not for __pypackages__
to be manipulated as in the above example or in a similar fashion. Also, having to type double underscores (front and back, so twice!) is what a lazy Python developer really wants to avoid. Remember when the isinstance()
and issubclass()
built-in functions were introduced? Well, their Pythonic namings would certainly be is_instance()
and is_subclass()
. But to type one underscore, now, that is too much. But here, we wanted to force typing 4 of them!
On a serious note, naming things properly is very important. Naming them consistently is even more important. But I guess in Python, everything goes.
Maybe we should just rename site-packages
to packages
and make it behave as a virtual environment. The word site
, for me personally, is (still) very confusing and unnecessary. Or maybe we should leave the name site-packages
as is, not to break anything, but only make it as a virtual environment.