Giter VIP home page Giter VIP logo

Comments (5)

kdheepak avatar kdheepak commented on July 3, 2024 1

I'm wondering why type annotations are included in positional arguments but not keyword arguments?

I have to double check if this is the case but I think keyword argument types were not part of the Julia docstrings typesig. I have some thoughts about how to do this better, so I'll look into it for the next PR related to $TYPEDSIGNATURES.

it might also make sense to not show type annotations for arguments whose type is Any.

I think this makes sense.

from docstringextensions.jl.

bzinberg avatar bzinberg commented on July 3, 2024 1

It looks like the docs question might be partly (but not completely, I think) coupled with decisions about how Julia dispatches on keyword arguments, as in e.g. JuliaLang/julia#34514 (comment). Thanks @kdheepak for looking into it.

from docstringextensions.jl.

bzinberg avatar bzinberg commented on July 3, 2024

have type annotations appear in the docstring everywhere that they appear in the actual function signature

Along those lines, it might also make sense to not show type annotations for arguments whose type is Any.

from docstringextensions.jl.

bzinberg avatar bzinberg commented on July 3, 2024

I have to double check if this is the case but I think keyword argument types were not part of the Julia docstrings

Yeah, looks like the current docs code omits the types of keyword arguments, and (incorrectly, AFAICS) refers to them as "optional" arguments.

from docstringextensions.jl.

MichaelHatherly avatar MichaelHatherly commented on July 3, 2024

coupled with decisions about how Julia dispatches on keyword arguments

Yes, correct. We never bothered storing anything related to keywords since they don't really play a part in dispatch in the usual way. Extracting the keyword arg types from the method objects should be possible, though I've not looked into that in a while.

it might also make sense to not show type annotations for arguments whose type is Any.

Seems reasonable to me.

from docstringextensions.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.