Is .hashValue in Swift is the same as id(object) in Python?


This Content is from Stack Overflow. Question asked by Alex Weber

Using the id(object) function in Python was really useful to understand how language works under the hood. But when I started to learn Swift I didn’t find function with the same functionality.

The nearest one I found was .hashValue but it works only for Hashable objects.

Is any universal function/method for any type objects to identify unique id in Swift?


Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?