擅长:python、mysql、java
<p>此代码是否有帮助:</p>
<pre><code>class Scene(object):
def enter(self):
print 'Scene Object'
class CentralCorridor(Scene):
def enter(self):
print 'CentralCorridor object'
class Map(object):
def __init__(self, start_game):
self.start_game = start_game
if self.start_game == 'central_corridor':
whatever = CentralCorridor().enter()
a_map = Map('central_corridor')
</code></pre>
<p>您不应该使用map,而应该使用map,因为map()是一个内置函数</p>