[issue14201] libc.time != libc['time']

Erik Johansson report at bugs.python.org
Mon Mar 5 15:23:41 CET 2012


New submission from Erik Johansson <erik at ejohansson.se>:

I would expect that the following code would give True as result:

>>> from ctypes import *
>>> libc = CDLL("libc.so.6")
>>> libc.time == libc['time']
False

Is it by design that libc['time'] always returns a different _FuncPtr object? It is a bit confusing when doing things like:

libc['time'].restype = ...
libc['time'].argtypes = [...]

# python --version
Python 2.7.2+

Ubunutu version 2.7.2-5ubuntu1.

----------
components: ctypes
messages: 154949
nosy: erijo
priority: normal
severity: normal
status: open
title: libc.time != libc['time']
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14201>
_______________________________________


More information about the Python-bugs-list mailing list