Python complaints

Fredrik Lundh fredrik at pythonware.com
Mon Nov 29 12:03:23 CET 1999


William J. King <wjk at wjk.mv.com> wrote:

(some quickies)

> 1.  like the indents -- makes coding easier to read and follow  -
>         requires discipline me thinks

well, I'm totally undisciplined, and I just love
indentation...

> 2. would like something like  'increment'/'decrement' operators
>         either in form:
>                     "x++"  or "incr x" vice "x = x + 1 " but its ok

if you find yourself using a lot of "x = x + 1" in your
code, you're probably not using for-in and other
sequence operations as much as you should...

> 3. would like to be able to iterate through a list using 2/more variables
> instead of
>         only one (unless its possible and I missed it) :
>                             for (x,y,z) in list:
>                                     pass            #favorite thing about
> Python

if list contains 3-tuples, that works exactly as you'd
expect.  if you have three lists, you can do:

    for x, y, z in map(None, list1, list2, list3):
        ...

a better syntax for this might make it into 1.6 (at least
according to GvR's presentation on the last python con-
ference).

http://www.foretec.com/python/workshops/1998-11/proceedings/guido/index.html

(hmm.  if I leave out the index.html part, the foretec
server redirects me to the fortec site ;-)

> 
> 4. conversion of integer to a string ( which may exist but havn't found
> yet) 

here are a few ways to do that:

    `integer`
    str(integer)
    "%d" % integer

> 5. would like to see regular array construct in addition to
> dictionary/list/tuples
>         faked that one with a dictionary

what's a "regular array construct", and how does that
differ from a python list?

(if you mean multidimensional arrays, numerical python
has that -- and those parts of numpy is very likely to
make it into standard python any day soon...)

> 6. some simpler description of current regular expressions in python
> some knowledge of grep/vi/awk/sed/perl/tcl - glob - regexp & regsub
> and now python can be a dangerous thing -- regular expressions rule if
> you get them right

yeah, but regular expression syntax suck ;-)

    Some people, when confronted with a problem, think
    "I know, I'll use regular expressions".  Now they have
    two problems.
        Jamie Zawinski, on comp.lang.emacs

(I hope Python will grow a much cooler string pattern
syntax some day, but that's another story.)

> 7. Tkinter is proving to be easier than I thought -- mostly intuitive from
> some previouse experience with Tcl/Tk - X-windows/Win95

with a little performance tuning, and some additional
widgets, Tkinter is quite ok (but I might be biased...)

...

</F>





More information about the Python-list mailing list