Feature: `__` private members/name mangling in classes

Đang mở
#853 1 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, python
Lĩnh vực
compilers

Hướng nghiên cứu

Start by reviewing the linked Python documentation on private variables and name mangling, then inspect how Transcrypt currently handles class members and mixins. No source files, tests, or entry points are named in the issue. Done would require an agreed implementation scope and tests demonstrating the expected mangling behavior in generated JavaScript.

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

Mô tả

IS: enhancement IS: exploratory

Sorry, I would expect that this probably documented but I just cannot find it:

https://docs.python.org/3/tutorial/classes.html?highlight=name%20mangling#private-variables

Short question: Is this supported in some way? Or are there plans to support it?

It seems to be such a core-feature of Python that I kind of feel stupid to ask, I would bet that it was decided to not implement that feature somewhere/somehow, but I cannot find a reference to that decision or if it even was made?

To me this would be a very awesome feature, because it is for me the feature that avoids naming collisions in classes for something like Class-Mixins. I am reviving an old project of mine which consists converting an old piece of Python code to a web-capable implementation, and this would make those conversion efforts a LOT more convenient.

Ngôn ngữ chính
Python
Star
2.9k
Fork
218
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 TranscryptOrg/Transcrypt

Tất cả issue của TranscryptOrg/Transcrypt

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.