(sorry, my NUA had lost the original article)
>
>> I'm curious -- what is everyone's favorite trick from a non-python
>> language? And -- why isn't it in Python?

Ability to tag some methods 'deprecated' as in Java (from 1.5
onwards?). However, Python interpreter doesn't have to do it: pydoc and
similar tools could detect, say, '@deprecated' in method comment string and
warn user about it.

Currently I just document deprecated methods, and if I feel like it, I also
add

def some_method_which_is_badly_named_or_just_plain_wrong(..)
    """docstring

    This method is now deprecated. Use frob() instead.
    """

    sys.stderr.write('warning: method 
some_method_which_is_badly_named_or_just_plain_wrong is now deprecated')


-- 
# Edvard Majakari               Software Engineer
# PGP PUBLIC KEY available      Soli Deo Gloria!
You shouldn't verb verbs.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to