Changes between Version 1 and Version 2 of Ticket #10963, comment 392


Ignore:
Timestamp:
01/15/14 16:59:16 (6 years ago)
Author:
tscrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10963, comment 392

    v1 v2  
    99{{{#!python
    1010# In Category
    11     def with_axiom(axioms):
    12         self._axioms.add_axioms(axioms)
     11    def with_axiom(axiom):
     12        new_axioms = copy(self._axioms).with_axioms([axiom])
     13        return ObjectWithAxioms(new_axioms)
    1314
    1415# The container class
     
    2627        return self.without_axioms([axiom])
    2728
    28     def add_axioms(self, axioms):
     29    def with_axioms(self, axioms):
    2930        # After making sure each axiom is valid
    3031        self._axioms = self._axioms.union(axioms)
     
    4647}}}
    4748
    48 Edit - I changed this to use sets.
     49Although we might want to change the above behavior to act like an immutable object.