Re:Python Idioms in Rust
by codetrotter on Friday March 30, 2018 @03:13PM
(#16718945)
How so? Comprehensions vs loops vs recursive functions vs in some cases map/reduce/filter is the only example I can think of.
[ Parent
| on HN ]
There's also strings.
'foo ' + bar
'foo {}'.format(bar)
'foo %s' % bar
f'foo {bar}'
Re:Python Idioms in Rust
by BerislavLopac on Saturday March 31, 2018 @12:15PM
(#16723858)
As well as the string templates almost nobody knows about (https://docs.python.org/3.6/library/string.html#template-str...):
Template('$foo bar').substitute(foo='foo')