reason being, I've needed pointer simulation for address verification for quite a while now... heh
so what methods would I need and how would I need to build the __init__() method??
here's what I have so far: (originally started as a file class)
- Code: Select all
from array import array as _arr #private
this.data = _arr('B',) #fastest possible safe array for data management
this.size = 0
this.offset = 0
def preread(this,length=this.size): return this.data[this.offset:this.offset+length]
def read(this,length=this.size): return this.data[this.offset:this.offset+length]; this.offset+=length
def alloc(this,size): pass #save up some memory before writing (speed things up a bit)
def write(this,char=''): pass
why the array module?
aside from it being fastest array I've used yet (including NumPy), I find it better to parse both types of file-data as 8bit ints
the only faster thing I know of is a dictionary, but that's unsafe as it eats a massive amount of memory for a large amount of data
anyways, if there's anything I don't know, please tell me
(if I already know it, tell me anyways)
if anyone knows of any previous topics here, or other information on something similar to this,
please post a link.
OT: /new idea >.>
I should build a script that tests each type of array with .append(v) and +=[v]
(who's not to say my previous tests havn't changed over time as Py27 evolved)