This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abarry
Recipients Tim.Graham, abarry, brett.cannon, martin.panter, ncoghlan, ned.deily, r.david.murray, rhettinger, serhiy.storchaka, yan12125, yselivanov
Date 2016-09-16.00:13:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473984822.04.0.297305153127.issue28128@psf.upfronthosting.co.za>
In-reply-to
Content
There definitely needs to be a better message for that. The problem is that the parser doesn't have access to the whole string (of course; it's being constructed!), so I think there are several possible venues here:

- Change DeprecationWarning to display the line which is faulty (unlikely);
- Promote these specific warnings to SyntaxErrors *only* if the warning is an error (i.e. Python was run with -W error), in which case the compilation of code is stopped either way, so there is no drawback (but only being a syntax error "sometimes" is likely to confuse people);
- Use a different warning class, but presumably we'd need a new one and we can't do that now since we're in beta (unless Ned thinks this is appropriate, but I doubt it).

Anything else, maybe? I'm sure there is a way to properly fix it; my personal favourite all things considered is the second option (which I've thought over and over recently), but I'm open to other, less intrusive alternatives.

My intention is to make this deprecation the least painful possible for application and third-party library developers. As such, I think adding a note to the docs (possibly in What's New, but probably also under a few other related places) is good, and probably doing a preemptive SO question+answer for people who stumble upon this.

I've added to nosy a couple of people whose feedback I believe could be very helpful.
History
Date User Action Args
2016-09-16 00:13:42abarrysetrecipients: + abarry, brett.cannon, rhettinger, ncoghlan, ned.deily, r.david.murray, martin.panter, serhiy.storchaka, yselivanov, Tim.Graham, yan12125
2016-09-16 00:13:42abarrysetmessageid: <1473984822.04.0.297305153127.issue28128@psf.upfronthosting.co.za>
2016-09-16 00:13:42abarrylinkissue28128 messages
2016-09-16 00:13:41abarrycreate