Re: Confused by Method(function) of a module and method of a class/instance

2006-03-07 Thread Rene Pijlman
Sullivan WxPyQtKinter:
>Why do the three expression yield the same result "abc"?

Because all three converted "ABC" to lowercase, as per your request.

-- 
René Pijlman
-- 
http://mail.python.org/mailman/listinfo/python-list


Confused by Method(function) of a module and method of a class/instance

2006-03-06 Thread Sullivan WxPyQtKinter
In python, these expression seems yields the same result:

inputstring='ABC'

print inputstring.lower()
print lower(inputstring)
print string.lower(inputstring)

result:
abc
abc
abc

Question:
Is the method lower() just a method for the inputstring instance( an
instrance object of a string class object), or a function in the module
string.py or a build-in function or sth else?

Why do the three expression yield the same result "abc"?

-- 
http://mail.python.org/mailman/listinfo/python-list