Python3 - How do I import a class from another file

Python python at python.invalid
Wed Dec 11 20:17:17 EST 2019


Greg Ewing wrote:
...
> You deal with it by not relying on __del__ for anything
> that needs to be done promptly. There are always alternatives:
> e.g. file objects have a close() method, and the "with"
> statement was invented to make it easy to do these kinds
> of things properly.

By the way, I was very impressed back in the day when the
with statement and context manager protocol appeared in
Python. I've always wondered from what language(s) it was
borrowed from (as most of good ideas in Python have been
borrowed, like comprehension from Haskell, and so on, which
is good).





More information about the Python-list mailing list