Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

problem with super() call

オープン
#818 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript, python
領域
compilers

調査の方向性

Start with the test_super.py reproduction and run transcrypt -n test_super.py to inspect the generated JavaScript and the __super__ path in __target__/org.transcrypt.__runtime__.js. Trace why super().update() does not resolve the aliased update method, then verify that both super().update_count() and super().update() complete without the superclass-method error.

索引モデルが issue の本文から書いたものです。

説明

IS: bug

Discovered an issue with super() call when the method is an alias identifier such as update. If a subclass method calls super().update() it is translated to __super__ (SubCls, 'update') (self) rather than using the alias py_update and results in Superclass method not found error. There is no issue with Cls.update(self) call.

test_super.py:

class Cls:
    def __init__(self):
        self.count = 0
    def update_count(self):
        self.count += 1
    def update(self):
        self.count += 1

class SubCls(Cls):
    def update_count(self):
        super().update_count()
    def update(self):
        super().update()

cls = SubCls()

print('super().update_count call')
cls.update_count()
print('count:', cls.count)

print('super().update call')
cls.update()
print('count:', cls.count)

transcrypt -n test_super.py
console:
call: super().update_count
count: 1
call: super().update

Error 'Superclass method not found'
stack:
  at __target__/org.transcrypt.__runtime__.js:1840:17
  at Function.__new__ (__target__/org.transcrypt.__runtime__.js:152:23)
  at new cls (__target__/org.transcrypt.__runtime__.js:91:24)
  at __super__ (__target__/org.transcrypt.__runtime__.js:186:11)
  at __target__/test_super.js:22:3
  at Function.<anonymous> (__target__/org.transcrypt.__runtime__.js:57:29)
  at __target__/test_super.js:30:5

Environment:
Linux
Python 3.9.6
Transcrypt 3.9.0
Chrome/Firefox

主要言語
Python
スター
2.9k
フォーク
218
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TranscryptOrg/Transcrypt のほかの issue

TranscryptOrg/Transcrypt の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。