[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: A few minutes from the ILUGC meet - 23rd Dec, 2000



I've already posted this message once, but it has not appeared on the list.
This is the second time, so my appologies if this ends up as a double post.

--- Second try ---

Sorry to nit-pick, but I spotted some errors (and added some other comments) -

Suraj.co.in wrote (suraj@xxxxxxxxxxxxxx):
> 
>  There is another data type called 'dictionary'.
[snip]
> But the key can be anything, an object, a list, a class, 
>  even a function! the dictionary can be constructed as follows:
> 

Well, the key can be anything as long as it's immutable. Numbers, strings,
tuples, functions, classes and instances are immutable, but not lists. So you
*cannot* use lists as dictionary indices.

eg.
    x = {}                  # Create an empty dictionary
    x[["ham"]] = "spam"     # Try using a list as a key
    ....snip....
    TypeError: unhashable type

But you were correct in the examples which followed though :)


> all functions take the references of the objects passed to them and not a
> copy of the object itself.

An interesting note, the parameter passing mechanism is very similar to tuple
assignment. This is also how keyword args work, eg. the Tcl interface Tkinter
depends heavily on this feature -
eg. button = Tkinter.Button(text = "Quit", command = sys.exit)
Sorry that I can't point to some literature that explains this in depth.

>   def hw (strn):
>      print hw + "!" , "say Hello World!"
> 
Oops... typo, that should have read -
    def hw(strn):
        print strn + "!", "say Hello World!"
              ^^^^
A slightly unrelated comment - since whitespace is an important part of the
python language it is esp. important to use it correctly. Have a look at
http://www.python.org/doc/essays/styleguide.html for python coding style.


I also have some comments about the voting business... but since my
involvement is little, I don't think I have much say. Still, I prefer
solution 5, running the slashdot style "web" subscription. Seems to me that in
the long run this would be the ideal solution. Ofcourse, machine and security,
restrictions may not allow this at the present... but it's probably a good
idea to keep this in sight on the long range radar.

Btw, I'm comming home to India this week - I would be in Madras for a short
time only :( Anyway I'll be armed with a good list of sw to give away (latest
and greatest debian/redhat/freebsd & win32 python, cygnus win32 tools etc). If
needed, anyone is most welcome to borrow them from me (for as long as you
want). If you are still doubtfull, there are no commercial intentions behind
this, I'm offering it all for free.
Or if there is any other help that the chennai linux community requires from
Australia, do not hesitate to let me know :) Pls, email me directly as I may
have to (temporarily) unsubscribe from this mailing list.

Keep up the great work guys!

- Raja
---
Visit our home page at: www.chennailug.org
Send e-mail to 'ilugc-request@xxxxxxxxxxxxxxxxxx' with 'unsubscribe' 
in either the subject or the body to unsubscribe from this list.