question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No stubs for brython for PyCharm - crucial to make it popular (coding efficiency - heart of Python).

See original GitHub issue

I need autocomplete during coding in PyCharm. Python heart is fast coding so it is crucial.

I can not import really module from browser import document since no such file - PyCharm will allow autocompletion.

I think you can generate *.pyi stubs to allow completion. It can be generated in console. I do not know how to do it but you can.

Without autocompletion coding is very hard for beginners and slow for experts. That is true obstacle to make it popular.

For example I can use brython (it is not productive) but my younger programmers will have very big problems.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Real-Geckocommented, May 9, 2022

I’ve created this module https://github.com/Real-Gecko/brython-stubs as a proof of concept.

https://user-images.githubusercontent.com/2231969/167427814-a6bd7517-4352-48dd-9adc-bba081987d92.mp4

Issues I see with this approach:

  1. Separate repo.
  2. pyi files are not generated from brython but are created manually.
  3. it adds extra package browser to lib which actually contains only stubs but no code, so possible name conflict with another modules. Using name browser-stubs did not work with VSCode imports. Putting stubs to brython folder did not work, import needed to be brython.browser.
1reaction
Real-Geckocommented, May 11, 2022

Ok, I redid the PR and now we have brython-stubs submodule that can be put on PyPi I guess. It installs browser folder which contains .pyi files for Brython browser at least. However they’re incomplete as no JS modules are parsed. Preposition for Typescript remains 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

django-stubs breaks code completion : PY-37744 - YouTrack
I tried several times to make QuerySet generic annotations compatible with both mypy and pycharm, but there's a bunch of errors / broken...
Read more >
beartype - Python Package Health Analysis | Snyk
Beartype is an open-source PEP-compliant constant-time pure-Python runtime type checker emphasizing efficiency, usability, and thrilling puns.
Read more >
Brython – A Python 3 implementation for client-side web ...
I have no numbers, but I suspect that once the initial download is done and cached, Python code should be smaller than JS...
Read more >
Two Key Points of Containerisation You Need to Know by Heart
This article presents the two key points about containerisation you need to know by heart: ... Collection of Library Stubs for Python with...
Read more >
Simple Index - Alibaba Cloud
4logik-python-rest-client ... a-pandas-ex-drop-duplicates-without-pain · a-pandas-ex-dumpsys-to-df ... adafruit-circuitpython-ble-heart-rate
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found