Closed Jim-Bar closed 7 years ago
@Zer0Zer0Huit The point of [
is to act as an unbounded list constructor. It can take any number of arguments. For instance, [3 1 4 1 5 9
-> [3, 1, 4, 1, 5 ,9]
. I agree that the documentation is unclear, I'll update it.
I updated the docs, this should be more clear now. https://github.com/isaacg1/pyth/blob/master/rev-doc.txt line 177 has the new version.
By the way, what would be the right way to have the same behaviour as list()
on strings?
md"abc"
From the documentation of
[
:List constructor. list(A) in Python
.However,
[G
won't produce['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
as expected, but['abcdefghijklmnopqrstuvwxyz']
. That is true for any string fed to[
.It is redundant with
]
which will produce[A]
.