python-editor-v3 icon indicating copy to clipboard operation
python-editor-v3 copied to clipboard

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

Open microbit-robert opened this issue 10 months ago • 2 comments

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

Using type stubs from https://github.com/microbit-foundation/micropython-microbit-stubs/pull/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)

microbit-robert avatar Apr 22 '24 14:04 microbit-robert

Preview build will be at https://review-python-editor-v3.microbit.org/builtins-filters/

github-actions[bot] avatar Apr 22 '24 14:04 github-actions[bot]

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

microbit-robert avatar Apr 22 '24 15:04 microbit-robert