Distributions, RE-verb and the like

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Tue Jan 3 07:34:20 EST 2006


Paul McGuire wrote:

> I don't find 'Interval' to be very easy on the eyes.  In this case, I
> stole^H^H^H^H^H borrowed the re form of "[A-Za-z0-9]", providing a
> method named srange ("s" is for "string") such that srange("a-fA-F")
> would return the string "abcdefABCDEF".

Thank you for your answers Paul. Just a note: I have called it
interval-something (like cinterval or Interval) instead of
range-something because it returns a closed interval (all letters
inclusive of both endpoints), to show its difference from the Python
range that returns a right open interval. Calling a srange("a","z") in
Python lets me think that it generates the ["a",...,"y"] range.

Bye,
bearophile




More information about the Python-list mailing list