Skip to content

Make length keyword-only on the keyword routes (SEP 51 follow-up) #857

Closed as not planned

Description

@jtravs

SEP 51 §5.1 makes length optional and keyword-only on prop_/from_gnlse, prop_/from_capillary and prop_/from_waveguide. The implementation (#851) makes it optional but keeps it positional-or-keyword, a deviation recorded in the SEP's Part II and pending a decision by the maintainer:

  • Cost. About 509 calls in 227 hand-written files pass length positionally, in tests, galleries, guide pages, native/tests, benchmarks and the README. 43 gallery scripts would need regenerating.
  • Slot hazard. With length keyword-only, the next positional parameter takes its slot: betas on the GNLSE routes, gas on the capillary and waveguide routes. from_capillary(r, 0.2, "Ar") would then bind 0.2 to gas instead of failing with Python's own error. To guarantee a failure, those parameters would have to be keyword-only as well.

Options: (a) keyword-only as SEP 51 states, with a codemod and the galleries regenerated; (b) also make betas and gas keyword-only; (c) keep length positional-or-keyword.

Activity

  1. added a commit that references this issue on Nov 16, 2026
  2. jtravs commented on Nov 16, 2026

    @jtravs
    ContributorAuthor

    Settled by the maintainer: length stays positional-or-keyword on the keyword routes. SEP 51 records this as an accepted deviation (Q8), in #851.

  3. added a commit that references this issue on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions