-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Piracy in the StdLibs #30945
Comments
Wow, a couple interesting items here.
That's entirely in base, seems like an incorrect result.
Pkg, are you kidding me? It doesn't even return a string...
Yep, should be moved to Base. Not sure It looks like every useful method of
|
You have the power to tick them (and other meanless ones and false positives) off right? |
That is really cool. I worry about about people getting too worried about piracy (there are occasionally some very good reasons for it), but having a tool to detect seems like a clear win. |
|
Right; I look forward to wearing my "I'm a type pirate" T-shirt :) I think this is best seen as a heuristic for finding misplaced code, unintentional method extensions, etc. |
This is kind of OK since it's the only way to make new irrational numbers. However, we should perhaps add a couple more like sqrt(2) to Base.
This is intentional, since we wanted to move doc viewing code out of Base. But I think it's still up in the air where all the Base.Docs code should go exactly.
Could maybe go in base, but VersionNumber isn't iterable. Maybe Pkg could arrange to wrap the argument in a VersionRange instead?
Can move to Base.
This might actually make sense in Base as well. The code for writing is much simpler than the code for parsing. We should maybe even use this as the output format of |
|
Fix at JuliaLang/Pkg.jl#1036 |
|
There's also julia/stdlib/SparseArrays/src/sparsevector.jl Line 1072 in 9bd5c18
SparseArrays seems like a chronic offender: #32213 |
This is missing e.g julia> @which rand(5,5) * rand(5,5)
*(A::AbstractArray{T,2} where T, B::AbstractArray{T,2} where T) in LinearAlgebra at ...julia/stdlib/v1.3/LinearAlgebra/src/matmul.jl:152 |
FWIW, type piracy means that it is impossible to look at the Project and know what stdlibs a package actually use. For example, you can do matrix multiplication or call |
#43127 fixes some of the sparse arrays related ones. |
I have been playing with the idea of automatically detecting type piracy.
https://discourse.julialang.org/t/pirate-hunter/20402
Here is the results of running it will the standard libraries loaded.
/julia/stdlib/v1.1/Pkg/src/Types.jl:1453
I'm not sure how many of these already have issues, eg #28234
and how many are harmless.
I am sure someone more knowledge-able than me can strike a bunch of them as not problematic.
But I figured I should share the list
The text was updated successfully, but these errors were encountered: