str attributes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bearophileHUGS@lycos.com

    #1

    str attributes

    I don't know if this was already discussed. I think that maybe Python
    2.5 can add some attributes to the str object:
    [color=blue][color=green][color=darkred]
    >>> str.ascii_lette rs[/color][/color][/color]
    'abcdefghijklmn opqrstuvwxyzABC DEFGHIJKLMNOPQR STUVWXYZ'[color=blue][color=green][color=darkred]
    >>> str.hexdigits[/color][/color][/color]
    '0123456789abcd efABCDEF'
    etc.

    And maybe this too:
    str.maketrans(f rom, to)

    (I think string.capwords () isn't important enough to be added too).

    Bye,
    bearophile

  • Bengt Richter

    #2
    Re: str attributes

    On 6 Dec 2005 16:52:57 -0800, bearophileHUGS@ lycos.com wrote:
    [color=blue]
    >I don't know if this was already discussed. I think that maybe Python
    >2.5 can add some attributes to the str object:
    >[color=green][color=darkred]
    >>>> str.ascii_lette rs[/color][/color]
    >'abcdefghijklm nopqrstuvwxyzAB CDEFGHIJKLMNOPQ RSTUVWXYZ'[color=green][color=darkred]
    >>>> str.hexdigits[/color][/color]
    >'0123456789abc defABCDEF'
    >etc.
    >
    >And maybe this too:
    >str.maketrans( from, to)
    >
    >(I think string.capwords () isn't important enough to be added too).
    >[/color]
    I agree. I hope good stuff from string module gets moved
    It has been discussed, of course ;-)

    go to http://groups.google.com and put

    "string module" "str" group:comp.lang .python

    in the seach slot.


    Regards,
    Bengt Richter

    Comment

    Working...