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
Larry Hastings added the comment:
The construction of release.py would make it easy to just always pass it in
when running Python (and hg, and any program). Maybe that's a better choice.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
I don't understand the problem--you didn't give me enough context. Can you
attach a file that demonstrates the problem?
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
Does your proposed solution work properly when docstrings are turned off? Try
undefining WITH_DOC_STRINGS. I bet you need to make the size 1 in that case.
Also, the length must be len(f.docstring) + 1, to account for the trailing \0.
Also, error C2133
Larry Hastings added the comment:
Serhiy: PyDoc_VAR is used in the "two-pass" approach as a forward declaration
for docstrings. Imagine if, in winsound.c, sound_methods was defined above the
"dump buffer" block. The expansion of WINSOUND_PLAYSOUND_METHODDEF would
in
Larry Hastings added the comment:
If you want to make sure that happens, please review my next patch for #20189,
or fix it after that patch goes in if I forget. (Honestly it's hard for me to
keep track of everything right now.)
--
resolution: -> duplicate
stage: ->
Larry Hastings added the comment:
Argh. I lost 1.5 day's worth of work on revision 6 of this patch last
night, due to me being tired and over-aggressively cleaning my working
directories. I will have to reconstruct it from memory, hopefully
Tuesday. (I basically know what I did, and
New submission from Larry Hastings:
Sorry this is so long--but I wanted to make my point. Here's the tl;dr summary.
The problem: The syntax used for Argument-Clinic-generated text
signatures for builtins means CPython mistakenly identifies
hand-written, unparsable pseudo-signatur
Larry Hastings added the comment:
Confirmed, and yes it's low priority.
--
___
Python tracker
<http://bugs.python.org/issue20303>
___
___
Python-bugs-list m
Larry Hastings added the comment:
If in C you define
static char a[5] = "abcde"
C suppresses the trailing '\0'. That it continued to work okay was a lucky
break--you must not have looked in many docstrings, or you lucked out and they
happened to b
Larry Hastings added the comment:
I had to throw it in a struct to prevent gcc from rearranging the variables.
But this demonstrates the problem--when it prints the string, it doesn't stop
at the end.
-
#include
typedef struct
{
int a;
char b[8];
int c;
}
Larry Hastings added the comment:
Serhiy: I'm going to add PEP 457 features to the text signature, because
without them the inspect.Signature objects will be wrong. So __doc__ and
__text_signature__ would have to remove those first before handing the string
to ast.parse.
I wasn't
Larry Hastings added the comment:
/*[clinic input]
brett_is_stinky_and_wrong
l: long
[clinic start generated code]*/
PyDoc_STRVAR(brett_is_stinky_and_wrong__doc__,
"brett_is_stinky_and_wrong(l)");
#define BRETT_IS_STINKY_AND_WRONG_METHODDEF\
{"brett_is_s
Larry Hastings added the comment:
Is this waiting on something? I agree that we can't change the behavior
of existing functions. But your new converters should raise ValueError.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
Also, you didn't remove the _ in front of "Converter" in the names, e.g
"_PyLong_UnsignedShort_Converter" should be "_PyLong_UnsignedShortConverter".
--
___
Python tracker
Larry Hastings added the comment:
Actually, here's another data point to consider. The underlying implementation
of PyArg_Parse* is the function convertsimple() in Python/getargs.c. For all
the non-bitwise integer format units ('bhi'), if they overflow or underflow the
nati
Larry Hastings added the comment:
Well, they're going to have to change somehow, because the concepts of "left"
and "right" are going away (see #20303). However, your suggested new name for
these functions would be awful for large groups. Consider
curses.window
Larry Hastings added the comment:
When I fix #20303, the new rules will be:
* You can have top-level optional groups anywhere.
* You may nest up to one nested group in a group.
* Whenever you nest a group in another group, all nested groups in that
stack must favor the same side (left or right
Larry Hastings added the comment:
That problem will be irrelevant, once builtin classes support signatures
(#20189).
--
___
Python tracker
<http://bugs.python.org/issue20
New submission from Larry Hastings:
Attached is a *preliminary* patch for Argument Clinic that adds nullable ints.
If you use the converter "int(nullable=True), then:
* The type you get back is not int but "nullable_int_t", a structure
containing three fields: "error
Larry Hastings added the comment:
I should have mentioned--a sample using nullable ints is in itertoolsmodule.c.
longobject.{ch} changed to add the converters, and obviously clinic.py changed
to add support for the converters.
--
___
Python
Larry Hastings added the comment:
The bug you saw was an easy fix; the converter function needs to return 1
(success) from the "== Py_None" branch.
And yes, more unit tests would be good, fixing the documentation would be good
too. I did say the patch was nowhere near ready.
I w
Larry Hastings added the comment:
Then you disagree with Guido, who says that optional integer arguments without
a viable publishable default value should accept None to mean "use the default
value":
https://mail.python.org/pipermail/python-dev/2014-January/131673.html
https://mail.
Larry Hastings added the comment:
I'll fix the "return NULL" problem. However, you are using optional groups in
the list __init__. The original doesn't use them. Please stop using optional
groups in functions tha
1301 - 1400 of 2389 matches
Mail list logo