learning python idioms

C

conkerll

After several years developing in Java, I've begun to switch to Python
for several of my new projects as I have found the language quite
interesting. I've read several tutorials and implemented a few sample
programs and I've found that Python enables one to program in a variety
of different styles (I'm not sure if this was the original intention or
not). Thus, I find myself occaisionally slipping into the "Java"
mindset when writing Python code and I wonder if this is not optimal.
Python is not Java and there must be more "correct" ways of doing this
in Python that simply writing Java code with different syntax. Is
there a good reference on the internet about Python-specific idioms and
just good Python style in general. Which language constructs are
efficient and which aren't?

Thanks in advance,
Ben
 
V

vbgunz

After several years developing in Java, I've begun to switch to Python
for several of my new projects as I have found the language quite
interesting. I've read several tutorials and implemented a few sample
programs and I've found that Python enables one to program in a variety
of different styles (I'm not sure if this was the original intention or
not). Thus, I find myself occaisionally slipping into the "Java"
mindset when writing Python code and I wonder if this is not optimal.
Python is not Java and there must be more "correct" ways of doing this
in Python that simply writing Java code with different syntax. Is
there a good reference on the internet about Python-specific idioms and
just good Python style in general. Which language constructs are
efficient and which aren't?

I completely agree with this. I wish some people would gather and
create a site dedicated to efficient Python idioms. This would be truly
awesome! I hope you get good news on this!

http://vbgunz.blogspot.com
 
G

gene tani

After several years developing in Java, I've begun to switch to Python
for several of my new projects as I have found the language quite
interesting. I've read several tutorials and implemented a few sample
programs and I've found that Python enables one to program in a variety
of different styles (I'm not sure if this was the original intention or
not). Thus, I find myself occaisionally slipping into the "Java"

i googled "Python idioms":

http://www.gungfu.de/facts/wiki/Main/PythonIdioms

also look at the OReilly Python cookbook and the online repository it's
based on
http://aspn.activestate.com/ASPN/Cookbook/Python
 
B

bayerj

yup, you could spend weeks reading the Language Wars:

Actually, that link is not about language wars. It's about making the
switch from java to python. Nothing more, nothing less.
 
J

James Stroud

After several years developing in Java, I've begun to switch to Python
for several of my new projects as I have found the language quite
interesting. I've read several tutorials and implemented a few sample
programs and I've found that Python enables one to program in a variety
of different styles (I'm not sure if this was the original intention or
not). Thus, I find myself occaisionally slipping into the "Java"
mindset when writing Python code and I wonder if this is not optimal.
Python is not Java and there must be more "correct" ways of doing this
in Python that simply writing Java code with different syntax. Is
there a good reference on the internet about Python-specific idioms and
just good Python style in general. Which language constructs are
efficient and which aren't?

Thanks in advance,
Ben

As an experiment, I googled 'python idioms' and got a few good hits
right at the top. I probably should have done this a long time ago.

James








--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top