OpenQuizz
Une application de gestion des contenus pédagogiques
|
Data Structures | |
class | Evolver |
Public Member Functions | |
def | __new__ (cls, initial=()) |
def | __repr__ (self) |
def | __str__ (self) |
def | serialize (self, format=None) |
def | __reduce__ (self) |
def | evolver (self) |
![]() | |
def | __contains__ (self, element) |
def | __iter__ (self) |
def | __len__ (self) |
def | __hash__ (self) |
def | add (self, element) |
def | update (self, iterable) |
def | remove (self, element) |
def | discard (self, element) |
def | copy (self) |
![]() | |
def | create (cls, source_data, _factory_fields=None) |
![]() | |
def | __new__ (mcs, name, bases, dct) |
Static Public Attributes | |
create | |
![]() | |
issubset | |
issuperset | |
union | |
intersection | |
difference | |
symmetric_difference | |
isdisjoint | |
A CheckedPSet is a PSet which allows specifying type and invariant checks. >>> class Positives(CheckedPSet): ... __type__ = (int, float) ... __invariant__ = lambda n: (n >= 0, 'Negative') ... >>> Positives([1, 2, 3]) Positives([1, 2, 3])
def __new__ | ( | cls, | |
initial = () |
|||
) |
Reimplemented from PSet.
def __reduce__ | ( | self | ) |
Reimplemented from PSet.
def __repr__ | ( | self | ) |
Reimplemented from PSet.
def __str__ | ( | self | ) |
Reimplemented from PSet.
def evolver | ( | self | ) |
Create a new evolver for this pset. For a discussion on evolvers in general see the documentation for the pvector evolver. Create the evolver and perform various mutating updates to it: >>> s1 = s(1, 2, 3) >>> e = s1.evolver() >>> _ = e.add(4) >>> len(e) 4 >>> _ = e.remove(1) The underlying pset remains the same: >>> s1 pset([1, 2, 3]) The changes are kept in the evolver. An updated pmap can be created using the persistent() function on the evolver. >>> s2 = e.persistent() >>> s2 pset([2, 3, 4]) The new pset will share data with the original pset in the same way that would have been done if only using operations on the pset.
Reimplemented from PSet.
def serialize | ( | self, | |
format = None |
|||
) |
Reimplemented from CheckedType.
|
static |