Skip to content

enumerate builtin: start parameter can only be passed as positional argument, not keyword argument #394

Description

@severinh

Minimal reproducible example:

from pydantic_monty import Monty

print(Monty("enumerate(['a', 'b', 'c'], 1)").run())
# Works.
# Output: [(1, 'a'), (2, 'b'), (3, 'c')]

print(Monty("enumerate(['a', 'b', 'c'], start=1)").run())
# Does not work.
# Output: pydantic_monty.MontyRuntimeError: TypeError: enumerate expected at most 2 arguments, got 1
# Expected output (CPython): [(1, 'a'), (2, 'b'), (3, 'c')]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions