batavia icon indicating copy to clipboard operation
batavia copied to clipboard

Class inheritance errors out

Open swenson opened this issue 9 years ago • 3 comments

When importing the datetime module, which went something like this:

class date:
  ...
class datetime(date):
  ...

the second line errors out with something like date not found.

Attempting to get a small reproducer gives a different error:

class date:
    pass

class d2(date):
    pass

print(d2)

gives the error TypeError: Cannot read property 'prototype' of undefined. Different, but also needs to be addressed.

swenson avatar Sep 12 '16 06:09 swenson

This is partially addressed, in that very simple super() usages were added in https://github.com/pybee/batavia/pull/268

swenson avatar Sep 23 '16 04:09 swenson

Hi @swenson , I would like to give it a try. I am a first time contributor but eager to learn and contribute. How can I help?

son-vyas avatar Aug 12 '18 12:08 son-vyas

@son-vyas This is a fairly deep issue to address, if it hasn't been already. It would probably be best to do something like:

  • Check that the reproducer above still doesn't work.
  • Look at #268
  • Check the current state of how super() works as well as how our type inheritance works
  • Figure out what we're doing differently than CPython
  • Write code to make us do something a little closer to what CPython does. :)

Sorry if that is a bit vague.

swenson avatar Aug 13 '18 15:08 swenson