ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Python Language Annoyances

<< < (5/7) > >>

ewemoa:
I'm curious (famous last words?), how many Python-using folks here use PyChecker or something like it?  I found it useful for the few things I used it for and IIRC it can point certain kinds of things out that the interpreter doesn't tell you about.

To drift a bit OT, FWIW:

For Perl, I tended to use -w and use strict, both of which helped.  (It appears there's now a Perl::Critic.)

For Javascript I used jslint.

May be there's a pattern here? ;)

tinjaw:
I code with Eclipse/Aptana/Pydev and get all of the code checking that come with that.

f0dder:
1. The errors that he's had to bring to me are because of the indentation and the lack of implicit variable declarations-wraith808 (January 29, 2010, 10:33 PM)
--- End quote ---
I suppose you mean explicit?

I'm still a firm believer that choosing indentation for blocks was a mistake - delegating checks to a 3rd-party tool instead of the language core doesn't really help. Same goes for not requiring explicit variable declaration (which, as mentioned previously, has nothing to do with static vs dynamic typing).

wraith808:
Oops... yeah.  Explicit.  I found that really prone to causing errors on vb if you had the option for Explicit declarations off... and it's no different in Python.  And yes, considering that different editors indent in different manners- indentation sucks as a block method.

ajp:
@Mouser:
Implicit variable declaration... I don't now. (Disclaimer: I am a Python fanboy of some sort but) I learned programming with Pascal and C, so I pretty much became used to the discipline of declaring variables. So, all my "relevant" variables get declared (well, initialized) in meaningful places. "Non-relevant" ones (i.e. counters that are used in a loop and don't get re-used later) I just use them as I go without taking much notice (which is sometimes convenient). Since I already have the mindset of "declarations go at the beggining of the block", it's simply natural and convenient at the same time. But I guess for someone who is using Python as a learning language, s/he must be taught of the importance of declaration for readability's sake.

As for indenting, if you and your teammates get to an agreement on tabs vs. spaces (I know, flame war's awaiting), it quickly becomes natural, and you won't miss typing { or } again in your life.

If I must rant about something, here it comes:
* "self". Yep, it's unelegant. It leaves the context clear and explicit, but it's ugly.
* unicode support. I guess in v3.0 it's better (haven't used it yet), but on v2.x, since I normally need "special" chars (I'm Mexican; accents are nothing sort of "special" in Spanish), it's a chore that simple read/write ops get polluted by unicode(x), x.encode('utf-8','replace') and so on.

Still, I love Python.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version