"Kent Johnson" <ken...@tds.net> wrote
for d in os.listdir():
  if MyString(d).upper().beginswith(....):

But that won't work, the result of calling upper() will be a normal
str, not a MyString.

Ah yes. Immutability of strings strikes again. upper() returns a new string, I forgot about that. pity.

You can do

if MyString(d.upper()).beginswith(...)

But that loses a lot in elegance and is hardly better than using a fiunction.

Alan G

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to