169 похожих чатов

Anyone using vs code to run Python here? Function argument's features

are not suggesting... Is that normal?

8 ответов

6 просмотров

Sometimes the languageserver needs an restart or one import is broken. Especially the latter happened more often for me.

Human- Автор вопроса
Sebastian
Sometimes the languageserver needs an restart or o...

I restarted the server. Still the same 😢

Human
I restarted the server. Still the same 😢

Its working for me after i fixed the broken imports after installing the missing dependencies or fixed them by hiding them in an try-except

Human- Автор вопроса
Sebastian
Its working for me after i fixed the broken import...

I guess you didn't get my question. def test(a): a. data = [1, 2, 3] test(data) here when I type a. Do the vscode will suggest the functions of a list?

Human
I guess you didn't get my question. def test(a): ...

the test function is missing an annotation for this. Currently it could be an int, a string or a tuple. if you change the signature to def test(a: list): then the language server knows that only lists are accepted and provides the nessesary attributes.

Human- Автор вопроса

No problem.

Sebastian
No problem.

if you want an more specific type i would recommend looking at the typing module (part of the standard lib). It has generic types that can be used to describe an set consisting of floats (Set[float]) or an function argument that itself is an function (Callable).

Похожие вопросы

Обсуждают сегодня

А чем вам питонисты не угодили?😂
.
79
Язык Си можно выучить за день? По книжке ANSI C на 230 страниц
Vincent Vegan
29
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
Dim Dim, [02.07.2024 11:07] DB 0x62 Dim Dim, [02.07.2024 11:07] DB 0x66 Dim Dim, [02.07.2024 11:07] кто пояснит что это?
Dim Dim
14
Ошибка: segmentation fault (core dumped) Код: pastebin.com/BEsNNSSV Сообщение от компилятора: отсутствует ОС: Arch Linux Ядро: x86_64 Linux 6.9.7-arch1-1 Процессор: Intel Cele...
sec
4
Ребят, а за скок можно впарить анон чат с апишкой и веб админкой ?
Eugene Неелов
15
Ещё такой вопрос. Мне необходимо хранить пароль пользователя локально. Для этого планирую использовать ini файл. Это для автозаполнения полей логин и пароль при авторизации. Е...
Евгений
19
Кстати, я тут еще с одной темой столкнулся, вот учу я C++, на таком то ресурсе, а остальные постоянно советуют практиковаться, что то писать, проекты, но как писать если вот т...
aaswq1
7
Коллеги, как получить PId для собственного процесса из под линукса?
Роман Лях (rgreat)
6
@ahndmn @ayaw0_0 здарова, на чем пишете?
Aiwan \ (•◡•) / _bot
7
Карта сайта