problem with str object

17 views
Skip to first unread message

rudnik

unread,
Aug 19, 2011, 7:37:11 AM8/19/11
to shedskin-discuss
I compile this code (t.py):

text=" asdf "
print(text)
tmp=" "
tmp=str.rstrip(text.lstrip())
print(tmp)

I get error:
t.cpp: In function ‘void __t__::__init()’:
t.cpp:22: error: expected primary-expression before ‘->’ token

Additionally, if I delete line with tmp=" ", I get: *WARNING* t.py:5:
variable 'tmp' has no type

Mark Dufour

unread,
Aug 20, 2011, 4:58:31 AM8/20/11
to shedskin...@googlegroups.com
hiya,

thanks for reporting. this approach of calling methods currently doesn't work. I will have a look at improving this (or else produce a warning).. for now, I'm wondering a bit why you're not using the following (much more common approach):

tmp = text.lstrip().rstrip()

or even shorter:

tmp = text.strip()

thanks again,
mark.
--
http://www.youtube.com/watch?v=E6LsfnBmdnk

Reply all
Reply to author
Forward
0 new messages