E&S CVS Commit: PEAK - Implemented 'NOT_GIVEN' -> 'AttributeError' semantics for default values.

pje at eby-sarna.com pje at eby-sarna.com
Tue Feb 4 13:16:00 EST 2003

Module Name:	PEAK
Committed By:	pje
Date:		Tue Feb  4 18:15:49 UTC 2003

Modified Files:
	PEAK/src/peak/metamodels/uml: MetaModel.py
	PEAK/src/peak/model: structural.py

Log Message:
Implemented 'NOT_GIVEN' -> 'AttributeError' semantics for default values.
'model.Field' and 'model.Reference' now both use the feature's
'defaultValue' for a "get" when no value is present, and if the value is
'NOT_GIVEN', an 'AttributeError' is raised, to simulate normal Python
behavior for a missing attribute.  If you want a default value for a field
or reference, you must now explicitly supply it.  In particular, note that
References used to supply 'None' as a default value, and now you must
specifically request that behavior by adding 'defaultValue = None' to the
feature specification.

To view diffs of this commit, you can use the following URL(s):

To generate a diff of this commit:
cvs rdiff -r1.14 -r1.15 PEAK/src/peak/metamodels/uml/MetaModel.py
cvs rdiff -r1.7 -r1.8 PEAK/src/peak/model/structural.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

More information about the source-changes mailing list