Skip to content

[FEATURE] Allow CocoIndex Struct binding to dict in Python #670

@badmonster0

Description

@badmonster0

Currently we allow CocoIndex struct to bind to dataclasses and namedtuples (doc). We want to support binding struct to dict (or dict[str, Any]) too - this is more handy as users don't need to define a type first.

dict cannot be used when a specific type is required, e.g. for return type as custom functions (existing doc).

Users are even allowed to use Any or omit type annotation to bind Struct values when a specific type is not required (e.g. for custom function arguments), just like for basic typed values type annotation is not required for function arguments.


❤️ Contributors, please refer to 📙Contributing Guide.
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like I'm working on it or Can I work on this issue? to avoid duplicating work. Our Discord server is always open and friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    python-sdkCocoIndex Python SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions