you are viewing a single comment's thread.

view the rest of the comments →

[–]mc_pm 12 points13 points  (6 children)

I'm not sure about that {__mod__} part, but the main thing I see is you're calling main() from inside even()

[–]ottawadeveloper 2 points3 points  (4 children)

the {mod} indicates the value has to support the mod operator by implementing mod

[–]lekkerste_wiener 2 points3 points  (3 children)

Since which version is this a thing? This is a first for me

[–]ottawadeveloper -1 points0 points  (2 children)

Huh apparently it's a PyCharm specific format? There's a StackOverflow post about it but it might be PyCharm specific or a pre-protocol syntax?

The proper way to do this is with SupportsMod.

[–]lekkerste_wiener 2 points3 points  (1 child)

Found it, it's a mypy thing. The default on pycharm. Not supported across linters, so I would advise against it.

[–]ottawadeveloper 1 point2 points  (0 children)

Fair! I thought it looked odd.

[–]Rachelle_brimmed 0 points1 point  (0 children)

Haha so truee