Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

no string.downer() ?

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


circularfunc at gmail

Aug 27, 2008, 7:16 AM

Post #1 of 16 (98 views)
Permalink
no string.downer() ?

if i want to make a string downcase, is upper().swapcase() the onyl
choice? there is no downer() ?
--
http://mail.python.org/mailman/listinfo/python-list


ggpolo at gmail

Aug 27, 2008, 7:24 AM

Post #2 of 16 (93 views)
Permalink
Re: no string.downer() ? [In reply to]

On Wed, Aug 27, 2008 at 11:16 AM, ssecorp <circularfunc[at]gmail.com> wrote:
> if i want to make a string downcase, is upper().swapcase() the onyl
> choice? there is no downer() ?

There is no "downer" indeed, instead it is named "lower".

> --
> http://mail.python.org/mailman/listinfo/python-list
>



--
-- Guilherme H. Polo Goncalves
--
http://mail.python.org/mailman/listinfo/python-list


joncle at googlemail

Aug 27, 2008, 7:25 AM

Post #3 of 16 (93 views)
Permalink
Re: no string.downer() ? [In reply to]

On Aug 27, 3:16 pm, ssecorp <circularf...@gmail.com> wrote:
> if i want to make a string downcase, is upper().swapcase() the onyl
> choice? there is no downer() ?

lower()

You need to be careful ssecorp, you might be at risk of being
considered a troll -- always give the benefit though (probably why I'm
broke!)

Jon.
--
http://mail.python.org/mailman/listinfo/python-list


fredrik at pythonware

Aug 27, 2008, 10:17 AM

Post #4 of 16 (91 views)
Permalink
Re: no string.downer() ? [In reply to]

ssecorp wrote:

> if i want to make a string downcase, is upper().swapcase() the onyl
> choice?

what you're asking for is usually called "lower case":

http://en.wikipedia.org/wiki/Lower_case

and the corresponding string method method is called "lower":

>>> "HELLO".lower()
'hello'

> there is no downer() ?

no, that would be no fun at all.

</F>

--
http://mail.python.org/mailman/listinfo/python-list


tjreedy at udel

Aug 27, 2008, 4:53 PM

Post #5 of 16 (76 views)
Permalink
Re: no string.downer() ? [In reply to]

ssecorp wrote:
> if i want to make a string downcase, is upper().swapcase() the onyl
> choice? there is no downer() ?

If you are not being a troll, there are two easy ways to answer such a
question.

>>> dir('')
[.'__add__', '__class__', '__contains__', '__delattr__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
'__getnewargs__', '__gt__', '__hash__', '__init__', '__iter__',
'__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__',
'__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__',
'__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'_formatter_field_name_split', '_formatter_parser', 'capitalize',
'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format',
'index', 'isalnum', 'isalpha', 'isdecimal', 'isdigit', 'isidentifier',
'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper',
'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace',
'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split',
'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate',
'upper', 'zfill']

followed by
>>> help(''.lower)
Help on built-in function lower:
lower(...)
S.lower() -> str
Return a copy of the string S converted to lowercase.

OR
>>> help(str)
which gives screenfuls of info including the above.

tjr

--
http://mail.python.org/mailman/listinfo/python-list


sjmachin at lexicon

Aug 27, 2008, 5:28 PM

Post #6 of 16 (80 views)
Permalink
Re: no string.downer() ? [In reply to]

On Aug 28, 9:53 am, Terry Reedy <tjre...@udel.edu> wrote:
> ssecorp wrote:
> > if i want to make a string downcase, is upper().swapcase() the onyl
> > choice? there is no downer() ?
>
> If you are not being a troll, there are two easy ways to answer such a
> question.
>

[snip]

Reading the manual backwards as the OP seems to have done ("upper",
"swapcase", ...) one finds:

"""
swapcase( )

Return a copy of the string with uppercase characters converted to
lowercase and vice versa.
"""

Out of the possible diagnoses (trolling, incredible stupidity, feeble
joke attempt) of the cause of the ensuing upper/downer question, I'm
going with the third.

--
http://mail.python.org/mailman/listinfo/python-list


timothy.grant at gmail

Aug 27, 2008, 6:18 PM

Post #7 of 16 (76 views)
Permalink
Re: no string.downer() ? [In reply to]

On Wed, Aug 27, 2008 at 5:28 PM, John Machin <sjmachin[at]lexicon.net> wrote:
> On Aug 28, 9:53 am, Terry Reedy <tjre...@udel.edu> wrote:
>> ssecorp wrote:
>> > if i want to make a string downcase, is upper().swapcase() the onyl
>> > choice? there is no downer() ?
>>
>> If you are not being a troll, there are two easy ways to answer such a
>> question.
>>
>
> [snip]
>
> Reading the manual backwards as the OP seems to have done ("upper",
> "swapcase", ...) one finds:
>
> """
> swapcase( )
>
> Return a copy of the string with uppercase characters converted to
> lowercase and vice versa.
> """
>
> Out of the possible diagnoses (trolling, incredible stupidity, feeble
> joke attempt) of the cause of the ensuing upper/downer question, I'm
> going with the third.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I was going to go with not particularly strong in English. To someone
not familiar with English, downer() could very well be the obvious
converse of upper().

I'm usually quick to think "troll" but this time I didn't. Maybe I'm just naive.

--
Stand Fast,
tjg. [Timothy Grant]
--
http://mail.python.org/mailman/listinfo/python-list


afriere at yahoo

Aug 27, 2008, 6:25 PM

Post #8 of 16 (75 views)
Permalink
Re: no string.downer() ? [In reply to]

On Aug 28, 10:28 am, John Machin <sjmac...@lexicon.net> wrote:

> Out of the possible diagnoses (trolling, incredible stupidity, feeble
> joke attempt) of the cause of the ensuing upper/downer question, I'm
> going with the third.

Never ascribe to humour that which can be adequately explained by
increadible stupidity! On the other hand given up/down vs. high/low,
upper/downer might appear logical to someone who doesn't know that
"downcase" is called 'lowercase.'
--
http://mail.python.org/mailman/listinfo/python-list


sjmachin at lexicon

Aug 27, 2008, 6:34 PM

Post #9 of 16 (75 views)
Permalink
Re: no string.downer() ? [In reply to]

On Aug 28, 11:25 am, Asun Friere <afri...@yahoo.co.uk> wrote:
> On Aug 28, 10:28 am, John Machin <sjmac...@lexicon.net> wrote:
>
> > Out of the possible diagnoses (trolling, incredible stupidity, feeble
> > joke attempt) of the cause of the ensuing upper/downer question, I'm
> > going with the third.
>
> Never ascribe to humour that which can be adequately explained by
> increadible stupidity! On the other hand given up/down vs. high/low,
> upper/downer might appear logical to someone who doesn't know that
> "downcase" is called 'lowercase.'

He knows that s.upper().swapcase() does the job, without having read
the swapcase docs where it is screamingly obvious that lowercase is
the antonym of uppercase???
--
http://mail.python.org/mailman/listinfo/python-list


grante at visi

Aug 27, 2008, 6:42 PM

Post #10 of 16 (76 views)
Permalink
Re: no string.downer() ? [In reply to]

On 2008-08-28, Timothy Grant <timothy.grant[at]gmail.com> wrote:

> I was going to go with not particularly strong in English. To
> someone not familiar with English, downer() could very well be
> the obvious converse of upper().

Not only does one need to be familiar with English, but one
also has to be familiar with somewhat obscure terms dervied
from ancient typsetting practices. In other contexts, downer is
definitely the obvious converse of upper.

--
Grant
--
http://mail.python.org/mailman/listinfo/python-list


tjreedy at udel

Aug 27, 2008, 8:20 PM

Post #11 of 16 (70 views)
Permalink
Re: no string.downer() ? [In reply to]

Grant Edwards wrote:

> Not only does one need to be familiar with English, but one
> also has to be familiar with somewhat obscure terms dervied
> from ancient typsetting practices. In other contexts, downer is
> definitely the obvious converse of upper.

Nonsense. Down is the opposite of up, but lower is the opposite of upper
as an adjective: upper level, lower level; upper class, lower class,
upper case, lower case, upper rank, lower rank, upper lip, lower lip;
upper arm, lower arm; upper leg, lower leg; upper house, lower house (of
a legislature); upper layer, lower layer; Upper Paleolithic, Lower
Paleolithic (and so on for other geologic periods; upper Manhattan,
lower Manhattan (and so on for other persiods); upper Mississippi, lower
Mississippi (and so on for other rivers).

Downer, a noun, opposes upper only when upper is used as a noun for
depressing versus stimulating things, most often with reference to drugs
It is also used to refer to animals that are so sick that they cannot
stand up or otherwise need to be 'put down' (permanently). But healthy
animals are not called uppers that I know of.

tjr

--
http://mail.python.org/mailman/listinfo/python-list


afriere at yahoo

Aug 27, 2008, 8:23 PM

Post #12 of 16 (70 views)
Permalink
Re: no string.downer() ? [In reply to]

On Aug 28, 11:34 am, John Machin <sjmac...@lexicon.net> wrote:
> On Aug 28, 11:25 am, Asun Friere <afri...@yahoo.co.uk> wrote:
>
> > On Aug 28, 10:28 am, John Machin <sjmac...@lexicon.net> wrote:
>
> > > Out of the possible diagnoses (trolling, incredible stupidity, feeble
> > > joke attempt) of the cause of the ensuing upper/downer question, I'm
> > > going with the third.
>
> > Never ascribe to humour that which can be adequately explained by
> > increadible stupidity! On the other hand given up/down vs. high/low,
> > upper/downer might appear logical to someone who doesn't know that
> > "downcase" is called 'lowercase.'
>
> He knows that s.upper().swapcase() does the job, without having read
> the swapcase docs where it is screamingly obvious that lowercase is
> the antonym of uppercase???

:shrugs, Why not? One does a dir() on one's string and sees 'upper'
and 'swapcase' (but fails to see or understand 'lower'), and takes an
educated guess at what they do. In any case that was only a caveat to
the point I was trying to make, namely that you were probably being
too generous towards said poster.
--
http://mail.python.org/mailman/listinfo/python-list


fredrik at pythonware

Aug 27, 2008, 10:52 PM

Post #13 of 16 (70 views)
Permalink
Re: no string.downer() ? [In reply to]

Asun Friere wrote:

> Never ascribe to humour that which can be adequately explained by
> increadible stupidity! On the other hand given up/down vs. high/low,
> upper/downer might appear logical to someone who doesn't know that
> "downcase" is called 'lowercase.'

prior exposure to Ruby might explain this, right? (iirc, they use
"upcase" and "downcase").

</F>

--
http://mail.python.org/mailman/listinfo/python-list


toby at tobiah

Aug 28, 2008, 11:25 AM

Post #14 of 16 (66 views)
Permalink
Re: no string.downer() ? [In reply to]

> Never ascribe to humour that which can be adequately explained by
> increadible stupidity!

I love the irony. Don't feel bad. I recently corrected
someone's 'grammer' with a similar tone.
** Posted from http://www.teranews.com **
--
http://mail.python.org/mailman/listinfo/python-list


fredrik at pythonware

Aug 28, 2008, 11:38 AM

Post #15 of 16 (67 views)
Permalink
Re: no string.downer() ? [In reply to]

Tobiah wrote:

>> Never ascribe to humour that which can be adequately explained by
>> increadible stupidity!
>
> I love the irony.

Muphry's law.

</F>

--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Aug 29, 2008, 5:04 PM

Post #16 of 16 (56 views)
Permalink
Re: no string.downer() ? [In reply to]

En Thu, 28 Aug 2008 02:52:42 -0300, Fredrik Lundh <fredrik[at]pythonware.com>
escribi�:

> Asun Friere wrote:
>
>> Never ascribe to humour that which can be adequately explained by
>> increadible stupidity! On the other hand given up/down vs. high/low,
>> upper/downer might appear logical to someone who doesn't know that
>> "downcase" is called 'lowercase.'
>
> prior exposure to Ruby might explain this, right? (iirc, they use
> "upcase" and "downcase").

Yes. And Common Lisp has used the same very names for a longer time than
Python itself existed, so I don't agree with many comments on this thread.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.