Re:Pyre: Fast Type Checking for Python
by joshuamorton on Monday May 14, 2018 @12:22AM
(#17062658)
Only if you iterate over a fixed-length iterable.
[x for x in itertools.count()]
will never terminate.
Re:Pyre: Fast Type Checking for Python
by heavenlyblue on Wednesday May 23, 2018 @01:06PM
(#17135809)
It will terminate as soon as it runs out of memory.
Re:Pyre: Fast Type Checking for Python
by joshuamorton on Wednesday May 23, 2018 @01:13PM
(#17135889)
By this definition, python has a nice locally defined property that it will always terminate ;)
Re:Pyre: Fast Type Checking for Python
by heavenlyblue on Thursday May 24, 2018 @09:12AM
(#17143601)
No; this will never-ever terminate:
(x for x in itertools.count())Obligatory Dijkstra: "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
Short is good when the average half-life of your code is less than a month.
When you're writing something for 10 years and beyond - it makes sense to have something incredibly sophisticated and explicit.
Otherwise it doesn't since the amount of time it takes me to comprehend all of the assumptions you made in all of those nested for loops is probably longer that the lifetime of the code in production.
List comprehension has a nice, locally-defined property in python: it will always terminate.