Skip to content

New semantic analyzer: plugin generated methods are confused with user defined ones #6954

@ilevkivskyi

Description

@ilevkivskyi

This test case fails with new analyzer (note deferral):

[case testDataclassOrdering]
# flags: --python-version 3.6
from dataclasses import dataclass

defer: Yes

@dataclass(order=True)
class Application:
  name: str
  rating: int

class Yes: ...
[builtins fixtures/list.pyi]

with a bunch of errors

main:7: error: You may not have a custom __lt__ method when order=True
main:7: error: You may not have a custom __gt__ method when order=True
main:7: error: You may not have a custom __le__ method when order=True
main:7: error: You may not have a custom __ge__ method when order=True

Setting priority to high because it is a flaw in basic plugin functionality.

Metadata

Metadata

Assignees

Labels

bugmypy got something wrongpriority-0-highsemantic-analyzerProblems that happen during semantic analysistopic-pluginsThe plugin API and ideas for new plugins

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions