Skip to content

[Python] What is the purpose of having @odp.base_constructor if it's being assigned to subclass constructors as well? #168

Answered by olimorris
anthony-S93 asked this question in Q&A
Discussion options

You must be logged in to vote

Referencing the after/queries/python/highlights.scm file:

((function_definition name: (identifier) @odp.base_constructor)
(#any-of? @odp.base_constructor "__new__" "__init__"))

It allows the scheme to reference __new__ and __init__ directly. Perhaps it should have been called odp.initializer?

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@anthony-S93
Comment options

@olimorris
Comment options

@anthony-S93
Comment options

@olimorris
Comment options

@anthony-S93
Comment options

Answer selected by olimorris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants