Changes by Larry Hastings :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Larry Hastings :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Larry Hastings added the comment:
Okay, life has gotten even more complicated.
In another issue (#20172) Zachary Ware pointed out that Argument Clinic needs
to generate "self" parameters in the text string. But this complicates life
for inspect.Signature, which needs to not publish
Larry Hastings added the comment:
> Clinic should be adding 'self' to the signature,
> which should then be picked up by the __text_signature__
> parser, and used by inspect and pydoc.
This innocent little comment has derailed my whole day. You're right, 'self
Larry Hastings added the comment:
Not for builtins.
--
___
Python tracker
<http://bugs.python.org/issue20189>
___
___
Python-bugs-list mailing list
Unsubscribe:
Larry Hastings added the comment:
Here's an updated patch. I tried to "do it right" which wound up being a huge
amount of work in Clinic. The actual change to inspect.Signature was really
easy, once I understood everything.
The churn in the .c files is because Clinic no
Larry Hastings added the comment:
> Another issue is that with the patch applied help() is broken for
> certain forms of docstrings:
Yeah. We discussed this briefly in #19674. I wanted to use a marker that
wasn't The Convention That People Have Used For Decades but I felt overrule
Larry Hastings added the comment:
Filed comments on everything.
--
___
Python tracker
<http://bugs.python.org/issue20172>
___
___
Python-bugs-list mailin
Larry Hastings added the comment:
Same bug for 'y' too. Will fix in a patch probably Tuesday. Thanks for
pointing it out!
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
Very nice! I had an idea to do this in the back of my head too. But my plate
is already full.
I haven't reviewed the patch yet--and I have a huge backlog of reviews already.
But I can give this higher priority if you need it for other patches. Wh
Larry Hastings added the comment:
Dang it, I forgot to add the second patch. Here it is.
--
Added file:
http://bugs.python.org/file33467/larry.support.text_signature.on.more.types.diff.2.txt
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Meador Inge: In the future, please create new issues for these sorts of fixes.
--
___
Python tracker
<http://bugs.python.org/issue16
Larry Hastings added the comment:
If it's not worth a new issue, then you can check it in without citing an issue
at all.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
Updated the patch. (Diff #2 apparently didn't apply cleanly, so we didn't get
a review link.)
Old-guard core devs: I'm *really* desperate for a review of this patch. You
don't have to review everything thing, just these files:
Larry Hastings added the comment:
Antoine Pitrou took care of cryptmodule.c.
--
title: Derby #17: Convert 50 sites to Argument Clinic across 14 files -> Derby
#17: Convert 49 sites to Argument Clinic across 13 files
___
Python tracker
&l
Larry Hastings added the comment:
The attached patch extends Argument Clinic and the inspect module: now you may
use simple (!) expressions as default values. So for example "sys.maxsize - 1"
should now work fine.
* Names may be in the current module; as a backup they will also be
New submission from Larry Hastings:
It was a quick hack: Clinic now has a syntax for cloning an existing
function! The first line of the function block should be
module.class.new_function [as c_basename] = module.class.existing_fn
Hurry up and give me a LGTM so you can use it everywhere
Larry Hastings added the comment:
Shall I just check it in and fix it if it breaks?
--
___
Python tracker
<http://bugs.python.org/issue20268>
___
___
Python-bug
Larry Hastings added the comment:
Begun, the clone war has.
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Larry Hastings added the comment:
Zachary: If you refresh your copy of trunk, you can now "clone" functions. See
the howto for the syntax.
The failure you were seeing was in some code that I just rewrote (see #20226).
I'd be interested if you could apply that patch and try
Larry Hastings added the comment:
Can you give me an example of performance degradation due to Argument Clinic?
What percentage slowdown is common?
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Until you have some numbers, your assertion has no weight and should be ignored.
(As Carl Sagan once wrote: "That which can be asserted without evidence can be
dismissed without evidence." And as Donald Knuth wrote: "Premature
optimization is
Larry Hastings added the comment:
We can use this now. So I bumped it to the top of my queue and reviewed it. I
had only minor feedback--thanks!
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
That's okay, email me a sample at
larry at hastings dot org
and I'll take a look at it. Be sure to tell me which patch(es) were applied at
the time.
(Note: all you need to send is the Cl
Larry Hastings added the comment:
I'd prefer it if you emailed me as I asked. That will help me get to it a lot
quicker.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
One mandate I've given myself for this project:
When a function provides a signature, it must be 100% accurate.
A specific corollary of this:
If you call a function, and for every optional parameter you
explicitly pass it in with its default value
Larry Hastings added the comment:
I'll fix this, but it's lower priority than the new features for Clinic that
people need in order to get unblocked.
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
In the past few days I added "cloning" functions, which lets you reuse the
parameters and return converter from an existing function. That might help
with Modules/_ctypes/_ctypes.
--
___
Python trac
Larry Hastings added the comment:
All the functions in curses_panel are convertable. The threeMETH_NOARGS
functions simply get no arguments. And here's new_panel:
new_panel
window: object(subclass_of='&PyCursesWindow_Type')
/
--
___
New submission from Larry Hastings:
The code in Modules/_sqlite/connection.c is sloppy.
The functions pysqlite_connection_execute, pysqlite_connection_executemany, and
pysqlite_connection_executescript accept a third "PyObject *kwargs". However
none of these functions are marked ME
Larry Hastings added the comment:
Has this been fixed?
--
___
Python tracker
<http://bugs.python.org/issue8876>
___
___
Python-bugs-list mailing list
Unsubscribe:
Larry Hastings added the comment:
I'm marking this as a duplicate of #20226, the "add general-purpose
expressions" issue, because that will fix the behavior you're seeing. As for
"in general Argument Clinic should have better error reporting", this is too
gener
Larry Hastings added the comment:
LGTM, please commit.
--
___
Python tracker
<http://bugs.python.org/issue20235>
___
___
Python-bugs-list mailing list
Unsub
Larry Hastings added the comment:
You're right, deprecation sounds best. If Georg or Benjamin want the fix in
earlier releases I'll split the pysqlite_connection_call into another issue,
otherwise I won't bother.
As for fixing the undefined behavior in older versions: since
Larry Hastings added the comment:
Nick, could you maybe review this?
--
nosy: +ncoghlan
___
Python tracker
<http://bugs.python.org/issue20189>
___
___
Python-bug
Larry Hastings added the comment:
I'm glad you caught that! First things first: the converted code should behave
identically to the existing code, including raising the same exceptions.
If you examine the exception hierarchy:
http://docs.python.org/3.4/library/exceptions.html#exce
Larry Hastings added the comment:
I don't see the big win from this. You can rename variables in C any way you
like. "functionname as c_basename" is to fix otherwise unavoidable collisions;
this seems like a nice-to-have. And I already have a lot on my plate. I could
consid
Larry Hastings added the comment:
> is the best approach for this to define winreg_OpenKeyEx_impl
> as `return winreg_OpenKey_impl(module, key, sub_key, reserved,
> access);`?
Sounds good to me.
--
___
Python tracker
<http://bug
Larry Hastings added the comment:
Why wouldn't my suggestion work? _sha1.sha1(b'').hexdigest() ==
_sha1.sha1().hexdigest().
--
___
Python tracker
<http://bugs.pyt
Larry Hastings added the comment:
Also: how would PEP 457 help? PEP 457 only addresses extensions to support
positional-only parameters, and the parameter in question (the "string"
parameter to _sha1.sha1) is positional-or-keyword.
--
Larry Hastings added the comment:
Definitely not []. At the very least ().
I'd appreciate it if you'd stop abruptly changing the subject. I thought we
were talking about SHA1_new, but now you're talking about "address" and
"sockobj.sendmsg". If you have s
Larry Hastings added the comment:
I suppose so. It would be hard to measure the resulting speedup. But I guess
we get it for free.
I made the change in my "simple expressions" branch. So it'll go in when that
does.
--
resolution: -> fixed
stage: -> comm
Larry Hastings added the comment:
Good point. My brain is dead. What would be a better "magic cookie" value?
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
I don't understand. Python already has "double" which is float64. Why would
Python need a second floating-point type which isn't as good?
In any case, if somehow you get float32 in, we could just change the return
converters then. So
Larry Hastings added the comment:
Someone else came up with this hack using a custom converter:
class PID_converter(int_converter):
format_unit = '" _Py_PARSE_PID "'
Also, for marshal.version, soon you will be able to. This syntax won't work
now but it will soon
Larry Hastings added the comment:
Keep track of #20226, that's the issue where I'm adding improved support for
simple expressions like "version".
--
___
Python tracker
<http://bug
Larry Hastings added the comment:
I will bow to the wisdom of my predecessor and accept this patch for beta 3.
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Okay, I have a fix for the help(os.chmod) problem, that'll be in the next
refreshed patch.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
Isn't that what it does?
I may actually remove py_default. Nobody uses it, and I don't think you need
it--you just specify what you want as the real default value.
--
___
Python tracker
<http://bu
Larry Hastings added the comment:
Second rollup patch. More small fixes, many suggested by other folks.
--
Added file:
http://bugs.python.org/file33492/larry.clinic.rollup.patch.two.diff.2.txt
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Py_buffer is currently inflexible. The only default value it accepts is None.
If you want it to be required, give it no default value. If you want it to be
optional, give it a default value of None.
Do you have a use case for any other default value
Larry Hastings added the comment:
Third patch, changes based on Georg's review. Thanks, Georg!
--
Added file:
http://bugs.python.org/file33499/larry.clinic.rollup.patch.two.diff.3.txt
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
Sorry, forgot to update trunk, here you go.
--
Added file:
http://bugs.python.org/file33500/larry.clinic.rollup.patch.two.diff.4.txt
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Done!
Georg: Thanks for the suggestion, and for the reviews! Argument Clinic is
improved this day.
--
___
Python tracker
<http://bugs.python.org/issue20
Changes by Larry Hastings :
--
resolution: -> fixed
stage: patch review -> commit review
status: open -> closed
___
Python tracker
<http://bugs.python.or
Larry Hastings added the comment:
Whoever does the review, could you post here? I feel bad enough asking y'all,
maybe we don't need multiple people doing it ;-)
--
___
Python tracker
<http://bugs.python.o
New submission from Larry Hastings:
The long-awaited, highly desirable "buffer" patch is here! With features I
figured would never see the light of day.
Changes in this patch:
* New directive "output":
output
redirects a "field" (subsection of Cl
Larry Hastings added the comment:
If I removed support for all destinations except files, I might
be able to remove fifty lines or so. However, I'm not planning
on doing that. Does cryptmodule.c, which has exactly one function,
really need a 20-line separate file?
Also, the "file
Larry Hastings added the comment:
Updating / merging / resolving now, but it will take me a few minutes.
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Here's a fresh patch against trunk. It applies cleanly against current tip
(725bc24f5492).
--
Added file:
http://bugs.python.org/file33517/larry.support.text_signature.on.more.types.diff.4.txt
___
Python tr
Larry Hastings added the comment:
I have backed out the "args" -> "_args" change. Not because I'm giving up on
it, or that I necessarily think it's a bad idea, but because there
are some changes happening in #20189 that will make it easier / that would
co
Larry Hastings added the comment:
I do. Thanks for your time!
--
___
Python tracker
<http://bugs.python.org/issue20189>
___
___
Python-bugs-list mailin
Larry Hastings added the comment:
I have a fix already in place for the clinic_test.py problem.
I disagree with your proposed "foo.c.clinic" nomenclature, and there are
advantages to "foo.clinic.c": double-clicking on them will launch the correct
editor, and editors will
Larry Hastings added the comment:
Done!
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
New submission from Larry Hastings:
Argument Clinic currently prevents the "impl" function from ever seeing the
"args" tuple or the "kwargs" dict. There should be a way to ask it to pass
those values in to the "impl" function.
--
assi
Larry Hastings added the comment:
Meador: I'm going to change Argument Clinic so you can get the "args" and
"kwargs" values passed in to the impl. That's issue #20291; I already added
you to it "nosy" list. With that change in you
Larry Hastings added the comment:
Thanks for the report! It's fixed now. Sorry about that!
--
assignee: -> larry
components: +Demos and Tools -Build
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed
_
Larry Hastings added the comment:
That macro, STRFTIME_FORMAT_CODES, is only used in two functions. If it were
me I'd just copy and paste the text into both functions.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
I think these shouldn't be "int", they should be "bool". "bool" will allow you
to use a default of False. It maps to the "p" format unit, which was new in
3.3.
Back before 3.3, when someone wanted a boolean the
Larry Hastings added the comment:
I have a couple big patches incoming, over the next couple of days. Here's a
sneak-peek of my todo list:
* buffer support just went in (#20287)
* all builtins support landing maybe tomorrow (#20260)
* suppress the "self" parameter on impl
Larry Hastings added the comment:
Just checking--that happens with current trunk? Revision 32f9e0ae23f7 or newer?
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Oh! I thought it worked fine, because I've seen people convert both an
__init__ and a __new__. But I guess they wrapped them.
It's an easy change, I can try to do that today.
--
assignee: -> larry
_
Larry Hastings added the comment:
I just built from a new clone of trunk, and it works fine for me. I didn't see
the exception you report--I get the documentation for zlib.
Do you still get the error if you build from a new clone of the current
Larry Hastings added the comment:
> * As is probably expected, __init__ and __call__ procs
> can't be converted.
I should have a fix in for __init__ and __call__ later today. (Issue #20294.)
For the record, you could convert them, you just had to wrap the parsing
function
to de
Larry Hastings added the comment:
Oops, sorry, that last comment was intended for a different issue. Please
ignore, and sorry for the spam!
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Larry Hastings added the comment:
> * As is probably expected, __init__ and __call__ procs
> can't be converted.
I should have a fix in for __init__ and __call__ later today. (Issue #20294.)
For the record, you could convert them, you just had
Larry Hastings added the comment:
On 01/18/2014 01:12 PM, Ryan Smith-Roberts wrote:
> Ryan Smith-Roberts added the comment:
>
> I believe the feature you starred resolves this enhancement issue, in which
> case my patches are obsolete. And yes, the 'as' syntax makes a lot
Larry Hastings added the comment:
Yes, you should drop things that look like return annotations in the original
docstring.
I don't have a magic formula for finding unchanged functions, sorry.
--
___
Python tracker
<http://bugs.py
Larry Hastings added the comment:
If we modify inspect.getfullargspec, shouldn't we modify inspect.getargspec
too? "deprecated" doesn't mean "unsupported", it means "not recommended for
new code, please stop using it".
--
_
Larry Hastings added the comment:
Optional groups really are only for cases when that's the behavior
of the original code. If the original function used a switch statement
examining the size of the tuple, then had different parsing functions based on
that size, use optional groups.
But i
Larry Hastings added the comment:
Here's a patch. Wasn't as easy as I thought, it kind of took all day.
Changes include:
* __init__ and __new__ always take kwargs.
* if the function signature doesn't accept keyword arguments,
it calls _PyArg_NoKeywords().
* __init__ r
Changes by Larry Hastings :
--
assignee: -> larry
resolution: -> fixed
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python
Larry Hastings added the comment:
Checked in. Thanks for the report, and the patch!
I worked so quickly, I just realized, I didn't credit you in the NEWS
file for the fix. Do you want me to fix that?
--
___
Python tracker
<http://bugs.py
Larry Hastings added the comment:
Whoops, that doesn't apply cleanly. Here's an updated patch.
--
Added file:
http://bugs.python.org/file33542/larry.argument.clinic.init.and.new.patch.2.txt
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
Your fixes for #1 and #2 were fine, I've incorporated them into the patch.
I'll update the diff after I've added the tests Nick suggested.
The assertion failure in #3 will also be gone, replaced with a failure:
You can't have two par
Larry Hastings added the comment:
Checked in. Thanks for bringing the problem to my attention, Serhiy, and
thanks for the reviews you two!
rmsr: If I had a stronger background in templating, maybe Argument Clinic would
be cleaner inside. As it is I'm beating the problem to death with
Larry Hastings added the comment:
Here is the hopefully-final patch for this issue. I incorporated the suggested
changes from Zachary Ware. Also I fixed some "cls" parameters that were
leaking into the signatures. I think this is ready for checkin!
--
Added f
Larry Hastings added the comment:
Closing. Reopen it if you get a reproducible test case with a fresh checkout
of trunk.
--
resolution: -> works for me
stage: -> committed/rejected
status: open -> closed
___
Python track
Larry Hastings added the comment:
Thanks for the report. It was an easy fix.
That said, I can't say I'm excited by the idea of a custom converter with a
built-in default value. I hope you know what you're doing!
--
assignee: -> larry
components: +Demos and Tools
Larry Hastings added the comment:
I just want to mention, while we're all thinking about this stuff: I plan to
enhance the Signature object to reflect "optional groups". Right now Signature
objects cannot express parameters that are optional but don't have a publishe
New submission from Larry Hastings:
Boy was I surprised by this:
>>> class C: pass
...
>>> import inspect
>>> inspect.signature(C)
Traceback (most recent call last):
File "", line 1, in
File "/home/larry/src/python/clinic_c_types_hacking/Lib/inspe
Larry Hastings added the comment:
Yury: fire away, either here or in a new issue as is best. (Sorry, brain
mildly fried, not sure what would be best issue-tracker hygiene.)
--
___
Python tracker
<http://bugs.python.org/issue17
Larry Hastings added the comment:
__new__ and __init__ methods are very special. They can't have signatures,
because the mechanism we use to store the signatures won't work. (We hide them
as a special first line of the docstring, and __new__ and __init__ can't have
custom d
Larry Hastings added the comment:
If we need a special case for user classes without __new__ or __init__, then do
that. But I wouldn't say we should special case object.__new__ and
object.__init__.
--
___
Python tracker
<http://bugs.py
Larry Hastings added the comment:
inspect.signature(object) works fine in my (not yet posted) latest #20189 patch.
inspect.signature(type) doesn't work, because it's not clear what the signature
for type should be. There's the one-argument and three-argument approaches.
This
Larry Hastings added the comment:
Special cases aren't special enough to break the rules. If the signature of a
metaclass is "(object_or_name, [bases, dict])", then we must not special-case
it to pretend that "(object)" works. I agree it's a bad idea to actu
New submission from Larry Hastings:
I found something curious while experimenting with types tonight.
Everybody knows, if you access a descriptor in a class through the normal
attribute-getting methods, you actually get the result of calling its '__get__'
method. If you want t
Larry Hastings added the comment:
I should add, I see the same results with current trunk and with my handy
Python 3 (currently 3.3.1rc1, huh guess I'm behind).
--
___
Python tracker
<http://bugs.python.org/is
Changes by Larry Hastings :
--
title: Class method descriptors are different between builtin and user classes
-> Not all descriptors are callable
___
Python tracker
<http://bugs.python.org/issu
Larry Hastings added the comment:
Your fix won't work, because release managers call hgtouch from a different
spot, from a private tool called "release.py".
You'll notice that all the 3.4 releases have that hgtouch.pyc file--up until
3.4b2. I already found that bug
1301 - 1400 of 2415 matches
Mail list logo