Uranium
Application Framework
UM.Signal.WeakImmutableList Class Reference

Minimal implementation of a weak reference list with immutable tendencies. More...

Inherits Generic, T, and Iterable.

Public Member Functions

def __init__ (self)
 
"WeakImmutableList[T]" append (self, T item)
 Append an item and return a new list. More...
 
"WeakImmutableList[T]" remove (self, T item)
 Remove an item and return a list. More...
 
def __iter__ (self)
 

Detailed Description

Minimal implementation of a weak reference list with immutable tendencies.

Strictly speaking this isn't immutable because the garbage collector can modify it, but no application code can. Also, this class doesn't implement the Python list API, only the handful of methods we actually need in the code above.

Member Function Documentation

◆ append()

"WeakImmutableList[T]" UM.Signal.WeakImmutableList.append (   self,
item 
)

Append an item and return a new list.

Parameters
itemthe item to append
Returns
a new list

◆ remove()

"WeakImmutableList[T]" UM.Signal.WeakImmutableList.remove (   self,
item 
)

Remove an item and return a list.

Note that unlike the normal Python list.remove() method, this ones doesn't throw a ValueError if the item isn't in the list.

Parameters
itemitem to remove
Returns
a list which does not have the item.

The documentation for this class was generated from the following file: