[pytest-dev] [proposal] deprecate magic constant scopes in favour of the node types

Bruno Oliveira nicoddemus at gmail.com
Tue Aug 29 09:19:50 EDT 2017


Hi Ronny,

On Tue, Aug 29, 2017 at 4:48 AM RonnyPfannschmidt <
opensource at ronnypfannschmidt.de> wrote:

> Hi all,
>
> since quite a while now we have used magic constants for scope names,
> while we have something perfectly fitting already at hand - namely the
> Node classes we actually use and mean
>
> i believe its a disservice that we use magic strings one has to manually
> map while we have very exact names for those already
>

I like the idea in general of using specific constants instead of magic
strings, but in this specific case we also have to take in account the
problem of asking all users to change the API for very little gain in terms
of internal code: just a few lines of trivial code which maps the strings.
Also keep in mind that we will have to support the magic constants anyway
for years to come, so the (small) code advantage won't happen for quite a
long time, we will only add more cognitive burden to users to have two ways
of doing the same thing.

In summary I'm all for improving the API and the internal code if this will
bring us strong gains, I just don't think this is one of those cases so I'm
-1 on the idea.

Cheers,
Bruno.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20170829/6961a2d6/attachment.html>


More information about the pytest-dev mailing list