Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 1.58 KB

repr.md

File metadata and controls

21 lines (18 loc) · 1.58 KB
title description
Python repr() built-in function - Python Cheatsheet
Return a string containing a printable representation of an object. For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(); otherwise, the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a __repr__() method.
Python repr() built-in function From the Python 3 documentation Return a string containing a printable representation of an object. For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(); otherwise, the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a __repr__() method.