-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Using flake8 with multiple dispatch #17795
Comments
Maybe this would help, once we're able to use type annotations? |
Is it possible to use different function names with multiple dispatch? IMO a cleaner API would be to name each function like |
There is a pattern that flake8 understands which is often used for single dispatch: from sympy.multipledispatch import Dispatcher
do_stuff = Dispatcher('do_stuff')
@do_stuff.register(int)
def _(arg):
return -arg
@do_stuff.register(float)
def _(arg):
return 2*arg
print(do_stuff(2))
print(do_stuff(2.0)) Here |
There are many flake8 errors in sets like:
These are because the same function name is used repeatedly in multiple dispatch:
sympy/sympy/sets/handlers/intersection.py
Lines 10 to 20 in be9bba3
Is there a good way to tell flake8 that these are fine?
The text was updated successfully, but these errors were encountered: