Skip to content

Commit 9e93f81

Browse files
committed
docs: add note about not implying being defined to names
ref #51584
1 parent 165f728 commit 9e93f81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

base/reflection.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ are also included.
8484
As a special case, all names defined in `Main` are considered \"public\",
8585
since it is not idiomatic to explicitly mark names from `Main` as public.
8686
87+
!!! note
88+
`sym ∈ names(SomeModule)` does *not* imply `isdefined(SomeModule, sym)`,
89+
because the symbol may be exported from, but not defined in the module.
90+
8791
See also: [`isexported`](@ref), [`ispublic`](@ref), [`@locals`](@ref Base.@locals), [`@__MODULE__`](@ref).
8892
"""
8993
names(m::Module; all::Bool = false, imported::Bool = false) =

0 commit comments

Comments
 (0)