Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add message raising line
  • Loading branch information
jkchandalia committed Apr 24, 2023
commit 317aca6df772338c2480bb7caaa4d80fa29603de
2 changes: 2 additions & 0 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,8 @@ def visit_decorator(self, dec: Decorator) -> None:
self.fail("Only instance methods can be decorated with @property", dec)
if dec.func.abstract_status == IS_ABSTRACT and dec.func.is_final:
self.fail(f"Method {dec.func.name} is both abstract and final", dec)
if dec.func.is_static and dec.func.is_class:
self.fail(message_registry.CLASS_PATTERN_CLASS_OR_STATIC_METHOD, dec)

def check_decorated_function_is_method(self, decorator: str, context: Context) -> None:
if not self.type or self.is_func_scope():
Expand Down