Skip to content

Enhancement to read XML doc strings from .NET libraries instead of just signature. #374

@lcorrigan

Description

@lcorrigan

Environment

  • Pythonnet version: 2.2.2
  • Python version: 2.7.13 x86
  • Operating System: Win10x64

Details

Various IDE's and Consoles (VS2015 with PTVS, Jupyter Notebook, ipython console etc) will show the function signature or class description within a .NET assembly for Intellisense/Autocompletion etc, but only the types are retrieved. I believe pythonnet pulls this info from the [class | function].doc field, as this is what shows up in the console/IDE for autocompletion.
Ex:

import clr
clr.AddReference("System")
import System
import System.Text
print System.Text.StringBuilder.__doc__
Void .ctor()
Void .ctor(Int32)
Void .ctor(Int32, Int32)
Void .ctor(System.String)
Void .ctor(System.String, Int32)
Void .ctor(System.String, Int32, Int32, Int32)

It would be useful to be able to get more of what IronPython does, where it pulls the documentation for .NET libraries from the XML header (instead of the python docstring), which has much more detail on the parameters and saves you from looking up every class or function to get these details.

Ex:

import clr
clr.AddReference("System")
import System
import System.Text
print System.Text.StringBuilder.__doc__
Represents a mutable string of characters. This class cannot be inherited.

StringBuilder()
StringBuilder(capacity: int)
StringBuilder(value: str)
StringBuilder(value: str, capacity: int)
StringBuilder(value: str, startIndex: int, length: int, capacity: int)
StringBuilder(capacity: int, maxCapacity: int)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions