cuda-python
cuda-python copied to clipboard
Make `get_nested_resource_ptr` support a nested sequence of bytes
Copilot picked up one thing that is interesting.
https://github.com/NVIDIA/cuda-python/blob/4886636b572e80d74a40fc0a352c9fb762767592/cuda_bindings/cuda/bindings/_internal/utils.pyx#L100-L101
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