Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs of construction undef arrays with missing #31091

Merged
merged 4 commits into from
Oct 30, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/src/manual/missing.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ julia> Array{Union{Missing, String}}(missing, 2, 3)
missing missing missing
```

!!! note
Currently for `T` that is bits type (`isbitstype(T)` returns `true`), if `T`
is not a singleton type then `Array{Union{Missing, T}}(undef, dims)` creates
an array filled with `missing` values. Also in this case calling `similar`
to create an unitialized array that has element type of the form
`Union{Missing, T}` creates an array filled with `missing`. If `T` is a
singleton type the value that is used to fill the array is undefined and
could change in the future, so it should not be relied upon.
bkamins marked this conversation as resolved.
Show resolved Hide resolved
An array allowing for `missing` values but which does not contain any such value
can be converted back to an array which does not allow for missing values using
[`convert`](@ref). If the array contains `missing` values, a `MethodError` is thrown
Expand Down