0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Visual Studio CodeのPylanceが少しおかしくなった件

0
Last updated at Posted at 2026-04-07
hello.py
print("hello")

このブログは同じ問題が発生した方向けの応急処置を書いたつもりなので、かなり内容・編集が雑です。
お久しぶりです。
最近大きなプログラムを書いておりまして、投稿にかなり時間が空いてしまいました、すいません。
さて、その大きなソースコードで、プログラムを書いていたら、いきなりVisual Studio Codeがおかしくなりまして、何かというと、

import pygame
pygame.init()

という例のうち、init()の型が
(かざすと見えるやつです)

(function) init: Any

となって、いました。
ちなみに通常時は

(function) def init() -> Tuple[int, int]

です。何がだめなのかというと、この状態だとVisual Studio Codeの編集候補が出てこなくなるんです。
Screenshot From 2026-04-07 13-39-53.png 編集候補
無視しても良いのですが、長いプログラムを書いていると結構重宝する機能だと思うので、直そうとしましたが、もちろん中途半端な知識で解決するわけもなく、。

ChatGptを頼った まあ、そうなる。

しかし。使える回答が返ってこなかった。
そこで、プログラムのTry:文一式を消してみました。
治った??
ますます不可解になってしまいました。(著者の思考力の限界)

どなたか詳しい方がいらっしゃいましたら、コメントにて教えていただきたいです。
最後まで読んでくださり、ありがとうございました!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?