Add generic method support
cwebber opened this issue · 1 comments
cwebber commented
Instead of using .m.foo() method stuff, it would be better and cleaner probably to support generic methods.
cwebber commented
Instead of attaching methods to objects at all, there would be a toplevel function that you could extend with new type definitions. This works like so:
# toplevel method
dbm_save = GenericMethod("Save object to the DBM")
# definition for the Note type
@extend_generic(dbm_save, Note)
def note_dbm_save(note, db):
bla bla blaa # Note-specific code goes here