LernerPython blog, from Reuven Lerner: Python 3.15 comprehension unpacking: Why you can’t transform items

2 weeks ago 17
Club.noww.in
 Why you can't transform items

The comprehension-unpacking syntax in Python 3.15 is great, but you cannot transform the unpacked elements.

Given:

[[10, 20, 30], [40, 50, 60], [70, 80]]

We can get the individual numbers, but cannot run str on each. For that, we still need a nested comprehension.

The post Python 3.15 comprehension unpacking: Why you can’t transform items appeared first on LernerPython.

Read Entire Article