3 ms·
Interesting. I hadn't come across that idiom before. In Python, you'll have things like: myLongList = [1, 2, 3, 4, 5, 6, 7, 8
by timknauf 18y ago
Interesting. I hadn't come across that idiom before. In Python, you'll have things like:
myLongList = [1, 2, 3,
4, 5, 6,
7, 8, 9]
No continuation character is needed, because the continuation is implied.
However, I can't think of a direct parallel to your example above. It looks handy. What API/language are you alluding to?
I guess the Pythonic way would be something like:
win = Window(title = "A new window",
foreground = "Red",
background = "White",
menuBar = [fileMenu, viewMenu, helpMenu])
But I disgress. :^)
- deleted 18y ago[deleted]
- sc 18y agoJavaScript can just as easily attain this way of using named parameters: win = Window.new({title: "A new window", foreground: Red, background: White, menuBar: [fileMenu, viewMenu, helpMenu]});
- cabalamat 18y agoWhat API/language are you alluding to? As i said before: no particular language.