On 26 April 2017 at 21:51, Erik email@example.com wrote:
It doesn't make anything more efficient, however all of the suggestions of how to do it with current syntax (mostly decorators) _do_ make things less efficient.
Is instance creation the performance bottleneck in your application? That seems unusual. I guess it's possible if you're reading a large database file and creating objects for each row. But in that case, as Chris A says, you may be better with something like a named tuple. In any case, optimising for performance is not what generic solutions are good at, so it's not surprising that a generic decorator involves a performance hit.