python / python/cpython

typing.get_type_hints wrong namespace for forward-declaration of inner class

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

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

stdlib topic-typing type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

BPO 37835
Nosy @ilevkivskyi
Files
  • typing_check.py: A simple file to reproduce the error with inner classes.
  • get_type_hints_for_inner_classes.zip
  • metaclass_workaround.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2019-08-13.09:36:43.877>
    labels = ['3.7', 'type-bug', 'library']
    title = 'typing.get_type_hints wrong namespace for forward-declaration of inner class'
    updated_at = <Date 2019-09-09.09:59:14.831>
    user = 'https://bugs.python.org/netbnd'
    

    bugs.python.org fields:

    activity = <Date 2019-09-09.09:59:14.831>
    actor = 'levkivskyi'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2019-08-13.09:36:43.877>
    creator = 'netbnd'
    dependencies = []
    files = ['48539', '48552', '48562']
    hgrepos = []
    issue_num = 37835
    keywords = []
    message_count = 8.0
    messages = ['349535', '349958', '349986', '349988', '350468', '350982', '351282', '351398']
    nosy_count = 2.0
    nosy_names = ['levkivskyi', 'netbnd']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue37835'
    versions = ['Python 3.6', 'Python 3.7']
    

    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.

    Hướng nghiên cứu

    Bắt đầu bằng cách chạy typing_check.py để tái hiện lỗi get_type_hints, sau đó kiểm tra phần triển khai typing liên quan đến việc phân giải các khai báo chuyển tiếp cho các lớp bên trong. Sử dụng get_type_hints_for_inner_classes.zip và metaclass_workaround.py cho các trường hợp bổ sung; issue được hoàn tất khi khai báo chuyển tiếp của lớp bên trong được phân giải trong namespace chính xác.

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

    Đánh giá

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

    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.