6 ms·
I don't know why didn't PEP 420 make one file at root of the package that describe the structure of all the sub-directories, rather than going the controversial
by CrendKing 2y ago
I don't know why didn't PEP 420 make one file at root of the package that describe the structure of all the sub-directories, rather than going the controversial, lazy route to remove __init__.py. That way you get both the explicitness and avoid the litering of empty marking files.
- ericvsmith 2y agoThis is spelled out in the PEP (I’m the author). There isn’t one “portion” (a term defined in the PEP) to own that file. And it’s also not a requirement that all portions be installed in the same directory. I’m sorry you feel this was lazy, it was a lot of work spanning multiple attempts over multiple years.
- cyanydeez 2y agoJavaScript tooling requires index files for everything, which makes development slow, particularly when you want to iterate fast or create many files with single output. I think it makes sense to make the compiler or script loader to rely on just the file and their contents. Either way you're already defining everything, why create an additional redundant set of definitions.
- nophunphil 2y agoWhat do you mean by index files? It might depend on the bundler, but I haven’t heard of index.js/index.ts files being a hard requirement for a directory to be traversable in most tooling.
- bastawhiz 2y ago> JavaScript tooling requires index files for everything This just isn't true. I've never encountered tooling that forces you to have these by default. If it's enforced, it's rules defined in your project or some unusual tools
- ElectricalUnion 2y ago> JavaScript tooling requires index files for everything You mean barrel files? Those are horrible kludges used by lazy people to pretend they're hiding implementation details, generate arbitrary accidental circular imports, and end up causing absolute hell if you're using any sort of naive transpiling/bundling tooling/plugin/adapter.
- sevensor 2y agoI appreciate your work on pep 420; I’ve benefited from it personally as a Python user. Thank you for a job well done.
- ericvsmith 2y agoThank you for the kind words.
- kevin_thibedeau 2y agoThey aren't necessarily empty.