Re: Are you using the Unspecified class

"R. Tyler Ballance" <[email protected]> Sat, 27 Jun 2009 22:45:01 -0700
Newsgroups gmane.comp.python.cheetah
Message-ID <20090628054501.GC12693@starfruit>
Hey Tavis, reply inline..

On Sat, 27 Jun 2009, Tavis Rudd wrote:

>
>
> On Sat, 27 Jun 2009, R. Tyler Ballance wrote:
>
>> There is a Cheetah internal class called "Unspecified" that I'd like to
>> prune from the tree and replace with None, but I'd like to double check
>> that you folks aren't using it for anything outside of Cheetah (it seems
>> to be a relic in the Cheetah internals that need not exist).
>
> Tyler,
> There is a subtle, but important difference between using Unspecified and 
> None for the optional args to Template.compile.  'Unspecified' is more  
> than just an weird alternate name for None.
>
> Have a look at the valOrDefault func used in Template.compile(). If the 
> argument is 'Unspecified' it falls back to the default values defined as 
> _CHEETAH_xxx class attributes in the Template class, or possibly in a 
> subclass of Template which provides custom defaults (a usage pattern I 
> use frequently to avoid repeating stuff throughout my client code).  For 
> some arguments/attributes None is a legal value; cacheStore and 
> compilerSettings for example.   If you replace Unspecified with None, it 
> will become impossible for subclasses to provide their own defaults as 
> class attributes as the default compilerSettings=None (etc.) in 
> Template.compile() would always trump them.  The same logic applies to  
> arguments/attributes that are boolean.
>
> Please leave Unspecified where it is.  It serves a real purpose and  
> nothing is gained by removing it.  However, we should probably get rid of 
> the redefined Unspecified I just noticed in Tests/SyntaxAndOutput.py.

Interesting, I suppose I'm far more unfamiliar with how you and likely
others are using those settings that are being passed through. 

I'll revert my commits and prune that dupe in the test.

-R. Tyler Ballance
Slide, Inc.

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

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkpHA10ACgkQFCbH3D9R4W9k4wCeP6LMVTEzO5ogPVqs3zoc1VH5
qiQAoJG+rUEE0NWlKCVTN8bkjJUYOc/W
=e4Hf
-----END PGP SIGNATURE-----