[issue3690] sys.getsizeof wrong for Py3k bool objects

2010-03-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: Closing this as "won't fix", then. -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ __

[issue3690] sys.getsizeof wrong for Py3k bool objects

2010-03-19 Thread Mark Dickinson
Mark Dickinson added the comment: I don't think there's anything worth fixing here. It's true that getsizeof is sometimes going to return results that are too small, because there are a good few places in the longobject internals where it's not predictable in advance exactly how much space i

[issue3690] sys.getsizeof wrong for Py3k bool objects

2010-03-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Alexander.Belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-09-23 Thread Robert Schuppenies
Robert Schuppenies <[EMAIL PROTECTED]> added the comment: Attached is a patch which takes the preallocation of small_ints into account. What do you think? Added file: http://bugs.python.org/file11568/smallints_sizeof.patch ___ Python tracker <[EMAIL PROTECTED

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-09-15 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > So how should this bug report be handled? Provide a patch to handle > getsizeof correctly for small_ints? 'wont fix' because there are issues > anyway? I would prefer the former and try to come up with a patch if you > think it is worthwhil

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-09-15 Thread Robert Schuppenies
Robert Schuppenies <[EMAIL PROTECTED]> added the comment: > What's the actual difference that this change makes? It would provide more accurate results, even in the light of being not perfect. > [..] each small_int takes a complete PyLongObject. If that was also > considered in long_sizeof, the

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-09-14 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: >> In any case, I also think this doesn't matter much either way. > Why do you think so? What's the actual difference that this change makes? At most 8 bytes per object, right? And for two objects in total. So if somebody would compute memo

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-09-14 Thread Robert Schuppenies
Robert Schuppenies <[EMAIL PROTECTED]> added the comment: As I understood the long object allocation it is implemented as "PyObject_MALLOC(sizeof(PyVarObject) + size*sizeof(digit))" to avoid this allocation of extra 2 bytes. So from my understanding, the number 0 allocates memory for the referenc

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-09-07 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: I'm not sure this is a bug. sys.getsizeof doesn't take padding in the malloc implementation into account, either, so a long object that accounts to 22 bytes (such as the number 1) uses at least 24 bytes, also. In any case, I also think this d

[issue3690] sys.getsizeof wrong for Py3k bool objects

2008-08-26 Thread Robert Schuppenies
New submission from Robert Schuppenies <[EMAIL PROTECTED]>: sys.getsizeof returns wrong results for bool objects in Python 3000. Although bool objects use the same datatype as long objects, they are allocated differently. Thus, the inherited long_sizeof implementation is incorrect. The applied pa