Skip to content

[discussion]: Avoiding the use of builtin function names as parameter names? #1595

@joelostblom

Description

@joelostblom

What would you like to discuss?

The metadata schema involves some keys that have the same name as Python builtin functions (e.g. type and format). This means that there is a chance for name collision when we convert these to parameter names for the helper classes. For example, within the class ResourceProperties, we could not use the Python functions type and format since they are shadowed by the parameter names. This also shows up as different syntax highlighting in the docs:

Image

Maybe not a giant problem, but I thought I would document it. We have a similar situation in Altair converting from JSON schema keys to class parameters. There the solution was chosen to suffix names already in use with an underscore to avoid potential collisions (although it's not that pretty either), e.g.: https://github.com/vega/altair/blob/f23c1c8b9bb01d12b972609f7a112ced141c10ab/altair/vegalite/v6/api.py#L2766-L2772

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions