3 ms·
python 3 (being not completely compatible) was a great chance to add... namespaces everywhere "Namespaces are one honking great idea -- let's do more of those!
by blibble 4y ago
python 3 (being not completely compatible) was a great chance to add... namespaces everywhere
"Namespaces are one honking great idea -- let's do more of those!" after all
sadly I still have to worry about a system package one day being pulled in instead of my code
(and pypi could do with namespaces too)
one of the few things the Java world got spot on
- int_19h 4y agoA far worse problem that still exists is that your module can get pulled by one of your dependencies (which could include some other part of stdlib!) instead of a system package if there is a name clash. Worse yet, since Python stdlib gets new packages in new versions, valid code written in the past might get a name clash in a new Python version. It's really unfortunate that there's no single top namespace package for the entire Python stdlib, like "std" in C++, Rust, or Zig.
- jamesfinlayson 4y agoYes Java cops a lot of criticism but the packages/module/namespace stuff has never given me any grief.
- wodenokoto 4y ago> Namespaces are one honking great idea -- let's do more of those! How that quote got into zen of Python is a bit of a mystery to me. I have no idea what a namespace is in Python or how to create one. I’ve never come across a guide or pytalk teaching me the benefit of namespaces or why they are a honking great idea.
- benji-york 4y agoNamespaces are pervasive in Python. Virtually everything you deal with is a namespace: package, modules, classes, instances; even functions are namespaces: >>> def func(ns): ... print(ns.stuff) ... >>> func.stuff = 'honking great' >>> func(func) honking great