I have a program that lets the user choose a CSV dialect. I wrote a bit of code to list all registered dialects and display their docstrings, but it shows the docstring for the parent class (Dialect), not the subclass (excel, excel_tab, etc). Here's some code:
>>> from csv import list_dialects, get_dialect
>>> from inspect import getdoc
>>> for name in list_dialects():
... print(name, repr(getdoc(get_dialect(name))))
...
excel 'CSV dialect\n\nThe Dialect type records CSV parsing and generation options.'
excel-tab 'CSV dialect\n\nThe Dialect type records CSV parsing and generation options.'
unix 'CSV dialect\n\nThe Dialect type records CSV parsing and generation options.'
Based on the source code, this is what I was hoping to get:
excel 'Describe the usual properties of Excel-generated CSV files.'
excel-tab 'Describe the usual properties of Excel-generated TAB-delimited files.'
unix 'Describe the usual properties of Unix-generated CSV files.'