4 ms·
> attempting to ascertain whether "lambda:0" is really the shortest way to make an empty object in python... In what sense does "lambda:0" create an empty obje
by sltkr 12y ago
> attempting to ascertain whether "lambda:0" is really the shortest way to make an empty object in python...
In what sense does "lambda:0" create an empty object? And how is it better than "object()"?
- nanoscopic 12y agoSpecifically I was in need of making an "object" that could have attributes set on it. You can either use lambda:anything_syntax_ok or an empty class. The empty class is much bigger. Lambda is an ugly hack but it works...