Message158507
| Author |
TheBiggerGuy |
| Recipients |
TheBiggerGuy, docs@python, pitrou, r.david.murray |
| Date |
2012年04月16日.21:56:04 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334613364.86.0.938020977252.issue14586@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Looking through cpython and trying to form a patch I found several differing interpretations of truncate:
Lib/_pyio.py
def truncate(self, pos=None):
Modules/_io/fileio.c
PyDoc_STRVAR(truncate_doc, "truncate([size: int]) ...");
A first semi-working patch is attached. This will allow:
truncate()
truncate(x)
truncate(size=x)
and fail on:
truncate(x, size=x)
truncate(x, size=y)
Thoughts?
ps.
fileio_truncate is defined as
(PyCFunctionWithKeywords)fileio_truncate, METH_VARARGS | METH_KEYWORDS
but fails with "takes no keyword arguments". How do I fix this? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月16日 21:56:04 | TheBiggerGuy | set | recipients:
+ TheBiggerGuy, pitrou, r.david.murray, docs@python |
| 2012年04月16日 21:56:04 | TheBiggerGuy | set | messageid: <1334613364.86.0.938020977252.issue14586@psf.upfronthosting.co.za> |
| 2012年04月16日 21:56:04 | TheBiggerGuy | link | issue14586 messages |
| 2012年04月16日 21:56:04 | TheBiggerGuy | create |
|