How to represent a sequence of raw bytes

John Machin sjmachin at lexicon.net
Mon Dec 22 16:05:46 EST 2008


On Dec 23, 1:52 am, "Steven Woody" <narkewo... at gmail.com> wrote:
> On Mon, Dec 22, 2008 at 6:44 PM, Steven D'Aprano
>
> <st... at remove-this-cybersource.com.au> wrote:
> > On Mon, 22 Dec 2008 14:56:45 +0800, Steven Woody wrote:
>
> >> The intension is to allocate 200 undefined bytes in memory.
>
> > You *want* undefined bytes? Out of curiosity, what do you intend to do
> > with them?
>
> to receive/send network packets, read raw files, etc.  After read
> replies of the thread, I think 'array' or 'struct' maybe what I
> wanted, may a plain list can do, but I am not sure.

[Rhetorical questions] How do you use "undefined bytes" to receive
network packets?? Do you really want to use "undefined bytes" to
*send* network packets????

Suggestion: Stop trying to replicate C in Python; think about what you
are trying to accomplish at a higher level, then how to implement that
in Python.

Cheers,
John



More information about the Python-list mailing list