3 ms·
On a similar note I wrote this over few days last week: https://github.com/adh/py-clos https://github.com/adh/py-clos What it severely lacks is readme that cle
by dfox 10y ago
On a similar note I wrote this over few days last week: https://github.com/adh/py-clos https://github.com/adh/py-clos
What it severely lacks is readme that clearly states what it does with some realistic examples and is understandable by people who have no idea what CLOS is, so: It allows you to do function overloading which is resolved dynamically based on actual types of passed values or even values themselves. With the included (trivial) C extension it's only about 50% slower than Python method call, so in all for expected usecase it's faster than Visitor pattern not to mention more DRY.