On Tue, May 24, 2005 at 01:16:21PM -0400, Michael P. Reilly wrote:
> On 5/24/05, William O'Higgins <[EMAIL PROTECTED]> wrote:
>
> As the subject says, I was looking for an analog to chomp, and found
> strip() and friends (rstrip() and lstrip()), but they are deprecated.
> I'm happy to forgo their use in preparation for 3.0 (I figure we're
> going to live the rest of our lives in the future, we might as well be
> ready) but I need an alternative syntax today, and I haven't been able
> to see what I should use instead. Anyone have a suggestion?
>
> William,
>
> These were all changed to object-oriented syntax on the string value
> itself.
> Old way string.strip(' abcd ')
> New way ' abcd '.strip()
>
> It may take a little getting used to, but the functionality is the same
> and it is more in keeping with how we should be treating the built-in data
> values as objects just like we do with class instances.Perfect, and it make a lot of sense. Heck, I find this much more readable in terms of nested calls. Thank you. -- yours, William
signature.asc
Description: Digital signature
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
