Skip to content
This repository was archived by the owner on Oct 3, 2022. It is now read-only.
This repository was archived by the owner on Oct 3, 2022. It is now read-only.

Magic name callbacks -> decorators #41

Description

@dubslow

In my opinion, magically named callbacks are A Bad Idea™. Instead, it would by more pythonic IMO to use decorators to satisfy a callback, e.g.

def MuhTox(Tox):

    @OnFriendMessage
    def muh_echo(self, friend_num, msg):
        self.send_message(friend_num, msg)

(Python itself does have magic names, but they are all dundered. I still think that in this case, decorators are more pythonic than dundered names anyways.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions