Flexable Collating (feedback please)
rrr at ronadam.com
Thu Oct 19 17:06:49 CEST 2006
Gabriel Genellina wrote:
> At Wednesday 18/10/2006 21:36, Ron Adam wrote:
>> Maybe changing the CAPS_FIRST to REVERSE_CAPS_ORDER would do?
> At least it's a more accurate name.
> There is an indirect way: test locale.strcoll("A","a") and see how they
> get sorted. Then define options CAPS_FIRST, LOWER_FIRST accordingly. But
> maybe it's too much trouble...
I should of thought of that simple test. Thanks. :-)
That would work, and it's really not that much trouble. The actual test can be
done during importing. Maybe determining other useful values could be done at
that time as well.
>> > You should try to make this part a bit more generic. If you are
>> > concerned about locales, do not use "comma" explicitely. In other
>> > countries 10*100=1.000 - and 1,234 is a fraction between 1 and 2.
>> See the most recent version of this I posted. It is a bit more generic.
>> Maybe a 'comma_is_decimal' option?
> I'd prefer to use the 'decimal_point' and 'thousands_sep' from the
> locale information. That would be more coherent with the locale usage
> along your module.
Yes, it looks like I'll need to do this.
>> The term I've seen before is called natural ordering, but that is more
>> and can include date, roman numerals, as well as other type.
> Sometimes that's the hard part, finding a name which is concise,
> descriptive, and accurately reflects what the code does. A good name
> should make obvious what it is used for (being these option names, or
> class names, or method names...) but in this case it may be difficult to
> find a good one. So users will have to read the documentation (a good
> thing, anyway!)
I plan on making the doc strings a bit more informative so that help(collate)
will give meaningful information on it's options.
More information about the Python-list