← 输入框|github.com|刷新
Skip to content

OO mode: inheritance #61

Open
Open

Description

@darvin

in Object Oriented mode, make several animals.

class animal(object):
     ....

class Turtle(animal)
     ....

there is only two predifined classes. another classes user will define
pictures of animal are shipped with programm and equal class name or class's father name

Activity

  1. darvin commented on Sep 29, 2010

    @darvin
    Author

    after #60

  2. darvin commented on Sep 29, 2010

    @darvin
    Author

    some troubles with it:

    in in-game console:

    Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
    [GCC 4.4.5] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    x=Frog()

    class JumpingFrog(Frog):
    pass

    d = JumpingFrog()
    send()

    in stderr:

    Traceback (most recent call last):
    File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed
    send(obj)
    PicklingError: Can't pickle <class 'JumpingFrog'>: attribute lookup builtin.JumpingFrog failed

    any ideas?

  3. cool-RR commented on Sep 29, 2010

    @cool-RR
    Member

    For some reason JumpingFrog's __module__ is set to __builtin__. It needs to be set to __main__. I tried setting it manually to __main__ and it worked. So investigate why it's being set to __builtin__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions