Python array.ArrayType() Examples

The following are 4 code examples of array.ArrayType(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module array , or try the search function .
Example #1
Source File: test_array.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_ArrayType(self):
        self.assertEqual(array.ArrayType,
                array.array) 
Example #2
Source File: test_array.py    From ironpython3 with Apache License 2.0 5 votes vote down vote up
def test_ArrayType(self):
        self.assertEqual(array.ArrayType,
                array.array) 
Example #3
Source File: sample.py    From synthesizer with GNU Lesser General Public License v3.0 5 votes vote down vote up
def get_frame_array(self) -> 'array.ArrayType[int]':
        """Returns the sample values as array. Warning: this can copy large amounts of data."""
        return Sample.get_array(self.samplewidth, self.__frames) 
Example #4
Source File: sample.py    From synthesizer with GNU Lesser General Public License v3.0 5 votes vote down vote up
def get_array(samplewidth: int, initializer: Optional[Iterable[int]] = None) -> 'array.ArrayType[int]':
        """Returns an array with the correct type code, optionally initialized with values."""
        if samplewidth not in samplewidths_to_arraycode:
            raise ValueError("can't create a Python array for samplewidth " + str(samplewidth))
        arraycode = samplewidths_to_arraycode[samplewidth]
        return array.array(arraycode, initializer or [])