-
Notifications
You must be signed in to change notification settings - Fork 36
Description
I was just starting to look into Felippe's pull requests (noticing that there are still a number open), and when following the GIthub interface to look into merge conflicts I stumbled over the following:
In (for example) musicxml.lymus2musxml.ParseSource.Command()
supported commands are checked in a long if ... elif ...
conditional. And any new supported command will have to add one elif
level to that list, which seems somewhat inefficient to me.
Wouldn't it be better and more Pythonic to maintain the supported commands in a dictionary with functions as their values? So handling a command would use something like supported_commands.get(input, fallback_function)
?
There are a number of such methods, and it seems useful to me to generalize this a bit. I would volunteer to do that (also as a means of finally getting my feet wet with python-ly) but I'd like to have some feedback first.