In Node.js when I want to quickly check the value of something rather than busting out the debugger and stepping through, I quickly add a console.log(foo) and get a beautiful:
{
lemmons: "pie",
number: 9,
fetch: function(){..}
elements: {
fire: 99.9
}
}
Very clear! In Python I get this:
class LinkedList:
head = None
tail = None
lemmons = 99
<__main__.LinkedList instance at 0x105989f80>
or with vars()
,
{}
or with dir()
,
['_LinkedList__Node', '__doc__', '__module__', 'append', 'get_tail', 'head', 'lemmons', 'remove', 'tail']
Yuck! Look at all that nonsense - I thought python was supposed to be fast, beautiful and clean? Is this really how people do it? Do they implement customer str and custom repr for everything? Because that seems kind of crazy too..