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

operator.itemgetterを使うとエラーになる #62

Open
sei40kr opened this issue Nov 5, 2023 · 0 comments
Open

operator.itemgetterを使うとエラーになる #62

sei40kr opened this issue Nov 5, 2023 · 0 comments

Comments

@sei40kr
Copy link

sei40kr commented Nov 5, 2023

以下のファイルで使おうとするとpanicが発生しました。
https://github.com/sei40kr/yonvim/blob/main/packages/yonvim/plugins/plugins.py

以下NeovimのLSPログです:

[ERROR][2023-11-06 03:11:27] .../vim/lsp/rpc.lua:734	"rpc"	"/etc/profiles/per-user/sei40kr/bin/pylyzer"	"stderr"	"thread 'pylyzer' panicked at 'called `Option::unwrap()` on a `None` value', /build/pylyzer-0.0.49-vendor.tar.gz/erg_compiler/lower.rs:1341:38\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n"
[ERROR][2023-11-06 03:11:27] .../vim/lsp/rpc.lua:734	"rpc"	"/etc/profiles/per-user/sei40kr/bin/pylyzer"	"stderr"	"Thread panicked: Any { .. }\n"

スクリプトを書き換えながらパースに失敗している部分を検証したところ、どうやら operator.itemgetter の部分がパースに失敗しているようです。
https://github.com/sei40kr/yonvim/blob/main/packages/yonvim/plugins/plugins.py#L203

該当箇所2行を削除すると正常に実行できました。
同じエラーを発生される最小コードはこちらになります。

import operator

foo = {
    "a": 1,
    "b": 2,
}

a, b = operator.itemgetter("a", "b")(foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant