list.pop() in a list with 'undefined' returned from a function raises IndexError
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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- 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 running the supplied reproducer with Transcrypt 3.9.4 and compare its generated JavaScript behavior with Python's bare return semantics. Check the list.pop() path and the handling of undefined values; done means the example prints the list and removes the first element without raising IndexError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi,
I encountered an error in list.pop() in Transcrypt3.9.4. It had no problem in previous versions. When a list contains an element 'undefined' returned from a function, list.pop() raises IndexError. The return command with no argument returns None in Python. But, 'undefined' is returned in Transcrypt3.9.4.
test code:
sMsg= "list.pop() in a list with 'undefined' returned from a function raises IndexError in Transcrypt3.9.4"
def x():
return # Python returns None, but Transcrypt3.9.4 returns 'undefined'
def main():
print('\n'+sMsg)
l= [x(), x(), x()]
print(l)
print(l.pop(0))
if __name__ == '__main__':
main()
output:
list.pop() in a list with 'undefined' returned from a function raises IndexError in Transcrypt3.9.4
msgWhileLoading.js:64 [None, None, None]
localhost/:1 Uncaught Function {__args__: Array(1), stack: 'Error\n at Array.py_pop (https://localhost:8443/…/compiled.DEBUG/main_frontend.js:6:2', __class__: ƒ}
The exception can be caught by try... except IndexError.
Thanks.
- 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TranscryptOrg/Transcrypt
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TranscryptOrg/Transcrypt#913 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
TranscryptOrg/Transcrypt#911 · 2 bình luận ·
-
IS: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
TranscryptOrg/Transcrypt#908 ·
-
SUB: documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
TranscryptOrg/Transcrypt#656 · 7 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
TranscryptOrg/Transcrypt#914 ·
Tất cả issue của TranscryptOrg/Transcrypt
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
OpenHands/extensions#626 · 1 bình luận ·
-
Change observation tooltip text Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
CSCfi/sd-search-api#39 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
please add to porn list Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
StevenBlack/hosts#3255 ·