Exactly, python is not a nice language and don't understand the popularity. Kind of like PERL. The code is not maintainable. Thank you @anthonywritescode for your video.
If relative imports is not recommended, could you explain what practise IS recommended? I've been struggling a lot of keeping my code tidy since I can't import things from a parent director. My projects always just ends up being a bunch of files in one directory and maybe having 1 or 2 sub directories with stuff that doesn't need code from any files in the parent directory.
@@anthonywritescode Yep that's what I do but since you mentioned that explicit relative imports were tricky because you can't run them as scripts I thought that we could run absolute import as scripts but in fact you always has to run nested scripts as module with `-m` no matter the way you import packages.
you _can_ with `PYTHONPATH` or editable installs make absolute imports work -- though there are other problems even with that (which I'll probably cover in another video) github.com/asottile/scratch/wiki/PythonPathSadness
it's the first part of object creation -- you rarely need to use it in user code but here's a few examples from my videos: - how namedtuple works: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sfDSQSj-uvQ.html - what is a singleton? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-PBCsN29ZG9A.html