(obj, eltclass=None)
| 115 | return PartialBufferType.create_real_implem(type, int(nbelt)) |
| 116 | |
| 117 | def buffer(obj, eltclass=None): |
| 118 | if eltclass is None: # Guess |
| 119 | obj = list(obj) |
| 120 | item = obj[0] |
| 121 | eltclass = type(item) # All object must have the same type |
| 122 | dlen = len(obj) |
| 123 | return BUFFER(eltclass, dlen)(*obj) |
| 124 | |
| 125 | def resized_array(array, newnbelt, newtype=None): |
| 126 | if newtype is None: |
no test coverage detected