New submission from Martina Oefelein <[EMAIL PROTECTED]>:

The first use of PySet_GET_SIZE in dict_fromkeys (file dictobject.c) is applied 
to a PyDictObject. These seem to work by chance, as the PyDictObject and 
PySetObject have very 
similar structure so that it does not matter if you cast a PyDictObject* to a 
PySetObject*. But if their structure ever diverges, this would cause 
unpredictable behaviour.

Thus, this use of PySet_GET_SIZE should probably be replaced with a call of 
PyDict_Size.

(There are two more calls to PySet_GET_SIZE resp. _PySet_NextEntry in the same 
function, 
but these are OK as they actually apply to a set.)

----------
components: Interpreter Core
messages: 68914
nosy: oefe
severity: normal
status: open
title: dictobject.c: inappropriate use of PySet_GET_SIZE?

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3230>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to