[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] QString
From: Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date: 2000-04-02 10:20:19
[Download RAW message or body]
Pete Ware wrote:
>
> What's the philosophy behind integrating qt.QString with the rest of
> python. For example, should one be able to use len()? Should I
> instead use len (repr (x))?
>
> x = qt.QString ('abc')
> x
> abc
> len (x)
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> AttributeError: __len__
Originally I had intended to map C++ operators to Python special
attributes where sensible. This is how QString generates a __repr__
function. I've since decided that this is too restrictive so I will just
allow any of the __xxx___ attributes to be implemented in handwritten
C++ code. In which case it would make sense to implement __len__ for
QString.
Just haven't got around to it yet.
Phil
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic