3 ms·
I think people only like that when they write the code themselves and/or are familiar with it. But if you have to work in a new project / code base and there i
by valenterry 5y ago
I think people only like that when they write the code themselves and/or are familiar with it.
But if you have to work in a new project / code base and there is a lot of this kind of magic, then it's really really hard to figure out how things work and where you need or even can make changes to change behaviour.
I would go so far to say that this is actually an anti-pattern.
The alternative that I prefer: have a sane default that is generated somewhere and searchable for anyone who doesn't know the convention yet. And in the case of pytest, I think this is just a shortcoming of the language in spite of a better way of doing proper dependency-injection. I remember very well that angular 1.x did something very similar and it was very confusing (they called .toString on the function to find the argument-names). It also violates the general idea of being able to safely refactor a method argument name without breaking things.