Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14301

How can py tuple implicit cast to int? [closed]

$
0
0

This code compiles and runs and works fine as a hash for an array of ints :

    def hashValue(a: List[int]) -> int:        return tuple(a)

But I don't understand what's going on under the hood.

Does py maintain an internal hash of the immutable tuple ?


Viewing all articles
Browse latest Browse all 14301

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>