Favorite non-python language trick?

Edvard Majakari edvard+news at majakari.net
Wed Jul 6 11:18:50 EDT 2005


(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.



More information about the Python-list mailing list