Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mkdocstrings use - Allow printing other object than str #7

Closed
hameye opened this issue Aug 4, 2022 · 2 comments
Closed

Mkdocstrings use - Allow printing other object than str #7

hameye opened this issue Aug 4, 2022 · 2 comments
Assignees

Comments

@hameye
Copy link

hameye commented Aug 4, 2022

Hi, first thanks for this package and the mkdocstrings suite in general !

Is your feature request related to a problem? Please describe.
Executing code that is supposed to output numpy array does not work.

Describe the solution you'd like
To be allowed to output other kind of objects than str.

Describe alternatives you've considered
I tried converting objects to str as a workaround, but the rendering is not satisfying enough and writing print(str(obj)) in the python code is a bit misleading for future reader of the documentation

Additional context
Code

import numpy as np

xyz = np.array([
    [0,   0,   2,   5,   0,   1,   2,   0,   4,   3,   1,   2,   4],  # noqa
    [0,   0,   2,   5,   0,   1,   2,   0,   4,   3,   1,   2,   4],  # noqa
    [0,  -2,  -4,   1,  -5,   0,  -3,  -3,  -2,   2,  -3,  -2,   0]   # noqa
])

print(xyz)

Result in documentation :

TypeError: sequence item 0: expected str instance, numpy.ndarray found
@pawamoy
Copy link
Owner

pawamoy commented Aug 17, 2022

Hello, thank you very much for the report! I was able to confirm the bug 🙂

@pawamoy pawamoy self-assigned this Aug 17, 2022
pawamoy added a commit that referenced this issue Aug 28, 2022
@pawamoy
Copy link
Owner

pawamoy commented Aug 28, 2022

Should be fixed in 0.7.1 🙂

@pawamoy pawamoy closed this as completed Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants