str.isspace()

George Sakkis george.sakkis at gmail.com
Sun Sep 3 20:08:28 CEST 2006


Jean-Paul Calderone wrote:

> On 3 Sep 2006 09:20:49 -0700, bearophilehugs at lycos.com wrote:
> >Are you using the str.isspace() method? I don't use it, so if most
> >people don't uses it, then it may be removed from Py 3.0.
> >
> >I usually need to know if a string contains some non-spaces (not space
> >class chars). To do it I use something like:
> >
> >if aline.strip(): ...
> >
> >If you really need str.isspace() you may use (but so far I have never
> >had to do this):
> >
> >if txt and not txt.strip(): ...
> >
> >Bye,
> >bearophile
> >
>
> Great idea.
>
> By the way, are you using division?  I don't use it, so if most people
> don't use it, then it may be removed from Py 3.0.
>
> If you really need division, you may use:
> 
>   x * (y ** -1)
> 
> Bye,
> Jean-Paul

LOL... well said.




More information about the Python-list mailing list