Hacker News new | past | comments | ask | show | jobs | submit login

"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.




Functions 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.


Sorry, I meant a function that rips a class open, messes with it, and returns a new class!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: