Re: getting the size of an object

2007-06-25 Thread Simon Brunning
On 6/18/07, filox <[EMAIL PROTECTED]> wrote: > is there a way to find out the size of an object in Python? e.g., how could > i get the size of a list or a tuple? mxTools includes a sizeof() function. Never used it myself, but MAL isn't notorious for getting things wrong, so I'm sure it does what i

Re: getting the size of an object

2007-06-18 Thread Gabriel Genellina
En Mon, 18 Jun 2007 16:48:36 -0300, filox <[EMAIL PROTECTED]> escribió: > "Brett Hoerner" <[EMAIL PROTECTED]> wrote in message >> Although I have the feeling you mean "how many bytes does this object >> take in memory" - and I believe the short answer is no. > > is there a long answer? what i wa

Re: getting the size of an object

2007-06-18 Thread John Machin
On Jun 19, 9:00 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jun 18, 10:07 am, "filox" <[EMAIL PROTECTED]> wrote: > > > is there a way to find out the size of an object in Python? e.g., how could > > i get the size of a list or a tuple? > > > -- > > You're never too young to have a Vietnam flashback >

Re: getting the size of an object

2007-06-18 Thread 7stud
On Jun 18, 10:07 am, "filox" <[EMAIL PROTECTED]> wrote: > is there a way to find out the size of an object in Python? e.g., how could > i get the size of a list or a tuple? > > -- > You're never too young to have a Vietnam flashback You can use the struct module to find the size in bytes: imp

Re: getting the size of an object

2007-06-18 Thread Lenard Lindstrom
filox wrote: > "Brett Hoerner" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote: >>> is there a way to find out the size of an object in Python? e.g., how >>> could >>> i get the size of a list or a tuple? >> "Size" can mean a

Re: getting the size of an object

2007-06-18 Thread Brett Hoerner
On Jun 18, 2:48 pm, "filox" <[EMAIL PROTECTED]> wrote: > is there a long answer? what i want is to find out the number of bytes the > object takes up in memory (during runtime). since python has a lot of > introspection mechanisms i thought that should be no problem... There isn't an automatic way

Re: getting the size of an object

2007-06-18 Thread filox
"Brett Hoerner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote: >> is there a way to find out the size of an object in Python? e.g., how >> could >> i get the size of a list or a tuple? > > "Size" can mean a lot of things, > >

Re: getting the size of an object

2007-06-18 Thread Brett Hoerner
On Jun 18, 11:07 am, "filox" <[EMAIL PROTECTED]> wrote: > is there a way to find out the size of an object in Python? e.g., how could > i get the size of a list or a tuple? "Size" can mean a lot of things, len(my_list) len(my_tuple) Although I have the feeling you mean "how many bytes does this

getting the size of an object

2007-06-18 Thread filox
is there a way to find out the size of an object in Python? e.g., how could i get the size of a list or a tuple? -- You're never too young to have a Vietnam flashback -- http://mail.python.org/mailman/listinfo/python-list