Skip to content

Make get_nested_resource_ptr support a nested sequence of bytes #1354

@leofang

Description

@leofang

Copilot picked up one thing that is interesting.

if ResT is char:
obj_i_bytes = (<str?>(obj_i)).encode()

Here, this block handles a nested sequence and the expectation is that the inner objects obj_i are strings. But, in such cases it makes sense to also accept bytes, something like

obj_i_type = type(obj_i)
if obj_i_type is str:
    obj_i_bytes = obj_i.encode()
else:
    assert obj_i_type is bytes
    obj_i_bytes = obj_i

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priority - Should docuda.bindingsEverything related to the cuda.bindings moduleenhancementAny code-related improvements

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions