Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor function parameters #61

Open
jxu opened this issue Oct 19, 2019 · 3 comments
Open

Refactor function parameters #61

jxu opened this issue Oct 19, 2019 · 3 comments

Comments

@jxu
Copy link
Contributor

jxu commented Oct 19, 2019

At some point when we have an excessive number of parameters to functions I think it should be refactored, in particular mods (see bitwise enum https://github.com/ppy/osu-api/wiki)

https://github.com/llllllllll/slider/blob/master/slider/replay.py#L189-L392

@llllllllll
Copy link
Owner

What is the proposed alternative for this? Realistically, a Replay should be constructed from one of the smart constructors like from_path, which reads in a replay from a replay file on disk.

@jxu
Copy link
Contributor Author

jxu commented Oct 19, 2019

Using an enum that stores all the mods together

@tybug
Copy link
Collaborator

tybug commented Oct 30, 2019

Circleguard has an implementation of this at https://github.com/circleguard/circlecore/blob/57465bb7d16cce9846de06fcb248a718b3bff7c4/circleguard/enums.py#L17-L251 (circleguard/circlecore#99), which seems a lot cleaner than passing every single mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants