Comments (6)
IIRC @vtjnash said this was intentional, but there was much complaining from pretty much anyone, so I think we need to think about this again, possibly by tweaking the display code to only display methods that are reachable in the current world.
from julia.
Bisected to #53415
from julia.
How about the following: We change the display code to only count methods which are reachable in the current world for some signature. Now, I don't believe we have that exact query in the type system, but I think something along the lines of typesubtract(m.sig, mapreduce(m2->m2.sig, Union, filter(!=(m), methods(m.sig)) !== Union{}
would be pretty close. It's a little expensive to compute, but probably doesn't matter for interactive showing.
from julia.
I don't believe we have that exact query in the type system
It is exactly the query you get if specifying lim != -1
, though it indeed is expensive. Of note though that this can be approximated quite well with a O(1) pair-wise check (and which is an exact if there is no ambiguities), as two type-egal methods must be adjacent in the output list, per the definition of morespecific, after filtering ambiguities.
from julia.
This also seems unexpected:
f() = 1
f() = 2
julia> methods(f, Tuple{})
# 1 method for generic function "f" from Main:
[1] f()
@ REPL[15]:1
julia> methods(f, Tuple{Vararg{Any}})
# 2 methods for generic function "f" from Main:
[1] f()
@ REPL[15]:1
[2] f()
@ REPL[14]:1
from julia.
The behavior of lim==-1
has always been that way for whether it chooses to filter out supertypes. I suppose because it happens to be O(n)
whereas the filter for the general case is O(n^3)
, where n
is the number of methods that matched
from julia.
Related Issues (20)
- TTFX regression with Comonicon CLI on Julia 1.11 HOT 2
- possible dispatch bug: method static parameter matching fails
- `LinearAlgebra` with `BigFloat` edgecases crash Julia HOT 3
- `make JULIA_PRECOMPILE=0` doesn't skip precompilation of stdlibs anymore HOT 8
- incorrect method lookup for Union{} type dispatch
- Regression: failure of TypeVar in recursive struct with `NTuple` field HOT 1
- CI: test failure in UUIDs with `uuid7(Xoshiro(0))` HOT 5
- Cornercase where closure boxing fails in function bodies
- Crash in recursive function with many intermediate allocations HOT 4
- Cannot load shared library HOT 1
- literal_pow isn't marked public and isn't documented HOT 3
- help REPL: syntax highlighting makes some words invisible HOT 1
- AnnotatedString: wrong join() result with other string types HOT 2
- AnnotatedString displays as a regular String, annotations aren't shown HOT 3
- Make stack size configurable in `Threads.@spawn`
- Weird inheritance of `TypeVar` of types used as lower bounds in parametric types. HOT 5
- Rational power of `BigFloat` should use specialised MPFR function HOT 9
- Runtime crash with unreachable reached HOT 4
- incorrect dispatch trying to print `Union{}` Type HOT 2
- `sum` with dims kwarg is incorrect on Any array when missings are present HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.