From 330c79da4f2c7d4b77fdc661b857950887a4f035 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Thu, 22 Jun 2023 10:39:15 -0500 Subject: [PATCH] Add note to `load_path` docstring stating that it is not safe to mutate its return value (#50233) --- base/initdefs.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base/initdefs.jl b/base/initdefs.jl index d1d37839a7c13..ed0aa3856f339 100644 --- a/base/initdefs.jl +++ b/base/initdefs.jl @@ -336,6 +336,10 @@ end Return the fully expanded value of [`LOAD_PATH`](@ref) that is searched for projects and packages. + +!!! note + `load_path` may return a reference to a cached value so it is not safe to modify the + returned vector. """ function load_path() cache = LOADING_CACHE[]