Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    You hope there are no other libraries
    called mail in your import path.
Let's take Python for example. With Python, I am in control of the import path.

I can put those two mail modules in:

    stuff/mail
    tools/mail
And then use them like this:

    from stuff import mail as mail1
    from tools import mail as mail2
I don't have to hope for anything.



Isn’t this same thing? Your dir in python structure is dictating the namespace isn’t it?


The dir structure is defined by me.

Namespaces are defined by the 3rd party developer.


That is not exactly true, you can tweak composer to put dependencies anywhere you want them. What I feel is that there is a minor inconvenience, as many other languages have, and you try to build a case to bring down a whole ecosystem.


That example would become `use Stuff\Mail as Mail1` and `use Tools\Mail as Mail2` in PHP. What's the difference?


The difference is that in PHP, the developers of "Stuff\Mail" and "Tools\Mail" would have to define "Stuff" and "Tools" as the namespace for their code.

In Python, they don't have to do anything. The project that uses the code decides.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: