no string.downer() ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ssecorp

    no string.downer() ?

    if i want to make a string downcase, is upper().swapcas e() the onyl
    choice? there is no downer() ?
  • Guilherme Polo

    #2
    Re: no string.downer() ?

    On Wed, Aug 27, 2008 at 11:16 AM, ssecorp <circularfunc@g mail.comwrote:
    if i want to make a string downcase, is upper().swapcas e() the onyl
    choice? there is no downer() ?
    There is no "downer" indeed, instead it is named "lower".


    --
    -- Guilherme H. Polo Goncalves

    Comment

    • Jon Clements

      #3
      Re: no string.downer() ?

      On Aug 27, 3:16 pm, ssecorp <circularf...@g mail.comwrote:
      if i want to make a string downcase, is upper().swapcas e() 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.

      Comment

      • Fredrik Lundh

        #4
        Re: no string.downer() ?

        ssecorp wrote:
        if i want to make a string downcase, is upper().swapcas e() the onyl
        choice?
        what you're asking for is usually called "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>

        Comment

        • Terry Reedy

          #5
          Re: no string.downer() ?



          ssecorp wrote:
          if i want to make a string downcase, is upper().swapcas e() 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_fie ld_name_split', '_formatter_par ser', '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

          Comment

          • John Machin

            #6
            Re: no string.downer() ?

            On Aug 28, 9:53 am, Terry Reedy <tjre...@udel.e duwrote:
            ssecorp wrote:
            if i want to make a string downcase, is upper().swapcas e() 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.

            Comment

            • Timothy Grant

              #7
              Re: no string.downer() ?

              On Wed, Aug 27, 2008 at 5:28 PM, John Machin <sjmachin@lexic on.netwrote:
              On Aug 28, 9:53 am, Terry Reedy <tjre...@udel.e duwrote:
              >ssecorp wrote:
              if i want to make a string downcase, is upper().swapcas e() 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.
              >
              --

              >
              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]

              Comment

              • Asun Friere

                #8
                Re: no string.downer() ?

                On Aug 28, 10:28 am, John Machin <sjmac...@lexic on.netwrote:
                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.'

                Comment

                • John Machin

                  #9
                  Re: no string.downer() ?

                  On Aug 28, 11:25 am, Asun Friere <afri...@yahoo. co.ukwrote:
                  On Aug 28, 10:28 am, John Machin <sjmac...@lexic on.netwrote:
                  >
                  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().swapc ase() does the job, without having read
                  the swapcase docs where it is screamingly obvious that lowercase is
                  the antonym of uppercase???

                  Comment

                  • Grant Edwards

                    #10
                    Re: no string.downer() ?

                    On 2008-08-28, Timothy Grant <timothy.grant@ gmail.comwrote:
                    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

                    Comment

                    • Terry Reedy

                      #11
                      Re: no string.downer() ?



                      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

                      Comment

                      • Asun Friere

                        #12
                        Re: no string.downer() ?

                        On Aug 28, 11:34 am, John Machin <sjmac...@lexic on.netwrote:
                        On Aug 28, 11:25 am, Asun Friere <afri...@yahoo. co.ukwrote:
                        >
                        On Aug 28, 10:28 am, John Machin <sjmac...@lexic on.netwrote:
                        >
                        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().swapc ase() 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.

                        Comment

                        • Fredrik Lundh

                          #13
                          Re: no string.downer() ?

                          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>

                          Comment

                          • Tobiah

                            #14
                            Re: no string.downer() ?

                            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 **

                            Comment

                            • Fredrik Lundh

                              #15
                              Re: no string.downer() ?

                              Tobiah wrote:
                              >Never ascribe to humour that which can be adequately explained by
                              >increadible stupidity!
                              >
                              I love the irony.
                              Muphry's law.

                              </F>

                              Comment

                              Working...