Fine grained mode should respect __getattr__

Đang mở
#4,936 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
compilers

Hướng nghiên cứu

Start with the fine-grained test case testGetAttrFine and its a.py and a.py.2 variants, then trace how getattr dependencies are recorded for classes, modules, and subclasses. Done means the shown test reports the incompatible str-to-int assignment and wildcard and normal dependencies chain correctly.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug priority-1-normal topic-fine-grained-incremental

Currently this fine grained test fails:

[case testGetAttrFine]
from a import A
x: A
y: int = x.x
[file a.py]
class A:
    def __getattr__(self, attr: str) -> int:
        pass
[file a.py.2]
class A:
    def __getattr__(self, attr: str) -> str:
        pass
[out]
==
main:3: error: Incompatible types in assignment (expression has type "str", variable has type "int")

We need to trigger wildcard trigger on class or module if its __getattr__ is triggered. Also we need to be sure that this (chaining wildcard and normal deps <Base.__getattr__> -> <Base[wildcard]> and <Base.x> -> <Sub.x> etc.) works correctly on subclasses.

Ngôn ngữ chính
Python
Star
20.6k
Fork
3.3k
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
54

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python/mypy

Tất cả issue của python/mypy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.