AIDungeonAPI
AIDungeonAPI copied to clipboard
Some code refactoring
Well, I moved my project to your library(only previously existed functionality, yet): https://github.com/sasha00123/ai-dungeon-bot/commit/246739acb3485630825236ee1ebb093e0333db4d
And, well, it works! I didn't take that long, actually. Thank you for your work.
But there are few little arguable moments in your coding style.
- Async constructors - maybe it's better to make init function outside the constructor? Just kills an autocompletion and gives a bunch of warnings.
- Camel case for variables - eventName, ScenarioIDS - I believe it's better to use event_name, SCENARIO_IDS
- Mutable default values for parameters, it's better to use None. More info here
- Default functions shadowing - type, id. You should consider changing it to something like action_type, adventure_id, etc.
- Some spacing - between function parameters, equality signs, etc.
More info you can find here: https://www.python.org/dev/peps/pep-0008/
In fact, any linter or powerful IDE like PyCharm could help to find and fix such mistakes much quicker.