Skip to content

Implementation of __init_subclass__ - #2017

Merged
coolreader18 merged 7 commits into
RustPython:masterfrom
BolunThompson:init_subclass
Jul 21, 2020
Merged

coolreader18 merged 7 commits into
RustPython:masterfrom
BolunThompson:init_subclass

Conversation

@BolunThompson

@BolunThompson BolunThompson commented Jul 20, 2020 •

Copy link
Copy Markdown
Contributor

This implements __init_subclass__ from PEP 487.

Closes #1346. Partially fixes issue #356.

This doesn't support passing kwargs to __init_subclass__.
@BolunThompson BolunThompson changed the title Partial implementation of __init_subclass__ Implementation of __init_subclass__ Jul 20, 2020

@coolreader18 coolreader18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Comment thread vm/src/obj/objtype.rs Resolved
Comment thread vm/src/obj/objtype.rs Resolved
Comment thread vm/src/obj/objtype.rs Resolved

@coolreader18 coolreader18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, are you done with this or still working on it?

@coolreader18

coolreader18 commented Jul 21, 2020 •

Copy link
Copy Markdown
Member

Oh, actually, would you be able to put the copied CPython test file in a separate commit? Something like

  • Add test_subclassinit.py from CPython 3.x.x
    • Same exact file as in CPython
  • Mark expected failures
    • edit the test file to put expectedFailure et al

@BolunThompson

BolunThompson commented Jul 21, 2020 •

Copy link
Copy Markdown
Contributor Author

I'm done with this. I'll make that change now.

@coolreader18

Copy link
Copy Markdown
Member

Thank you for contributing!

@coolreader18
coolreader18 merged commit a742ba0 into RustPython:master Jul 21, 2020
@BolunThompson
BolunThompson deleted the init_subclass branch July 21, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PEP 487 (__init_subclass__, __set_name__)

2 participants