473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

language-x-isms

does anyone know if there is a collection somewhere of common python mistakes or
inefficiencies or unpythonic code that java developers make when first starting
out writing python code? if not, maybe we could start a thread on this.

for example, i've noticed several java developers i know write python code like
this:

foo_list = [...]
for i in range(len(foo_list)):
print '%d %s' % (i, foo_list[i])
of course, one way to do this would be to use enumerate:

for i, foo in enumerate(foo_list):
print '%d %s' % (i, foo)
i'm guessing there is a lot of these language-x-isms that people on this list
have seen. i think it would be helpful to both the new java-to-python developer
and python developers in general to be aware of these.

just an idea.
feel free to discuss any language-x-isms, not necessarily just java-isms.

bryan

Jun 8 '06 #1
1 985
Bryan wrote:
does anyone know if there is a collection somewhere of common python
mistakes or inefficiencies or unpythonic code that java developers make
when first starting out writing python code?


Try googling for "python is not java" !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jun 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.