# HG changeset patch # User paulb@localhost.localdomain # Date 1185666704 -7200 # Node ID 41d635a383c7129b2a878e85f501ebbaea76db7c # Parent 589fc634882e354da12861af36d3d2abe6fc8bec Added notes about classes and instances. diff -r 589fc634882e -r 41d635a383c7 docs/architecture.txt --- a/docs/architecture.txt Sat Jul 28 21:08:44 2007 +0200 +++ b/docs/architecture.txt Sun Jul 29 01:51:44 2007 +0200 @@ -76,6 +76,28 @@ [1] http://java.sun.com/docs/white/delegates.html +Classes, Attributes and Instantiation Behaviours +------------------------------------------------ + +A superficial view of the relationship between classes and instances in Python +is that instances of a particular class can mostly be treated as equivalent - +the class defines the behaviour of them all, and the kind of data stored (or +rather referenced by each of them) is likely to be mostly identical. However, +we know that some classes encourage a more heterogeneous usage of their +instances: lists, for example, often contain a variety of different kinds of +data, and it is often accurate to note that within a given program the +contents of list objects may vary substantially. Consequently, whilst a simple +view of instances and their equivalence may hold for some classes, others +require a more sophisticated view of instances created from them. + +The simplest class behaviour states that only one kind of instance exists for +each class; a more sophisticated behaviour states that potentially many kinds +of instances exist for a class. In a running program, all instances are +distinct and there may be no limit (other than that of physical resources and +of time) to how many there may be in the lifetime of a program. However, when +modelling the behaviour of a program, it is necessary to be more conservative +when attempting to identify such instance types. + Instance Filtering ==================