From 78e7da5eea65643b5ca2d94808a2f2279761ea63 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 30 Nov 2018 18:15:48 +0100 Subject: [PATCH] News and compat annotation for #29259 (merge(::NamedTuple...) with more than 2 arguments). --- NEWS.md | 1 + base/namedtuple.jl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index d11ad50fc8bca..2d00b707ec6ce 100644 --- a/NEWS.md +++ b/NEWS.md @@ -72,6 +72,7 @@ Standard library changes * `Symmetric` and `Hermitian` matrices now preserve the wrapper when scaled with a number ([#29469]). * New `edit(m::Module)` method which opens the main source file for module `m` ([#29636]). * `Base.@kwdef` can now be used for parametric structs, and for structs with supertypes ([#29316]). + * `merge(::NamedTuple, ::NamedTuple...)` can now be used with more than 2 `NamedTuple`s ([#29259]). Compiler/Runtime improvements ----------------------------- diff --git a/base/namedtuple.jl b/base/namedtuple.jl index 8b0d777feab81..66f5a18774b27 100644 --- a/base/namedtuple.jl +++ b/base/namedtuple.jl @@ -223,6 +223,10 @@ contains that field. Fields present in only the rightmost named tuple of a pair A fallback is implemented for when only a single named tuple is supplied, with signature `merge(a::NamedTuple)`. +!!! compat "Julia 1.1" + Merging 3 or more `NamedTuple` requires at least Julia 1.1. + +# Examples ```jldoctest julia> merge((a=1, b=2, c=3), (b=4, d=5)) (a = 1, b = 4, c = 3, d = 5)