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')]

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions