[reportlab-users] pycanvas string problems

Jerome Alet reportlab-users@reportlab.com
Sun, 20 Oct 2002 17:47:28 +0200


On Sun, Oct 20, 2002 at 11:42:32AM +0100, Robin Becker wrote:
> Yes I tried some expriments and even in 2.2 the coercion doesn't seem to happen as expected.
> This fails and I can't understand exactly how it differs from what you're
> doing in pycanvas.

I don't know.

The modified version of the code you posted in your precedent message works
in 2.2. So I suppose doing what I suggested in my previous message is the
right thing to do to make it always work.

it seems that all versions of python behave somewhat differently.

modified version of your code :

---
print sys.version
iam=Bonkers()
fnt=str(iam.fontName)
print fnt,
print string.lower(fnt)
---

NB : the str() call above solves the problem.

and we can't call str() "internally" when accessing every attribute, since
some are strings, others are numeric...

bye,

Jerome Alet