Skip to content

Null type in bevy_reflect #18707

Open
Open
@Person-93

Description

@Person-93

What problem does this solve or what need does it fill?

When using one of the Dynamic* types, it is very difficult to clear a field that's already been set or to explicitly not provide a value.

What solution would you like?

I would like to see a Null type (bikeshed exact name for it later). The FromReflect derive macro should be updated to treat instances of this type as if the field wasn't set.

What alternative(s) have you considered?

I haven't really been able to come up with another way to handle it.

Additional context

I've been playing around with setting up some kind of interop between bevy_reflect and python types using the pyo3 crate and I've been struggling to deal with None values from python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-FeatureA new feature, making something new possibleX-ContentiousThere are nontrivial implications that should be thought through

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions