Package pycocoa :: Module tuples :: Class Tuple
[frames] | no frames]

Class Tuple

          object --+        
                   |        
internals._Objectype --+    
                       |    
        baseTypes._Type0 --+
                           |
                          Tuple
Known Subclasses:

Python tuple Type, wrapping an immutable ObjC NSArray.

Instance Methods
 
__init__(self, ns_tuple=())
New Tuple from a tuple, Tuple, list, List or NS[Mutable]Array.
 
__contains__(self, value)
 
__delitem__(self, index)
 
__eq__(self, other)
 
__getitem__(self, index)
 
__iter__(self)
Yield the items in forward order.
 
__len__(self)
Return the number of items.
 
__ne__(self, other)
 
__reversed__(self)
Yield the items in reverse order.
 
__setitem__(self, index, value)
 
append(self, value)
 
clear(self)
 
copy(self, *ranged)
Make a shallow copy of this tuple.
 
count(self, value, identical=False)
Count the number of occurances of an item, like tuple./list.count.
 
extend(self, values)
 
index(self, value, identical=False)
Find an item, like tuple./list.index.
 
insert(self, index, value)
 
pop(self, index=-1)

Inherited from baseTypes._Type0: __repr__, __str__, type2strepr

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from baseTypes._Type0: NS, NSDelegate

Inherited from internals._Objectype: typename

Inherited from object: __class__

Method Details

__init__(self, ns_tuple=())
(Constructor)

 

New Tuple from a tuple, Tuple, list, List or NS[Mutable]Array.

Overrides: object.__init__

copy(self, *ranged)

 

Make a shallow copy of this tuple.

Parameters:
  • ranged - Optional index range.
Returns:
The copy (Tuple).

count(self, value, identical=False)

 

Count the number of occurances of an item, like tuple./list.count.

Parameters:
  • idential - Use ObjC idential as comparison (bool).

index(self, value, identical=False)

 

Find an item, like tuple./list.index.

Parameters:
  • idential - Use ObjC idential as comparison (bool).