sizmailov / pybind11-stubgen

Generate stubs for python modules
Other
218 stars 44 forks source link

style: 💄 typing improvements #186

Closed ringohoffman closed 7 months ago

ringohoffman commented 7 months ago

I have a draft for #113, and these are some unrelated changes I made in preparation:

  1. CLIArgs argparse.Namespace dataclass for improved type checking in pybind11_stubgen/__init__.py
  2. not necessary to index sys.version_info, and doing so interferes with VS Code's reachability highlighting
  3. custom all_isinstance TypeGuard in pybind11_stubgen/parser/mixins/fix.py to resolve a type error in arguments to FixedSize vs DynamicSize
  4. use Sequence to accept broader types
  5. typo in FixMissingImport.handle_type?
  6. use comprehension instead of map
sizmailov commented 7 months ago

Thanks!