no string.downer() ?

This is a discussion on no string.downer() ? within the Python forums in Programming Languages category; if i want to make a string downcase, is upper().swapcase() the onyl choice? there is no downer() ?...

Go Back   Application Development Forum > Programming Languages > Python

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 10:16 AM
ssecorp
Guest
 
Default no string.downer() ?

if i want to make a string downcase, is upper().swapcase() the onyl
choice? there is no downer() ?
Reply With Quote
  #2  
Old 08-27-2008, 10:24 AM
Guilherme Polo
Guest
 
Default Re: no string.downer() ?

On Wed, Aug 27, 2008 at 11:16 AM, ssecorp <circularfunc@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
Reply With Quote
  #3  
Old 08-27-2008, 10:25 AM
Jon Clements
Guest
 
Default Re: no string.downer() ?

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.
Reply With Quote
  #4  
Old 08-27-2008, 01:17 PM
Fredrik Lundh
Guest
 
Default Re: no string.downer() ?

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>

Reply With Quote
  #5  
Old 08-27-2008, 07:53 PM
Terry Reedy
Guest
 
Default Re: no string.downer() ?



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

Reply With Quote
  #6  
Old 08-27-2008, 08:28 PM
John Machin
Guest
 
Default Re: no string.downer() ?

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.

Reply With Quote
  #7  
Old 08-27-2008, 09:18 PM
Timothy Grant
Guest
 
Default Re: no string.downer() ?

On Wed, Aug 27, 2008 at 5:28 PM, John Machin <sjmachin@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]
Reply With Quote
  #8  
Old 08-27-2008, 09:25 PM
Asun Friere
Guest
 
Default Re: no string.downer() ?

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.'
Reply With Quote
  #9  
Old 08-27-2008, 09:34 PM
John Machin
Guest
 
Default Re: no string.downer() ?

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???
Reply With Quote
  #10  
Old 08-27-2008, 09:42 PM
Grant Edwards
Guest
 
Default Re: no string.downer() ?

On 2008-08-28, Timothy Grant <timothy.grant@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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:57 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.