Skip to content

Commit c173ae0

Browse files
authored
Merge pull request #23529 from Sacha0/depwritecsv
deprecate writecsv in favor of writedlm
2 parents 61c7386 + 3488679 commit c173ae0

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ Deprecated or removed
279279
* The keyword `immutable` is fully deprecated to `struct`, and
280280
`type` is fully deprecated to `mutable struct` ([#19157], [#20418]).
281281

282+
* `writecsv(io, a; opts...)` has been deprecated in favor of
283+
`writedlm(io, a, ','; opts...)` ([#23529]).
284+
282285
* The method `srand(rng, filename, n=4)` has been deprecated ([#21359]).
283286

284287
* The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated

base/datafmt.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module DataFmt
66

77
import Base: _default_delims, tryparse_internal, show
88

9-
export countlines, readdlm, readcsv, writedlm, writecsv
9+
export countlines, readdlm, readcsv, writedlm
1010

1111
invalid_dlm(::Type{Char}) = reinterpret(Char, 0xfffffffe)
1212
invalid_dlm(::Type{UInt8}) = 0xfe
@@ -703,13 +703,6 @@ tab-delimited text to `f` by either `writedlm(f, [x y])` or by `writedlm(f, zip(
703703
"""
704704
writedlm(io, a; opts...) = writedlm(io, a, '\t'; opts...)
705705

706-
"""
707-
writecsv(filename, A; opts)
708-
709-
Equivalent to [`writedlm`](@ref) with `delim` set to comma.
710-
"""
711-
writecsv(io, a; opts...) = writedlm(io, a, ','; opts...)
712-
713706
show(io::IO, ::MIME"text/csv", a) = writedlm(io, a, ',')
714707
show(io::IO, ::MIME"text/tab-separated-values", a) = writedlm(io, a, '\t')
715708

base/deprecated.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,9 @@ import .LinAlg: diagm
17261726
@deprecate_binding φ MathConstants.φ
17271727
@deprecate_binding golden MathConstants.golden
17281728

1729+
# deprecate writecsv
1730+
@deprecate writecsv(io, a; opts...) writedlm(io, a, ','; opts...)
1731+
17291732
# PR #23271
17301733
function IOContext(io::IO; kws...)
17311734
depwarn("IOContext(io, k=v, ...) is deprecated, use IOContext(io, :k => v, ...) instead.", :IOContext)

base/exports.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,6 @@ export
10731073
unmark,
10741074
watch_file,
10751075
write,
1076-
writecsv,
10771076
writedlm,
10781077
TCPSocket,
10791078
UDPSocket,

doc/src/stdlib/io-network.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Base.DataFmt.readdlm(::Any, ::Type)
8484
Base.DataFmt.readdlm(::Any)
8585
Base.DataFmt.writedlm
8686
Base.DataFmt.readcsv
87-
Base.DataFmt.writecsv
8887
Base.Base64.Base64EncodePipe
8988
Base.Base64.Base64DecodePipe
9089
Base.Base64.base64encode

test/perf/kernel/perf.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ d = randn(len)
102102

103103
@timeit (for n in 1:10; a = arith_vectorized(b,c,d); end) "vectorize" "Vectorized arithmetic"
104104

105-
writecsv("random.csv", rand(100000,4))
105+
writedlm("random.csv", rand(100000, 4), ',')
106106

107107
function parsecsv()
108108
for line in eachline("random.csv")

0 commit comments

Comments
 (0)