Rename Field allows the use of the object datamodels names.

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

Maintainer thường phản hồi trong vòng 7 ngày

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

Đánh giá

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

Hướng nghiên cứu

Start with the Rename Field refactoring, the operation applied to Exemplo.texto in the issue. Reproduce it with the two snippets in the body and confirm the rename turns a class attribute into __new__. The fix should make the rename refuse or skip Python data-model names such as __new__, so the refactored class keeps its original behavior. Done when the reproduction no longer changes the name to a dunder and the type(obj) output stays the same.

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

Mô tả

bug

Rename Field allows the use of the object datamodels names.

Steps to reproduce the behavior:

  1. Code before refactoring:
class Exemplo:
    texto = str

    def __init__(self):
        print("__init__ rodou")

obj = Exemplo()
print(type(obj))
  1. Apply the rename field to Exemplo.texto

  2. Code after refactoring:

class Exemplo:
    __new__ = str

    def __init__(self):
        print("__init__ rodou")

obj = Exemplo()
print(type(obj))
Ngôn ngữ chính
Python
Star
2.2k
Fork
197
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

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-rope/rope

Tất cả issue của python-rope/rope

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.