Python3 - How do I import a class from another file

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Dec 12 01:07:14 EST 2019


On 12/12/19 2:17 pm, Python wrote:
> 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

It was partly inspired by the RAII pattern often used
in C++, but as far as I know, all the details are unique
to Python. Some other languages have a "with" statement,
but it does something completely different.

-- 
Greg


More information about the Python-list mailing list