[Python-Dev] Removing METH_OLDARGS

Guido van Rossum guido@python.org
2002年3月31日 17:43:56 -0500


> I forgot there is one case of METH_OLDARGS: file.readinto().
> I didn't want to change this because I don't know how to use it
> and there is no test for it.
>> If someone can give me a use-case, I can add a test and fix it.

>>> from array import array
>>> a = array('c', 100*'x')
>>> f = open("/etc/passwd")
>>> f.readinto(a)
100
>>> a
array('c', 'root:x:0:0:root:/root:/bin/bash\nbin:x:1:1:bin:/bin:/sbin/nologin\ndaemon:x:2:2:daemon:/sbin:/sbin/nol')
>>>
--Guido van Rossum (home page: http://www.python.org/~guido/)

AltStyle によって変換されたページ (->オリジナル) /