Skip to content
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

Some Macros for Subclassing #247

Open
glyh opened this issue Dec 24, 2021 · 2 comments
Open

Some Macros for Subclassing #247

glyh opened this issue Dec 24, 2021 · 2 comments

Comments

@glyh
Copy link

glyh commented Dec 24, 2021

Here's a snippt of the macros on GIST. Ideas are based on #228 .

(I've included some tests at the end)

As we've mentioned, this sugar is useful because many APIs requires user to implement subclasses of abstract classes.

@glyh glyh changed the title Macros for subclassing Some Macros for Subclassing Dec 24, 2021
@glyh
Copy link
Author

glyh commented Dec 24, 2021

Some other examples:

@yglukhov
Copy link
Owner

yglukhov commented Feb 2, 2022

@glyh good job! I would not call it canonical syntax by no means, but it's definitely quite an improvement over my variant :). How about making a separate nimble package (nimpy_inheritance?) and I'll refer it in the README?

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

No branches or pull requests

2 participants