[Zope3-Users] Set & List constraints

Tim Cook timothywayne.cook at gmail.com
Thu Jul 10 15:56:23 EDT 2008


On Thu, 2008-07-10 at 16:59 +0200, Markus Kemmerling wrote:

> I would rather say:
> 
> value=List(
>    title=u"Value",
>    value_type=Object(schema=IMyClass)
> )

Can you elaborate why?


> 
> Anyhow, such a constraint is of limited use only, since it does not  
> prevent you from adding any object you like to the list *after* it  
> got assigned to the 'value' attribute.

Okay, but that would be badly behaved code; correct?

In my implementation I am creating instances and committing them to a
ZODB repository.   My thoughts were that copies of those instances would
continue to constrain the types allowed in that attribute.  Is that
incorrect?

Cheers,
Tim




-- 
**************************************************************************
Join the OSHIP project.  It is the standards based, open source
healthcare application platform in Python.
Home page: https://launchpad.net/oship/ 
Wiki: http://www.openehr.org/wiki/display/dev/Python+developer%27s+page 
**************************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080710/24fcd7e5/attachment.bin


More information about the Zope3-users mailing list