Actions
Bug #12682
closedHash#flatten(level) does not recursively flatten inner hashes.
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
Description
pry
[1] pry(main)> x = {a: {b: 1, c:2}}
=> {:a=>{:b=>1, :c=>2}}
[2] pry(main)> x.flatten(1)
=> [:a, {:b=>1, :c=>2}]
[3] pry(main)> x.flatten(2)
=> [:a, {:b=>1, :c=>2}]
Updated by marcandre (Marc-Andre Lafortune) over 7 years ago
- Status changed from Open to Rejected
The documentation of Array#flatten
is pretty clear:
"...That is, for every element that is an array, extract its elements into the new array."
So it follows the documentation and would create massive incompatibilities to change!
Actions
Like0
Like0