Coder Social home page Coder Social logo

Support PEP 484 type hints about pdoc HOT 9 CLOSED

pdoc3 avatar pdoc3 commented on September 22, 2024 6
Support PEP 484 type hints

from pdoc.

Comments (9)

kernc avatar kernc commented on September 22, 2024

Would you be interested in doing a pull request for that?

You would need to

from pdoc.

nbraud avatar nbraud commented on September 22, 2024

@kernc Sorry, I had entirely missed you replied here. Yes, obviously I'm pretty interested in writing the code for this ^.^

from pdoc.

omtinez avatar omtinez commented on September 22, 2024

@nbraud do you plan on submitting a PR with your commit?

from pdoc.

kernc avatar kernc commented on September 22, 2024

@omtinez PR #7 is in progress. Welcome to continue where it's left off.

from pdoc.

kernc avatar kernc commented on September 22, 2024

This is not done. Text template doesn't look into config.mako nor does it print types by default. I'll see what I can do about that and about hyperlinking documented types in HTML output.

from pdoc.

kernc avatar kernc commented on September 22, 2024

Hyperlinked types testable with:

pdoc --html -c show_type_annotations=True your_module

from pdoc.

DaniGuardiola avatar DaniGuardiola commented on September 22, 2024

Types are not showing up on my project. Fresh pdoc3 install so I assume it is the latest version published, testing it with --http option. Am I missing something? Thanks :)

Edit: didn't read the previous comment. Adding -c show_type_annotations=True worked. I didn't find anything about this option in the documentation though. Also I think the CLI option could be nicer, something like --types / -t.

from pdoc.

DaniGuardiola avatar DaniGuardiola commented on September 22, 2024

After some more testing I've seen it works pretty well, nice!

I have a couple of suggestions:

  • Class / instance property and variable types are not being documented.
  • Standard library types could be linked to the official online documentation, specially the Typings library.

from pdoc.

kernc avatar kernc commented on September 22, 2024

@DaniGuardiola, care to open a new issue for missing variable/property annotations?

from pdoc.

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.