Comments¶
It is suggested that you use the requests module instead of urllib unless you want to have minimal 3rd-party dependencies.
You have to explicit import
urllib.request
in order to use it in Python 3. Please refer to https://bugs.python.org/issue36701 for more discussions. This is how Python 3 intends to work generally speaking. Of course, there are a few exceptions such asos.path
RecurssionError in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
-
Python does not support tail recursion elemination. Large recursion should be implemented as loop instead to avoid RecursionError.
-
pylint encouter RecursionError ...
References
Implementing Equality and Hash Methods in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Elegant ways to support equivalence (“equality”) in Python classes
Copy Object in Python
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
You can use the copy module to copy objects in Python.
Customized coping behavior can be achived by overriding the methods __copy__
(for shallow copy)
and __deepcopy__
(for deep copy).
References …
Return a New Object Or Mutate the Existing Object
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Generally speaking, prefer to return a new object rather than mutating the existing object. This is true in most programming languages besides C who seeks for best peformance.
The pandas package …
Python Local Packages Directory
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
PEP 582 -- Python local packages directory
https://discuss.python.org/t/pep-582-python-local-packages-directory/963
https://github.com/sdispater/poetry/issues/872
https://pypi.org/project/pythonloc/