Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10937

[PyROOT] Add stubs (*.pyi files) with type hints for ROOT classes

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • High
    • None
    • None
    • PyROOT
    • None
    • -

    Description

      A very useful feature would be adding *.pyi files to the ROOT installation with type hints, which supports for example autocompletion in IDEs.

      An example *.pyi file for the TH1 class would be

      class TH1:
          @overload
          def __init__(self) -> None: ...
          @overload
          def __init__(self, name: str, title: str, nbinsx: int, xlow: float, xup: float) -> None: ...
      

      Here the related PEP 484 describing type hints/annotations: https://www.python.org/dev/peps/pep-0484/

      Attachments

        Issue Links

          Activity

            People

              etejedor Enric Tejedor Saavedra
              swunsch Stefan Wunsch (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: