Skip to content

Conversation

@Mahi
Copy link
Contributor

@Mahi Mahi commented Jun 29, 2016

This allows one to define the menu before its callbacks while keeping the code clean.

Mahi added 2 commits June 29, 2016 08:24
This allows one to define the menu before its callbacks while keeping the code clean.
@Ayuto
Copy link
Member

Ayuto commented Jun 29, 2016

This just moves a single line...

def my_callback(...):
    pass
menu.select_callback = my_callback
menu.register_select_callback
def my_callback(...)
    pass

I would rather update the menus package to support overrideable methods instead of callbacks.

@Mahi
Copy link
Contributor Author

Mahi commented Jun 30, 2016

You're right and it's just a feature suggestion instead of an actual improvement. But I find it much more beautiful and clear than the current version (think of a very long function where menu.select_callback = my_callback will get lost in the clutter quite easily, unless you separate it with an empty line or two). And it comes at the cost of nothing! But you guys decide :)

I would rather update the menus package to support overrideable methods instead of callbacks.

Absolutely. But until someone has enough time and patience to do that...

@Ayuto Ayuto merged commit 56b8876 into Source-Python-Dev-Team:master Jul 1, 2016
@Mahi Mahi deleted the patch-1 branch July 1, 2016 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants