Skip to content

Commit 1c172e1

Browse files
authored
Improve documentation of propertynames (#46621)
refer to `property names` not `fieldnames`
1 parent b34f882 commit 1c172e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

base/reflection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ as well to get the properties of an instance of the type.
18381838
18391839
`propertynames(x)` may return only "public" property names that are part
18401840
of the documented interface of `x`. If you want it to also return "private"
1841-
fieldnames intended for internal use, pass `true` for the optional second argument.
1841+
property names intended for internal use, pass `true` for the optional second argument.
18421842
REPL tab completion on `x.` shows only the `private=false` properties.
18431843
18441844
See also: [`hasproperty`](@ref), [`hasfield`](@ref).

doc/src/manual/interfaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ in one or two dimensional outputs, but produce an `Array` for any other dimensio
739739

740740
| Methods to implement | Default definition | Brief description |
741741
|:--------------------------------- |:---------------------------- |:------------------------------------------------------------------------------------- |
742-
| `propertynames(x::ObjType, private::Bool=false)` | `fieldnames(typeof((x))` | Return a tuple of the properties (`x.property`) of an object `x`. If `private=true`, also return fieldnames intended to be kept as private |
742+
| `propertynames(x::ObjType, private::Bool=false)` | `fieldnames(typeof(x))` | Return a tuple of the properties (`x.property`) of an object `x`. If `private=true`, also return property names intended to be kept as private |
743743
| `getproperty(x::ObjType, s::Symbol)` | `getfield(x, s)` | Return property `s` of `x`. `x.s` calls `getproperty(x, :s)`. |
744744
| `setproperty!(x::ObjType, s::Symbol, v)` | `setfield!(x, s, v)` | Set property `s` of `x` to `v`. `x.s = v` calls `setproperty!(x, :s, v)`. Should return `v`.|
745745

0 commit comments

Comments
 (0)