Chris Angelico <ros...@gmail.com> writes: > When you import something, all you're doing is getting a local > reference to it; "from foo import make_adder" is basically like saying > "import foo; make_adder = foo.make_adder". The function itself is > still the same, and it still remembers its original context.
Thanks, this clears it up. The pattern matching examples that I was looking at when I got confused are at https://mathspp.com/blog/pydonts/pattern-matching-tutorial-for-pythonic-code in case anyone is interested. Fairly neat stuff in my opinion. -- https://mail.python.org/mailman/listinfo/python-list