Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python methods hint is gone after not completed pyannotate

$
0
0

I develop the python module. I store it in "site-packages" folder.Recently I turned on "strict" Pylance type checking and saw the error "Stub file not found" I tried to get rid of it using pyannotate.
Since my tests does not cover all the methods of this module, annotation is not completed. I see that the error is not gone completely.

But after that I faced with the strange issue. I try to call a module's method out of the external .py file (out of VSCode), so i write smth like

import MyModuleMyModule.

After typing '.', I expect that the hint appearing with all the methods of the module. But I don't see my methods. I only see some dunder methods like __dict____doc____file__ etc.

I used the following annotation procedure:

  1. Install pyannotate: pip install pyannotate
  2. Execute the code:
    from pyannotate_runtime import collect_types    collect_types.init_types_collection()    # collect_types.start()    with collect_types.collect():        __main__()    # collect_types.stop()    collect_types.dump_stats("type_info.json")
  1. Run command shell and type pyannotate type_info.json

So, is it possible to revert somehow my annotation, if it is not completed?

I tried to remove the file type_info.json, which i generated, but with no success.
I also tried to remove the folder __pycache__


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>