Practical numbers: Difference between revisions

Undo revision 328985 by Paddy3118 (talk)
m (Yet more vandalism cleaned up. This is not what Rosetta Code is where. Where we diverge, we enrich the sight with alternative versions)
(Undo revision 328985 by Paddy3118 (talk))
Line 428:
666 is practical :: True</pre>
 
 
===Semantic type comments replaced by compiler type hints===
Note the prominence here of the '''Callable''' type symbol, and the loss of specificity for the reader, in the uses of the '''Any''' type symbol.
 
Semantic clarity for the human reader could be improved by restoring the informal – but cleaner, and more informative – type comments which this version deletes from the original version above.
 
For example, this version replaces an informative type comment:
 
'''sumOfAnySubset :: [Int] -> Int -> Bool'''
 
with a noisier, (but, for the human reader, less informative) compiler hint:
 
'''List[int]) -> Callable[[Any], Any]'''
 
<lang python>'''Practical numbers'''
9,659

edits