Nov-07-2018, 09:19 PM
(Nov-07-2018, 04:03 AM)Skaperen Wrote: this is the limitation that prevents making a function (named whatever you want to name it) do as i describedI didn't say that. I say that the
clen()
function can behave the way you want for ALL types, but that this behavior can be based on a __clen__
attribute only for user defined types because one can not add members to builtin types.It is a limitation that we cannot add members to builtin types BUT it doesn't prevent us from implementing a dynamic
clen()
function by the means of functools.singledipatch
.