Closed mmenendezg closed 1 month ago
@mmenendezg I am not sure if we should expose a UnsafePointer constructor method to user. Do you have any specific use cases for such constructor? Is there something similar in numpy?
@mmenendezg I am not sure if we should expose a UnsafePointer constructor method to user. Do you have any specific use cases for such constructor? Is there something similar in numpy?
I don't think that we should do this. It looks quite unsafe.
Got it
@mmenendezg I am not sure if we should expose a UnsafePointer constructor method to user. Do you have any specific use cases for such constructor? Is there something similar in numpy?
I totally missed the safety implications on this, and I rather looked at possible initialization alternatives. I will reverse that and only remove the redundant initialization methods.
I totally missed the safety implications on this, and I rather looked at possible initialization alternatives. I will reverse that and only remove the redundant initialization methods.
@mmenendezg The function itself is still useful. I think you can put this into the array creation routine, and rename the function as, e.g., "from_unsafepointer()".
I totally missed the safety implications on this, and I rather looked at possible initialization alternatives. I will reverse that and only remove the redundant initialization methods.
@mmenendezg The function itself is still useful. I think you can put this into the array creation routine, and rename the function as, e.g., "from_unsafepointer()".
That's a good idea. I will make the changes.
New initialization method from an
UnsafePointer
. Additionally, removed the initialization for random arrays from thendarray.mojo
file.