Compilation error after applying the Inline method refactoring

Đang mở
#745 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
1-2 ngày
Mức phù hợp với người mới
35/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
tooling

Hướng nghiên cứu

Reproduce the report with the two-class MyTokenizer snippet from the issue: apply Inline Method to MyTokenizer.tokenize() and inspect the resulting itokenize body. The payload names no source files, so locate the inline-method refactoring in the rope package first. Done means the inlined output no longer breaks compilation for an empty-body method, or Rope warns the user about the empty body. The issue does not choose between those two outcomes, so confirm the direction with maintainers before starting.

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

Mô tả

bug inline-refactor

Rope causes a compilation error after modifying the loop inside the return using the inlined method.
It would be nice if Rope sent a warning to the user that the method has an empty body.

Steps to reproduce the behavior:

  1. Code before refactoring:
class MyTokenizer:

    def tokenize(self, text):
        return

    def itokenize(self, text):
        return (t for t in self.tokenize(text))
  1. Apply the Inline Method to MyTokenizer.tokenize();
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.