Giter VIP home page Giter VIP logo

Comments (2)

ShuhuaGao avatar ShuhuaGao commented on June 24, 2024 1

@MichaelHatherly Noted with thanks. Currently, I am using 1.5, but will switch to 1.6 once it is released.

from docstringextensions.jl.

MichaelHatherly avatar MichaelHatherly commented on June 24, 2024

Agreed, definitely a nice to have feature. If you're on Julia 1.6 or above this should just work out the box since TYPEDSIGNATURES hooks into the base display system for printing types, and printing of the type alias was added for 1.6:

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.0-beta1.91 (2021-02-02)
 _/ |\__'_|_|_|\__'_|  |  release-1.6/e02764ca43* (fork: 198 commits, 57 days)
|__/                   |

(@v1.6) pkg> add DocStringExtensions
    Updating registry at `~/.julia/registries/General`
    Updating registry at `~/.julia/registries/PumasRegistry`
   Resolving package versions...
    Updating `~/.julia/environments/v1.6/Project.toml`
  [ffbed154] + DocStringExtensions v0.8.3
  No Changes to `~/.julia/environments/v1.6/Manifest.toml`

julia> using DocStringExtensions

julia> """
       $(TYPEDSIGNATURES)
       """
       function f2(v::Vector{Int}, m::Matrix{Float64})
           return sum(v) + sum(m)
       end
f2

help?> f2
search: Float32 f2 Inf32 ComplexF32

  f2(v::Vector{Int64}, m::Matrix{Float64}) -> Float64

For 1.5 and below there's no general way to do this properly since it requires support in base Julia.

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.