Georg Brandl added the comment:
Another use case here is if you want to check the remaining call sites of
(say) PyArg_ParseTuple that aren't generated by clinic.
Call it '--remove' if you want, but the functionality should be useful.
--
nosy: +georg.brandl
Georg Brandl added the comment:
OK, here's a patch for _csv. Two problems here:
First problem is the __new__ method of the Dialect class:
* it has no docstring and no methoddef entry
* it is a class method, but the first arg is conventionally called type
I tried to hack something into clinic
Georg Brandl added the comment:
Tried to tackle symtable -- it uses an O converter. The clinic howto says
``'O'````object(converter='name_of_c_function')``
but
Traceback (most recent call last):
File Tools/clinic/clinic.py, line 2817, in module
sys.exit(main(sys.argv[1:]))
File
Georg Brandl added the comment:
_tracemalloc converted.
Its existing docstrings did use the
func(arg: argtype) - rettype
convention. Is there a way in clinic to retain that?
--
Added file: http://bugs.python.org/file33423/tracemalloc_clinic.patch
Georg Brandl added the comment:
Here's _iomodule. _io.open has a whopping 100-line docstring, which is ...
unfortunate ... to have duplicated in the file :)
--
Added file: http://bugs.python.org/file33424/io_clinic.patch
___
Python tracker
Georg Brandl added the comment:
And _heapq. No problems there, except that it also used - return
annotations in the docstring.
--
Added file: http://bugs.python.org/file33425/heapq_clinic.patch
___
Python tracker rep...@bugs.python.org
Georg Brandl added the comment:
And lsprof.
--
Added file: http://bugs.python.org/file33426/lsprof_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Georg Brandl added the comment:
I'm in favor of PyPy's behavior: null bytes anywhere in the source, even in
comments, usually mean there's something weird or fishy going on with either
the editor or (if downloaded/copied) the source of the code.
--
nosy: +georg.brandl
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20138
___
___
STINNER Victor added the comment:
Typo in the C code: depracation :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19995
___
___
Georg Brandl added the comment:
Here's the signalmodule.
--
keywords: +patch
nosy: +georg.brandl
Added file: http://bugs.python.org/file33427/signal_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20182
Roundup Robot added the comment:
New changeset 29732b43ccf2 by Serhiy Storchaka in branch '3.3':
Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri()
http://hg.python.org/cpython/rev/29732b43ccf2
New changeset 73781fe1daa2 by Serhiy Storchaka in branch 'default':
Issue #20138:
New submission from Georg Brandl:
For METH_NOARGS, you can get rid of the separate _impl function. This makes
the generated code much smaller.
--
messages: 207943
nosy: georg.brandl
priority: normal
severity: normal
status: open
title: Argument Clinic: simplify METH_NOARGS generated
Serhiy Storchaka added the comment:
Seconded.
But only if there are no self or result converters.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20225
___
Georg Brandl added the comment:
Now without crap.
--
Added file: http://bugs.python.org/file33428/signal_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20182
___
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33427/signal_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20182
___
New submission from Georg Brandl:
Take for example select.epoll.__new__():
static PyObject *
pyepoll_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
int flags = 0, sizehint = FD_SETSIZE - 1;
static char *kwlist[] = {sizehint, flags, NULL};
if
Changes by Georg Brandl ge...@python.org:
--
assignee: - larry
nosy: +larry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20225
___
___
Changes by Georg Brandl ge...@python.org:
--
assignee: - larry
nosy: +larry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20226
___
___
Serhiy Storchaka added the comment:
See also a discussion in issue20193. zlib needs this in many functions.
--
nosy: +serhiy.storchaka
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20226
New submission from Georg Brandl:
This is a request to be able to name C arguments differently from Python
arguments.
Two reasons:
* like for function renaming, some Python argument names are reserved in C
(default for example, used in sys.getsizeof())
* sometimes the function uses 'O' in
Changes by Georg Brandl ge...@python.org:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20227
___
___
Python-bugs-list
Georg Brandl added the comment:
OK, I see that AC automatically handles case 1, great!
Still you have to decide if you like the code churn caused by case 2.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20227
Georg Brandl added the comment:
One more: I can't have an argument called args.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20227
___
___
Georg Brandl added the comment:
Here's sys.
For it to generate the correct code you need to add args to c_keywords in
clinic.py.
--
Added file: http://bugs.python.org/file33429/sys_clinic.patch
___
Python tracker rep...@bugs.python.org
Ram Rachum added the comment:
(Replace `is` with `if` in my code sample, typo.)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
___
___
Larry Hastings added the comment:
You can accomplish that workflow by using the Clinic buffer prototype and
moving all your output to the side. Or by using the buffer approach, and
stopping when you hit the generated code. One of these might actually happen
in Clinic, too, so hang on to
Larry Hastings added the comment:
(Actually a self converter would be fine too. Those are only allowed to cast.)
I'm not doing this; here's why. I want the call signature to the impl function
to be the *idealized* signature of that function. And METH_NOARGS passes in a
dumb stupid second
Georg Brandl added the comment:
Sure, I wasn't concerned with compilation, only saving lines of code. But I
agree that the buffer way sounds much more promising.
Just seemed odd that METH_O was clean and METH_NOARGS less so :)
--
___
Python tracker
Larry Hastings added the comment:
Yes, this is supported, just undocumented (for now). The magic you want is,
for example in Modules/_sre.c:
endpos: Py_ssize_t(c_default=PY_SSIZE_T_MAX) = sys.maxsize
--
___
Python tracker rep...@bugs.python.org
Georg Brandl added the comment:
Nice, thanks.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20226
___
___
Python-bugs-list mailing list
Marcel Hellkamp added the comment:
This change breaks existing applications.
The cgi.FieldStorage.file attribute is public and mentioned in the
documentation. It even states You can then read the data at leisure from the
file attribute.
Consider this example::
form = cgi.FieldStorage()
Senthil Kumaran added the comment:
The last tracker message msg207926 is applicable to issue #19097 and not here.
Sorry for the confusion.
--
nosy: +orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19092
Senthil Kumaran added the comment:
Fixed in:
New changeset a3e49868cfd0 by Senthil Kumaran in branch '3.3':
Issue #19092 - Raise a correct exception when cgi.FieldStorage is given an
http://hg.python.org/cpython/rev/a3e49868cfd0
New changeset 1638360eea41 by Senthil Kumaran in branch
Larry Hastings added the comment:
Freshened patch,
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20214
___
___
Larry Hastings added the comment:
Do you have commit rights? I can commit this patch for you if you don't. Just
wondering what (if anything) is holding this up.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20201
Larry Hastings added the comment:
Georg, you mind reviewing this too? Six line patch. Just trying to clean my
plate a little before I fix a bug for you :D
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
Larry Hastings added the comment:
Looks like you don't, so I'll commit this on your behalf.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20201
___
Larry Hastings added the comment:
Also adding the one-byte fix from #20201 to the rollup patch here. (Not
bothering to upload a fresh patch because it is literally one byte, fixing a
misspelled variable name.)
--
___
Python tracker
Roundup Robot added the comment:
New changeset cc8b21988efb by Ethan Furman in branch 'default':
Issue19995: fixed typo; switched from test.support.check_warnings to assertWarns
http://hg.python.org/cpython/rev/cc8b21988efb
--
___
Python tracker
Larry Hastings added the comment:
I goofed, I do have some additional fixes. Here's everything.
Changes since patch #1:
* Added 'converter' argument to 'object' converter.
* Fixed misspelled variable name (see #20201).
* Several documentation updates.
--
Added file:
Roundup Robot added the comment:
New changeset 250b481a0d28 by Larry Hastings in branch 'default':
Issue #20196: Fixed a bug where Argument Clinic did not generate correct
http://hg.python.org/cpython/rev/250b481a0d28
--
nosy: +python-dev
___
Python
Larry Hastings added the comment:
Easy fix. Thanks for the report!
--
resolution: - fixed
stage: patch review - commit review
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20196
Changes by Brett Cannon br...@python.org:
--
assignee: - brett.cannon
keywords: +3.3regression -patch
nosy: +larry
priority: normal - release blocker
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18394
Eric Snow added the comment:
The difference is that inspect.signature is not friendly to Signature
subclasses. Without from_callable you can't customize the behavior in
inspect.signature easily.
--
___
Python tracker rep...@bugs.python.org
Yury Selivanov added the comment:
The difference is that inspect.signature is not friendly to Signature
subclasses. Without from_callable you can't customize the behavior in
inspect.signature easily.
OK, suppose you have Signature.from_callable. You then create a subclass
MySignature, and
Yury Selivanov added the comment:
Eric,
Moreover, 'Signature.from_function' and newly added 'Signature.from_builtin'
are private API, or implementation detail (they are not part of PEP, not
mentioned in the docs). If at some point it is needed to rewrite Signature
in C, probably those two
Eric Snow added the comment:
It's not about customizing inspect.signature. It's about customizing the
nice behavior of that function, including what type it returns.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17373
Yury Selivanov added the comment:
OK, got it now.
Green light from me. Looking through the code, I saw that 'from_builtin'
doesn't use the 'Signature._parameter_cls' (as in from_function). That's
probably needs to be fixed as well, maybe in a separate issue.
--
Yury Selivanov added the comment:
Larry, just a small thing.. Could you please add something like Parameter =
cls._parameter_cls in the from_builtin method? (see the discussion in #17373)
--
___
Python tracker rep...@bugs.python.org
Nikolaus Rath added the comment:
I've updated the patch again to fix a problem with HTTPSConnection.
--
Added file: http://bugs.python.org/file33431/issue7776.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7776
Larry Hastings added the comment:
Third patch, with these new features:
* Relaxed rules regarding c_default and py_default; they can now be
used even when no default value is supplied.
* Added bool return converter.
* Made one fail() call easier to read, through the power of str.format().
*
Roundup Robot added the comment:
New changeset 3eee3967d03f by Larry Hastings in branch 'default':
Issue #20214: Fixed a number of small issues and documentation errors in
http://hg.python.org/cpython/rev/3eee3967d03f
--
nosy: +python-dev
___
Python
Larry Hastings added the comment:
Fixed as part of the rollup patch in #20214.
--
assignee: - larry
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20201
New submission from Larry Hastings:
As per Georg's request (and hacks in other places), Argument Clinic should have
support for special methods. To wit:
__init__ should be required to be an instance method. Clinic should suppress
its methoddef #define.
__new__ should be required to be a
Changes by Fabian Kochem fkoc...@gmail.com:
--
nosy: +Fabian.Kochem
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8876
___
___
Python-bugs-list
Larry Hastings added the comment:
Updated patch incorporating changes from Georg Brandl. Thanks Georg!
--
Added file:
http://bugs.python.org/file33434/larry.special.methods.support.patch.2.txt
___
Python tracker rep...@bugs.python.org
Ryan Smith-Roberts added the comment:
Thank you for including the doc change in your other patch. As the grammar was
off, instead of just fixing it I naturally rewrote it. Use this patch or just
remove the extraneous for you as you prefer.
--
keywords: +patch
Added file:
Larry Hastings added the comment:
Fixed in revision 43e109ca9018. Well, changed anyway, maybe it's still not
wonderful text.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20202
___
Ryan Smith-Roberts added the comment:
Just discovered that the bugtracker mail was all going into my spam filter,
yay. Didn't notice your reply until just now.
The functools patch was just a quickie to get it out of my mental queue, and
I'm still working on socketmodule. This is my first time
Larry Hastings added the comment:
I don't know what you mean by a multipart patch, but the bug tracker has
handled every patch I've thrown at it so far. (Assuming that the patch is
based on a reasonably fresh checkout of trunk.)
--
___
Python
Changes by Larry Hastings la...@hastings.org:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20228
___
Roundup Robot added the comment:
New changeset bc5f257f5cc1 by Larry Hastings in branch 'default':
Issue #20228: Argument Clinic now has special support for class special
http://hg.python.org/cpython/rev/bc5f257f5cc1
--
nosy: +python-dev
___
Python
New submission from Marc Tamlyn:
platform.mac_ver() triggers the following deprecation warning:
python3.4 -Wall
Python 3.4.0b2 (v3.4.0b2:ba32913eb13e, Jan 5 2014, 11:02:52)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
Roundup Robot added the comment:
New changeset 1730f4a97cbb by Senthil Kumaran in branch '2.7':
Issue #19082: Working SimpleXMLRPCServer and xmlrpclib examples, both in
modules and documentation.
http://hg.python.org/cpython/rev/1730f4a97cbb
New changeset 72560f9bb2a2 by Senthil Kumaran in
Senthil Kumaran added the comment:
Addressed this in all active branches (2.7, 3.3 and 3.4). Thanks!
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Julian Gindi added the comment:
What needs to be done to close this one out?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18983
___
___
New submission from Andrew Barnert:
A PyStructSequence type doesn't expose its field names in any way to Python
code (except indirectly, via the repr, which you could parse if you really
wanted to…).
The docs claim that Struct sequence objects are the C equivalent of
namedtuple() objects, so
Changes by Meador Inge mead...@gmail.com:
--
nosy: +meador.inge
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20230
___
___
Python-bugs-list
Andrew Barnert added the comment:
I believe the structseq issues are a lot easier to solve than the appear. See
#20230, which adds a _fields member to every structseq type. Having done that,
a NamedTuple ABC works on them just fine. And of course duck typing them
without an ABC does too.
Andrew Barnert added the comment:
After more searching (I should have searched on structseq instead of
PyStructSequence…), this might be a dup of #1820. If so, apologies.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20230
Andrew Barnert added the comment:
See issue20230, which includes a patch implementing just the first part of part
2 (adding _fields, but not _asdict or _replace).
Since this one has been open for 5+ years, if it's not going to be done soon,
any chance of the easy (_fields) change being
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1820
___
___
Python-bugs-list
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20230
___
___
Python-bugs-list
Vajrasky Kok added the comment:
This feature is for Python 3.5. I think, we will not commit anything to Python
3.5 until Python 3.4 branch is created (in other world, released). So, be
patient. :)
--
nosy: +vajrasky
___
Python tracker
Ned Deily added the comment:
Thanks for the report! Here's a patch.
--
keywords: +needs review
nosy: +ned.deily
stage: - patch review
Added file: http://bugs.python.org/file33437/issue20229.py
___
Python tracker rep...@bugs.python.org
Changes by Ryan Smith-Roberts r...@lab.net:
--
type: - crash
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20231
___
___
Python-bugs-list mailing
New submission from Ryan Smith-Roberts:
A signature of the form
a: object = None
b: object
results in b being uninitialized in the generated C code prior to the
PyArgs_ParseTuple call. If ParseTuple does not set a value for b (as it is an
optional argument), b then contains a garbage pointer
New submission from Ryan Smith-Roberts:
When one specifies a default of NULL, the generated signature doc indicates a
default of None. However, if the user actually supplies None, perhaps as a
placeholder in a positional-only call, C code which only checks for NULL will
fail inappropriately.
Vajrasky Kok added the comment:
Yes, this issue bothers me. Currently _sha1.sha1 constructor will use NULL (not
None) value if used without parameters: _sha1.sha1()
_sha1.sha1(None) will throw error while _sha1.sha1() won't.
So for NULL (not None) default value, the generated signature
Meador Inge added the comment:
Larry, the attached patch converts what is convertible of
Modules/_ctypes/_ctypes. Although, I ran into an odd case
with this conversion: the converted functions are each used
in *multiple* PyMethodDef tables. So while clinic can generate
equivalent code, the
Meador Inge added the comment:
None of the sites in Modules/_curses_panel.c look convertible.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20178
___
Changes by Benno Rice be...@jeamland.net:
--
nosy: +ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20233
___
___
Python-bugs-list mailing
New submission from Benno Rice:
The API slots for bf_getbuffer and bf_releasebuffer are still disabled despite
the bug referenced (issue 10181) being marked as fixed. These should be
re-enabled if the stable ABI is to be used for types that use buffers.
--
components: Extension
Zachary Ware added the comment:
I second this request. Every PyArg_ParseTupleAndKeywords-using function in
_winapi has a keyword argument overlapped which is stuffed into a C variable
use_overlapped, while the local variable overlapped is used for an
Overlapped object, which makes for a big
Changes by Yury Selivanov yseliva...@gmail.com:
--
nosy: +yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20230
___
___
Python-bugs-list
Changes by Yury Selivanov yseliva...@gmail.com:
--
components: +Interpreter Core, Library (Lib)
versions: +Python 3.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20230
___
Zachary Ware added the comment:
And here is the patch to _winapi.c.
--
Added file: http://bugs.python.org/file33439/issue20172._winapi.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20172
Georg Brandl added the comment:
There are also several PyArg_ParseTuple-using functions that have the
same kind of name mismatch, but since the names don't really mean
anything on the Python side when they're positional-only, I don't feel
too bad about changing them to make them make
Akira Kitada added the comment:
I suppose this is a duplicate of #1065986.
--
nosy: +akitada
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6625
___
New submission from Georg Brandl:
In the presence of [ ] , clinic generates PyTuple_Size() calls.
Since argument tuples always are tuples, you can use the macro form
PyTuple_GET_SIZE() to speed it up.
--
assignee: larry
messages: 208007
nosy: georg.brandl, larry
priority: normal
New submission from Georg Brandl:
I had specified c_default=-1 (note missing quotes) somewhere, and it raises an
exception during the clinic --make run; there was no indication which file/line
this was on.
Suggested patch attached.
--
assignee: larry
files:
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33425/heapq_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33419/mathmodule_part1.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33422/csv_module_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33423/tracemalloc_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33424/io_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33426/lsprof_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
Georg Brandl added the comment:
OK, new patches coming in.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20186
___
___
Python-bugs-list mailing
Changes by Georg Brandl ge...@python.org:
Removed file: http://bugs.python.org/file33429/sys_clinic.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20182
___
1 - 100 of 104 matches
Mail list logo