language-x-isms

B

Bryan

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)


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
 
B

bruno at modulix

Bryan said:
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" !-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top