Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

標準 Python と非互換な書き方をしていたらコンパイルエラーにする #128

Open
2 tasks
kmyk opened this issue Aug 1, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@kmyk
Copy link
Collaborator

kmyk commented Aug 1, 2021

  • lambda 式の中で参照されている変数を書き換えるやつ
  • 関数の引数として受けとったリストを書き換えるやつ

現状だと以下はすべて正しく動かない。そもそもそんな書き方をするのが悪いので、コンパイル時にエラーにしてしまいたい

c = 0
f = lambda x: x + c
c = 1
f(0) # => 1
f = lambda x: x + 1
f = lambda x: f(f(x))
f(0) # => 停止しない
def f(xs):
    xs.append(0)
xs = []
f(xs)
xs # => [0]
@kmyk kmyk added enhancement New feature or request good first issue Good for newcomers and removed good first issue Good for newcomers labels Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant