Re:Where do type systems come from? (2017)
by MichaelBurge on Friday October 01, 2021 @09:41AM
(#28718307)
In Python, a function named "sort" could take an array and return an integer. Or None. Or crash. So knowing that it returns an array of integers is an improvement over the untyped case.
Types like "returns an array" or Java's checked exceptions are attempts at narrowing the possible behaviors from a function.
Types like "returns an array" or Java's checked exceptions are attempts at narrowing the possible behaviors from a function.