[Patches] [ python-Patches-1528167 ] Support for case-insensitivity in string.Template

SourceForge.net noreply at sourceforge.net
Tue Aug 1 15:24:42 CEST 2006


Patches item #1528167, was opened at 2006-07-25 01:15
Message generated for change (Comment added) made by bwarsaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1528167&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Submitted By: Chad Whitacre (whit537)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Support for case-insensitivity in string.Template

Initial Comment:
Python's $-style templating is wired for optional
case-insensitivity under the hood, but doesn't expose
this via the API. The attached patch (against trunk/
r50813) adds a new optional argument to turn this
behavior on, and includes doc and tests.

----------------------------------------------------------------------

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2006-08-01 09:24

Message:
Logged In: YES 
user_id=12800

Yes, that would be much more acceptable!

----------------------------------------------------------------------

Comment By: Chad Whitacre (whit537)
Date: 2006-08-01 09:21

Message:
Logged In: YES 
user_id=340931

Thanks for your responses, all.

> Is there a reason why the existing mechanisms are 
> insufficient?

The problem is kws: you can't customize it from the outside
like you can the mapping argument. If we replaced _multimap
with mapping.update(kws), then we'd have our hook and I
think I'd be satisfied.

Would you be any more psyched about that patch? :)

----------------------------------------------------------------------

Comment By: Barry A. Warsaw (bwarsaw)
Date: 2006-07-31 23:56

Message:
Logged In: YES 
user_id=12800

I'm not psyched about the patch.  First, I've always thought
that case insensitivity ought to be handled by the mapping
from which the keys are being extracted and by setting the
idpattern.  Second, I definitely don't like adding the
case_sensitive argument to substitute() and
safe_substitute(). Because it lives in the same namespace as
kws it makes for icky rules on resolving any conflicts.

Is there a reason why the existing mechanisms are insufficient?

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2006-07-31 19:12

Message:
Logged In: YES 
user_id=80475

Barry, is this something you want or is it at odds with the
notion of "simplified templating"?

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2006-07-31 18:32

Message:
Logged In: YES 
user_id=849994

The patch looks very thorough and complete, I will try to
look into it after 2.5 is out.

Don't let that prevent you reviewing 5 patches, Chad ;-)

----------------------------------------------------------------------

Comment By: Chad Whitacre (whit537)
Date: 2006-07-31 14:35

Message:
Logged In: YES 
user_id=340931

(BTW, new patch is against trunk/ r51008)

----------------------------------------------------------------------

Comment By: Chad Whitacre (whit537)
Date: 2006-07-31 14:13

Message:
Logged In: YES 
user_id=340931

I've replaced the patch with one that polishes off a few
bugs and ambiguities, with accompanying tests and doc.

----------------------------------------------------------------------

Comment By: Chad Whitacre (whit537)
Date: 2006-07-26 15:50

Message:
Logged In: YES 
user_id=340931

Warning: I've discovered that I introduced a bug. New patch
forthcoming.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1528167&group_id=5470


More information about the Patches mailing list