3 ms·
>Python's biggest weakness is the lack of a function that shows you how exactly a variable looks like. Doesn't the repr() built-in function do what you want?
by fuzztester 2y ago
>Python's biggest weakness is the lack of a function that shows you how exactly a variable looks like.
Doesn't the repr() built-in function do what you want?
It can also be customized by defining the __repr__() method of a class, IIRC.
Commonly done.
- lofaszvanitt 2y agoNop.
- fuzztester 2y agoYup. :) Read about repr() here: https://docs.python.org/3/library/functions.html https://docs.python.org/3/library/functions.html and dunder repr, i.e. __repr__() here: https://docs.python.org/3/reference/datamodel.html#object.__repr__ https://docs.python.org/3/reference/datamodel.html#object.__...