Too many conference recordings without a touch on refactoring the broken mapped function ?
Wish i could have a real `array.map` just like in javascript.
Wish i could have a real `array.map` just like in javascript.
['10', '10', '10'].map(parseInt) === [10, NaN, 2]That was written in 1985. If you're thinking of this as a mistake and waiting for it to be corrected, you're going to be waiting a long time.
Edit: Although it would be awesome if Python had extension functions like Kotlin, which would make this super easy to fix (either in your own code or the standard library). But that would require static typing to be more baked into the core language.
x.map(fn)
In python, mapped takes some arguments that makes me confused in order and types of arguments.
Secondly, it broke my thinking process.
With that configured, a window pops up in Vim and says we have:
map(func: Callable[[_T1], _S], iter1: Iterable[_T1], /) -> Iterator[_S]
——————————————————————————————————————————————————————————————————————————————
map(func, *iterables) --> map object
Make an iterator that computes the function using arguments from
each of the iterables. Stops when the shortest iterable is exhausted.
——————————————————————————————————————————————————————————————————————————————
There are things to criticize here. Note that the type hinting (this is Python 3.8 btw) doesn't agree with the full generality of the stated function interface (the multiple iterables part).