I have two classes in two different modules:
animal.py:
import json class Animal(object): pass
a monkey:
import animal class Monkey(animal.Animal): def __init__(self): super(Monkey, self).__init__()
When I try to instantiate a Monkey
, I get
NameError: global name 'json' is not defined
But I import json
into the superclass definition module, so why not load it?
Yarin source share