3 ms·
"higher order class" is not a term I've heard before. I'm not sure what that could mean. Decorators are syntactic sugar for higher ordered functions. They fu
by recursive 4y ago
"higher order class" is not a term I've heard before. I'm not sure what that could mean.
Decorators are syntactic sugar for higher ordered functions. They fundamentally have the same capability, just with better ergonomics.
- zdragnar 4y agoFunctions can return new class definitions- the "class" keyword represents an expression, not a statement. As such, you could write a function that takes in as an argument a class, and return a new class definition that extends the argument you provided... Or any number of other dubious practices.
- com2kid 4y agoSorry, I meant a function that rips a class open, messes with it, and returns a new class!