From 863a867c6197621d6e999e8640d223a8e084c31a Mon Sep 17 00:00:00 2001 From: Kristoffer Date: Thu, 5 Jan 2023 21:24:16 +0100 Subject: [PATCH] add a note to `ismutable` docstring about `String` and `Symbol` --- base/reflection.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base/reflection.jl b/base/reflection.jl index 2b559b73261c6..a559ed63d5841 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -527,6 +527,10 @@ Return `true` if and only if value `v` is mutable. See [Mutable Composite Types for a discussion of immutability. Note that this function works on values, so if you give it a `DataType`, it will tell you that a value of the type is mutable. +!!! note + For technical reasons, `ismutable` returns `true` for values of certain special types + (for example `String` and `Symbol`) even though they cannot be mutated in a permissible way. + See also [`isbits`](@ref), [`isstructtype`](@ref). # Examples