Skip to content

The class-based syntax confuses linters #1

@kkirka

Description

@kkirka

What I need is rust-like enums in python, and your library really suits my needs. However, my linter is pretty much confused by the syntax you propose. I'm not sure whether one can work around this but I really don't want to put "ignore" comments every time I declare or use the ADTs.

The error messages are as follows:

  • "Usually the first parameter of a method is called self" — in a declaration if the alternative has some arguments,
  • "Method must have a first parameter, usually called self" — in a declaration if the alternative does not have any arguments,
  • "Function 'X' does not return anything" — when trying to instantiate an alternative.

I'm using PyCharm 2017.2 Community Edition but I believe other linters don't like the syntax as well.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions