-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
object array construction should require explicitly specifying dtype=object #5353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also #2091 (comment). |
An intermediate solution, which I suggested in #5844, is an explicit opt-out mechanism, perhaps using |
+1's from notes linked from a mailing list post:
|
A while ago I wrote up some "documentation" of how object arrays might work ideally, which includes various special cases and this explicit |
@ahaldane - thanks, at least for me that was very useful! |
@ahaldane: any interest into evolving that into a NEP? (Like a PEP but for
|
@njsmith yeah that might be a good idea. I'll collect my thoughts for a bit and then I'll see if I can rework it into that format. |
We should probably get started on this. A deprecation in array creation would be a good place to start. We might have problems with array subclasses that override |
|
I'd be happy to try some work on this sometime soon. I'm travelling for a week, but I'll take a look afterwards. |
Followup: I tried implementing the new behavior (and not just the depracation) to avoid automatic object coercion by a simple modification It looks like a good solution! Only 9 tests fail, all of which are explicitly checking cases like variable-length lists. Perhaps the solution is as simple as that. I haven't thought about |
Another topic for potential BIDS discussion. @stefanv Ping. |
This possibility was raised by #5303 (comment) so I'm moving this topic to its own github issue. Problems like scipy/scipy#4239 among others could be softened by making this change although it could bring backwards compatibility issues.
The text was updated successfully, but these errors were encountered: