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

[DRAFT / WIP - DO NOT MERGE] Show filtered builtins documentation #1174

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

microbit-robert
Copy link
Collaborator

@microbit-robert microbit-robert commented Apr 22, 2024

Also allows links to the builtins from autocomplete and signature help where documentation is available.

Using type stubs from microbit-foundation/micropython-microbit-stubs#101

To discuss:

  • Maybe we should filter out API docs for builtin classes where we don't show any methods as they are filtered out as __new__
  • Add some kind of indicator that not all classes, class methods and functions are documented in the builtins section

Notes from Matt:

  • I've exempted __new__ but not convinced about exposing __new__ vs __init__ complexity to our users. But hard to mask it too... for str and list at least they do need to understand it as an object with methods.
  • Very weird to see range() three times because of overloads that exist for invisible type-related reasons. Same applies to constructors.
  • The base class names are likely too scary for our users
  • Lots of useful functions that are worth adding if everyone's happy with the idea (e.g. min, max)

Also allows links to the builtins from autocomplete and signature
help where documentation is available.
Copy link

@microbit-robert
Copy link
Collaborator Author

Unfortunate case where we are filtering out __new__ (with other special methods), but they are the only methods documented in the class:
image

- Examples for str, list
- Don't import "builtins" or fully qualify it
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

Successfully merging this pull request may close these issues.

None yet

2 participants