Author larry
Recipients Arfrever, barry, berker.peksag, brett.cannon, eric.snow, josh.r, jwilk, larry, ncoghlan, njs, serhiy.storchaka, takluyver
Date 2015-08-25.00:32:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440462727.25.0.0935518967849.issue24305@psf.upfronthosting.co.za>
In-reply-to
Content
Is it really *impossible* to "correctly issue a deprecation warning for a module", as the title asserts?  Or does the new import system simply make it *tiresome*?

if sys.version_info.major == 3 and sys.version_info.minor == 4:
  stacklevel = 8
elif  sys.version_info.major == 3 and sys.version_info.minor == 4:
  stacklevel = 10
else:
  stacklevel = 2 # I bet they fixed it in 3.6!

warnings.warn("{} is deprecated".format(__name__), DeprecationWarning,
              stacklevel=stacklevel)


That's Python for you, doing six "impossible" things before breakfast.
History
Date User Action Args
2015-08-25 00:32:07larrysetrecipients: + larry, barry, brett.cannon, ncoghlan, jwilk, Arfrever, njs, eric.snow, takluyver, berker.peksag, serhiy.storchaka, josh.r
2015-08-25 00:32:07larrysetmessageid: <1440462727.25.0.0935518967849.issue24305@psf.upfronthosting.co.za>
2015-08-25 00:32:07larrylinkissue24305 messages
2015-08-25 00:32:06larrycreate