Skip to content

TypeError: class must have base classes #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alanjds opened this issue Aug 21, 2018 · 3 comments
Open

TypeError: class must have base classes #51

alanjds opened this issue Aug 21, 2018 · 3 comments
Labels
imported Imported from google/grumpy py3k Related with Python 3 support

Comments

@alanjds
Copy link

alanjds commented Aug 21, 2018

google#341 opened by @m4ns0ur on Jul 1, 2017

any transcompiled simple (empty) python class, raising same error:

TypeError: class must have base classes

to reproduce the issue, create a python file with below code, then transcompile, and run:

class c:
    pass

it is happening because of a sanity check here, anyway it needs more investigation to see why base class is empty there.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by m4ns0ur
Tuesday Jul 04, 2017 at 23:39 GMT


@trotterdylan any comment on this?

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by trotterdylan
Wednesday Jul 05, 2017 at 04:44 GMT


Classes without a list of bases are old style classes, and Grumpy doesn't current support them. I've debated whether to bother supporting old style classes since Python 3 gets rid of them.

Unfortunately there are subtle behavioral differences between new and old style classes so we can't just pretend to support them by replacing the empty list of bases with (object).

For modules that use old style classes, I've just been modifying the code to add the object base class and hoping that they continue to work correctly.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by m4ns0ur
Wednesday Jul 05, 2017 at 07:27 GMT


@trotterdylan thanks! I'll try to do same for the modules.

@alanjds alanjds added the imported Imported from google/grumpy label Aug 21, 2018
@alanjds alanjds added the py3k Related with Python 3 support label Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported Imported from google/grumpy py3k Related with Python 3 support
Projects
None yet
Development

No branches or pull requests

1 participant