Conversation
|
OK, I guess the warning should work like this: from warnings import warn
warn("blah", DeprecationWarning)See https://docs.python.org/3.4/library/warnings.html#warnings.warn. I think this is one of the few cases where the import should happen directly before using the function. |
26e6d91 to
501ccab
Compare
|
This warning only shows up if you explicitly ask for it. Normal users will never see this. Is this really what we wanted? |
|
Hmmm ... I wasn't aware of that. Apparently, since Python 2.7, I don't think this is what we wanted. We could just get a bit more aggressive by removing the implementation and just raising a Alternatively, we could change the warning to a plain |
|
They make a point in the documentation, that the way we are doing it right now is the preferred way of doing it, since users don't typically need to be aware of deprecations, and developers typically should be running programs with all warnings enabled anyway. I agree that we should elevate this to a plain |
since DeprecationWarnings are by default not visible to users, and this is a user-visible feature.
|
Now the warning shows up, let's merge! |
deprecate indexing of SoundFile
Using
__getitem__or__setitem__should raise a warning, and the deprecation should be marked in the docstrings ofSoundFile, pysoundfile, and the README.