heavenshell / vim-pydocstring

Generate Python docstring to your Python source code.
BSD 3-Clause "New" or "Revised" License
337 stars 53 forks source link

default value as dict create wrong docstring #61

Closed LucaZampieri closed 4 years ago

LucaZampieri commented 4 years ago

If a default parameter is a dict, I get a wrong default docstring.

minimal example:

def get_adjacency(
    facets,                                                                                                                                                                                                        
    points=None,
    max_degree=None,
    dtypes={"ints": np.int64, "floats": np.float32},
):
    """get_adjacency

    :param facets:
    :param points:
    :param max_degree:
    :param dtypes:
    :param "floats":
    :type "floats": np.float32}
    """

where we can see that it has considered "float" as a default parameter and default type

heavenshell commented 4 years ago

Hi, thank you for reporting this.

Yes, I'm very annoying about object literal. I'll look into this, but currently I'm super busy so stay tuned 🙏 btw PRs are very welcome 😉

LucaZampieri commented 4 years ago

haha ok cool!!

Yes I might have a look these night and do a PR then ;) Thanks for the plugin and good luck with your busy schedule! ;)

heavenshell commented 4 years ago

@LucaZampieri

I try to fix this. https://github.com/heavenshell/vim-pydocstring/pull/62 Could you try this branch?

This is very work arounded patch... 🙇 I think default value and typings combination is broken...

LucaZampieri commented 4 years ago

Thanks a lot ,I try it and let you know!

heavenshell commented 4 years ago

Ver2.0.0 was released Complex default keyword's bug was resolved.