Larry Hastings added the comment:
I guess we should ask Guido for clarification. But I got the impression that
we could *gently* tweak the signatures of functions if they were not
representable in Python syntax. He thought that giving the parameter of
_sha1.sha1() a default value of b'
Larry Hastings added the comment:
Actually, the documented behavior of itertools.repeat() is that the "times"
argument takes a default of None.
Equivalent to:
def repeat(object, times=None):
...
http://docs.python.org/3/library/itertools.html#iterto
Larry Hastings added the comment:
The fact that "def " isn't Python syntax is, if anything, a mild point in its
favor. I don't want anyone hitting on this by accident. "sig:" isn't Python
syntax either, and yet you your
Larry Hastings added the comment:
Yes, that is how it must work. This is symmetric with pure Python functions:
>>> import inspect
>>> import zlib
>>> def foo(a=zlib.Z_DEFAULT_COMPRESSION): pass
...
>>> st
Larry Hastings added the comment:
I missed the detail that you were working with a patch applied.
I suspect the problem is, you misspelled one of the expressions you provided as
a default value. Try str(inspect.signature(x)) on every function you
converted. I bet one of them will throw an
Larry Hastings added the comment:
> This is because in pure Python functions we have no enough
> information. I believe than origin expression is more useful
> in the help.
That doesn't matter. inspect.Signature would have to change in order to
provide the original expression
Larry Hastings added the comment:
- the concept of a nullable thing in Python doesn't exist; why not "optional"?
That's not what it means. Python parameters are "optional" if they
have a default value. These parameters are "nullable", in the sense
that
Larry Hastings added the comment:
This problem been independently rediscovered by people converting
code to Argument Clinic. A Python signature can't express these
semantics, where a parameter behaves differently depending on
whether it's passed in by keyword or by reference. S
Larry Hastings added the comment:
> int(or_none=True) ?
Yes, that is a different name that seems to mean much the same thing.
> Hmm, do we have a getargs.h ?
No. Would it help if I attached the output of "ls Include"
to this issue?
> > > - boolean fields can
Larry Hastings added the comment:
Fix attached. Might as well.
--
Added file: http://bugs.python.org/file33639/larry.nullable.ints.draft.3
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
When AC moves from internal-only tool to supported tool we'll want to convert
the xx stuff. But yeah I reckon it makes sense to not convert them yet. The
list of files is really more "here's the list of stuff to check out and convert
if ne
Larry Hastings added the comment:
> > Yes, that is a different name that seems to mean much the same
> > thing.
> and which is much more understandable by a Python developer.
Thanks for your opinion.
> > Changing error to an char and moving it to the end would
> &
New submission from Larry Hastings:
If I build current trunk on my workstation (Linux 64-bit, Ubuntu 13.10) then run
% ./python -m test -u all test_curses
I get a traceback. Here's the interesting part:
File "/home/larry/src/python/buildtrunk/Lib/test/test_curses.py"
New submission from Larry Hastings:
The signatures for builtins are stored as text and interpreted at runtime on
demand. inspect.Signature gets the default value for a parameter as a text
string, which it evaluates (by hand, in a highly constrained way) to produce
the parameter's
Larry Hastings added the comment:
I've worked your changes into the patch for #20189.
--
___
Python tracker
<http://bugs.python.org/issue20313>
___
___
Pytho
Larry Hastings added the comment:
At last, my refreshed patch. Changes from the previous patch:
* Had another mildly bright idea. The name "PyTypeObject *cls"
is a holdover from < Python 2.2 days, before the merging of classes
and types. Now they're both the same thin
Larry Hastings added the comment:
I think it's a fine name, otherwise I would not have chosen it in the first
place. Your high-spirited bikeshedding has been noted and not acted upon. I
have no plans to change the name. Please dr
Larry Hastings added the comment:
How many existing occurrences of "or_none" did you find in the CPython tree?
Perhaps we can turn our attention to other languages like SQL and C# and borrow
their term for "value that is allowed to be of a specific type (or types) as
well as
Larry Hastings added the comment:
I'm happy to resolve it before checking in the patch.
A small delta like that doesn't need a full-on review.
If people said "eww" then I'll back it out. Nobody said "eww"
to the "PyModuleDef *module" change (see b
Larry Hastings added the comment:
Drop. It.
--
___
Python tracker
<http://bugs.python.org/issue20341>
___
___
Python-bugs-list mailing list
Unsubscribe:
Larry Hastings added the comment:
I'm not sure why you're asking Nick. Is he the release manager for 3.4?
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
I don't think it's fair to call my responses "snarky". On the other hand, your
suggestion that I view Argument Clinic as "my toy project" is obviously meant
as an insult.
It is fair to call my responses "dismissive",
Larry Hastings added the comment:
My solution for pydoc was to call isroutine() instead of isfunction(), and yes
handle it throwing an exception.
(I just checked, and I wasn't catching TypeError, only ValueError. I'll fix
that in my next patch
Larry Hastings added the comment:
Is this behavior causing problems? How bad is it?
Can I get more opinions about this than just Arfrever and Antoine? Not that I
don't trust their opinions, I just want to see a larger sample size.
--
___
P
Larry Hastings added the comment:
A little more on consistency and inconsistency.
I count 109 tp_new callback functions in CPython, and they overwhelmingly call
the first parameter "PyTypeObject *type" (93 instances). In second place is
"PyObject *self" (9 instances), whi
Larry Hastings added the comment:
We had this discussion already, some months ago. The consensus was to leave it
the way it is.
--
resolution: -> rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Larry Hastings added the comment:
Oops! They should be escaped.
--
___
Python tracker
<http://bugs.python.org/issue20376>
___
___
Python-bugs-list mailin
Larry Hastings added the comment:
For the record, I was actually in favor of swapping them. You can try bringing
it up again on python-dev if you like, but I'm not sure there's anything really
new to say.
--
___
Python trac
Larry Hastings added the comment:
I don't have a patch for this issue. If you're thinking of my "nullable ints"
patch, that was just an experiment. I'd prefer we figure out what we're going
to do on this issue, and we can talk abut conve
Larry Hastings added the comment:
> Note that tp_new is a static method, not a class method (the type
> creation machinery takes care of passing in the right class rather
> than the descriptor machinery)
I admit I didn't know that.
But from a practical perspective, surely you agr
Larry Hastings added the comment:
I'm sorry, but I simply don't have the time to spend to dig it up right now.
It was a while ago and I'm not sure exactly where to look.
I dimly recall it was last year, probably during September-December, and that
both Nick and I were in it.
Larry Hastings added the comment:
Your patch does not address my concern.
My concern is that itertools.repeat doesn't parse its arguments like other
Python functions. It behaves differently depending on whether "times" is
passed by position or by keyword. Therefore its
Larry Hastings added the comment:
Okay, one more diff. I have high hopes for this, but then I had high hopes
yesterday.
Nick, could you review the PyTypeObject changes in this patch? Obviously I'd
love a review of the whole thing, but if you can only make a little time, the
crucial pa
Larry Hastings added the comment:
Maybe I'm not reading this correctly. It looks like the function returns True
if it finds any .c or .h file that contains the string '[clinic input]'. It
doesn't seem to only check files that have changed.
I was considering adding a ch
Larry Hastings added the comment:
Okay, I'm checking this beast in. Hooray! Thanks for your reviews, everybody!
--
I thought it was still possible to introduce objects into Python at runtime
without calling PyType_Ready on their type. If that's true,
then there wouldn't nec
Larry Hastings added the comment:
I just realized, I forgot to fix the bug Zach reported, where help(bound_thing)
should still show the class or self parameter.
I'm going to check this in anyway, and file a fresh bug on myself to
address
New submission from Larry Hastings:
For an object O that are bound to something (either a class or an instance),
help(O) traditionally shows the bound argument. For this code:
class C:
def foo(self, a): pass
c = C()
help(c.foo) would show the signature as "(self, a)&q
Larry Hastings added the comment:
Phew! Thanks again, everybody!
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Larry Hastings added the comment:
The patch from #20189 has landed.
--
___
Python tracker
<http://bugs.python.org/issue17481>
___
___
Python-bugs-list mailin
Larry Hastings added the comment:
The patch from #20189 has landed.
--
___
Python tracker
<http://bugs.python.org/issue20223>
___
___
Python-bugs-list mailin
Larry Hastings added the comment:
That's because in f, y is after *args, so it is a keyword-only parameter. Its
default value is in __kwdefaults__. If you move y to before *args, its default
will be in __defaults__.
This is working as designed.
--
nosy: +larry
resol
Larry Hastings added the comment:
Okay, then yes, let's save this for 3.5. Thanks!
--
___
Python tracker
<http://bugs.python.org/issue20355>
___
___
Pytho
Larry Hastings added the comment:
I can start citing data points if you like.
socket.if_indextoname just calls PyLong_AsUnsignedLong(). Not sure what that
throws.
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Remove the winreg.
On Jan 24, 2014 8:02 AM, Zachary Ware wrote:
>
>
> New submission from Zachary Ware:
>
> The fix for #20189 broke simple expression defaults. Specifically, with the
> latest #20172 patch applied, Clinic fails on winre
Larry Hastings added the comment:
Let's not catch Exception there. Does catching NameError make the problem go
away?
And, #20189 changed the rules for simple expressions. Now names you want from
the local module should not have the name of the module in front. You wouldn't
have
Larry Hastings added the comment:
How about I add the "if type == " checks as per #1486663?
--
___
Python tracker
<http://bugs.python.org/issue20385>
___
___
Larry Hastings added the comment:
I agree.
--
___
Python tracker
<http://bugs.python.org/issue20209>
___
___
Python-bugs-list mailing list
Unsubscribe:
Larry Hastings added the comment:
Huh. So inspect.getfullargspec is the code ignoring whether or not a function
is bound.
Well, help(x) should be consistent, whether x is a bound builtin class instance
or a bound Python class instance. Right now it isn't; it displays the "self
Larry Hastings added the comment:
I think it's a bug that they don't do the subclass check. In practice, nobody
subclasses range and itertools.tee. But they should probably still be fixed.
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
Way ahead of you. The "class" directive will have to change:
class name typedef type_object
On the other hand, this means that Argument Clinic can automatically give the
right type to the default self converter. So most people won'
Larry Hastings added the comment:
It's considered bad form to catch Exception. We should catch the minimum
necessary. If there are exceptions we forgot, people will complain and then
we'll add those.
Also, I want to make sure (if possible) that the value round-trips correctly
th
Larry Hastings added the comment:
How about this? I'm going to do a rollup patch today with three fixes: this,
#20385, and changing the default filename for the "file" destination.
--
Added file:
http://bugs.python.org/file33692/larry.clinic.rollup.ja
Larry Hastings added the comment:
How about this? I'm going to do a rollup patch today with three fixes: this,
#20381, and changing the default filename for the "file" destination.
--
Added file:
http://bugs.python.org/file33693/larry.clinic.rollup.ja
Larry Hastings added the comment:
There's a major difference between getfullargspec/getargspec and
inspect.signature: getfullargspec shows you the "self" parameter for bound
methods, and inspect.signature does not.
>>> class C:
...def foo(self, a): pass
...
&g
Changes by Larry Hastings :
--
title: help(bound_builtin_class) does not display self ->
help(instance_of_builtin_class.method) does not display self
___
Python tracker
<http://bugs.python.org/issu
Larry Hastings added the comment:
Yeah, that's a good approach.
By the way, I'm definitely going to check for "unspecified" there. Serhiy was
using that to try and trick Argument Clinic into having optional parameters
without default values. It didn't actually
Larry Hastings added the comment:
Yup! Second time I've done that this week!
--
___
Python tracker
<http://bugs.python.org/issue20379>
___
___
Python-bugs-l
Larry Hastings added the comment:
Yeah, that's a good approach.
--
___
Python tracker
<http://bugs.python.org/issue20381>
___
___
Python-bugs-list m
Larry Hastings added the comment:
Right. So my advice is: only use local symbols and symbols in preloaded
modules.
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
1) That's not a bug, that's the API. If you used the dynamic API to create a
type it wouldn't take the &. So I can't guess in advance what type it is, nor
can I assume I always
Larry Hastings added the comment:
If you use a self converter you can name your first parameter anything you like.
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
So, are you still claiming there's a bug here? Or can we close this?
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
The logic of the patch is hard to follow. However, it's still examining the
size of args, and now it's examining the size of kwargs, and behaving
differently based on these sizes is exactly what I don't want.
I've attached an example
Larry Hastings added the comment:
You should only put one line of equals signs? I'll try to remember that in the
future. LGTM. Shall I commit it?
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
If two issues are created on the tracker for the same issue, surely it's the
*older* issue that is preserved, and the new one marked as duplicate and closed?
--
___
Python tracker
<http://bugs.python.org/is
Changes by Larry Hastings :
--
resolution: -> invalid
stage: -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Larry Hastings added the comment:
I think you've understood it.
The problem is, in order to deprecate the behavior, we first must provide the
new behavior. (That's official policy, in PEP 5.) It's untenable to say
"you'll have to stop using 'times=-1
Larry Hastings added the comment:
You didn't give me a test case, and I can't reproduce this. Either it was
accidentally fixed already, or there's something else going on in your test
case.
I'm closing this for now as unreproducable. If you see the problem again,
plea
New submission from Larry Hastings:
Rollup patch with a bunch of small fixes in it. Can I get a quick turnaround
review on this? I'd like it to go in before today's beta is cut. Definitely
the core change has to go in, but that's uncontroversial.
Core:
* _PyType_GetDoc
Larry Hastings added the comment:
The bug you cited is fixed in today's rollup patch, #20390. (I don't know how
to denote the dependency between the two issues, maybe someone else can do that
for me?)
--
___
Python tracker
<http://bu
Larry Hastings added the comment:
The bug you cited is fixed in today's rollup patch, #20390. (I don't know how
to denote the dependency between the two issues, maybe someone else can do that
for me?)
--
___
Python tracker
<http://bu
Larry Hastings added the comment:
You didn't supply a test case, nor is there any code checked in that reproduced
the issue. I had to make a test case by hand.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
Thanks for the reviews, Nick and Serhiy, especially considering that the
Rietveld link didn't work!
Serhiy: I believe I fixed everything. There are no side files checked in yet.
Can you give me another review?
--
Added file:
http://bugs.pytho
Changes by Larry Hastings :
Removed file:
http://bugs.python.org/file33710/larry.clinic.rollup.jan.25.diff.2.txt
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
Hang on, my tree was out of date. Which is why I didn't get a review link,
duh. And if side files have appeared I'll fix 'em.
--
___
Python tracker
<http://bugs.pyt
Larry Hastings added the comment:
Okay, here's my revised patch, for real this time, with "hg mv" for the side
files and everything.
--
Added file:
http://bugs.python.org/file33711/larry.clinic.rollup.jan.25.diff.2.txt
___
Python
Larry Hastings added the comment:
Can you try locally applying my patch for #20390 and seeing if you still have
the problem? I tried applying it to the itertoolmodule.c you attached to the
issue and it seemed to fix the problem.
--
___
Python
Larry Hastings added the comment:
Oops, I goofed up moving _lzamodule.clinic.c.h. I'll fix that locally, won't
regenerate the patch just for that (unless you ask me to).
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
No, wait, I think it's fine, it was just some detritus in my directory throwing
me off. But "hg stat" looks correct.
--
___
Python tracker
<http://bugs.pyt
Larry Hastings added the comment:
Christian Heimes just posted this to python-dev:
Coverity has detected an issue in this commit:
** CID 1164423: Division or modulo by zero (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in
Larry Hastings added the comment:
I haven't looked at this in depth but it sounds like this is a legitimate
concern. I'd like it fixed for 3.4, preferably before rc1.
--
nosy: +larry
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
You can check those in for 3.4. Do it right now and you can get them in for
beta 3.
Sorry for the tardy reply!
--
___
Python tracker
<http://bugs.python.org/issue20
Larry Hastings added the comment:
I don't know why it's refusing to generate the review link. The patch applies
cleanly to trunk, even now, hours later. Maybe it doesn't like file moves?
--
___
Python tracker
<http://bugs.pyt
Changes by Larry Hastings :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Larry Hastings :
--
stage: commit review -> committed/rejected
___
Python tracker
<http://bugs.python.org/issue20226>
___
___
Python-bugs-list mai
Larry Hastings added the comment:
Raymond said "The preferred behavior is that a negative number always means 0."
My proposal honors that.
We certainly aren't changing this in 3.3 and 2.7, and as release manager for
3.4 I'm pretty sure we aren
Larry Hastings added the comment:
I changed the unit test so it doesn't specify a minium row/column greater than
the maximum row/column. The tests now pass. So I'm calling this good. Thanks
for looking in to it, Zachary and Nadeem!
--
assignee: -> larry
resolution: -
Larry Hastings added the comment:
I don't know about diff #1, but diff #2 definitely applied cleanly against a
fresh trunk at 8:22pm local time. I've turned off git format.
--
___
Python tracker
<http://bugs.python.o
Larry Hastings added the comment:
Alexandre: We're still figuring out best practices with Argument Clinic. So,
right now, there's no standard policy of "where should we put all the generated
code?", and we're leaving it up to the owners of the individual modules.
Pu
Larry Hastings added the comment:
We're not allowing changes in semantics for Argument Clinic conversion for 3.4.
If it doesn't currently accept None, we can't add it right now, and we'll have
to save it for 3.5.
--
___
P
Larry Hastings added the comment:
I nominate this text:
**
To make these errors go away, merge the contents of
"build/suspicious/suspicious.csv" to "tools/sphinxext/s
Larry Hastings added the comment:
Since Ezio asked me, I guess I wasn't clear:
This message should be displayed at the bottom, after the errors, and only when
there are alleged suspicious documentation activities.
--
___
Python tracker
Larry Hastings added the comment:
Here's a first cut at a patch. All signatures now start with "sig=(".
I also added a special marker: if the first parameter starts with "$", we know
for certain it's a "self" (or "module" or "type"
Larry Hastings added the comment:
Georg: you're accepting this patch into 3.3? I'm surprised.
I would only want the "soft" approach. But I haven't said "yes" yet. I want
to discuss it a little more. (Hey, it's python core dev.
Larry Hastings added the comment:
You can do it, if I accept the patch for 3.4. There's no point in doing it in
two stages.
--
___
Python tracker
<http://bugs.python.org/is
Larry Hastings added the comment:
Alternatively, we could use this cheap hack:
/*[python input]
class hidden_object_converter(object_converter):
show_in_signature = False
[python start generated code]*/
/*[clinic input]
module _sre
class _sre.SRE_Pattern "PatternObject *" &quo
Larry Hastings added the comment:
Nick: you lost me. Change the macro how? What is the redundant info? I
already changed those macros so they generate signatures, both currently in
trunk and in my patch.
--
___
Python tracker
<h
Larry Hastings added the comment:
Stefan: I made the change. I left "Implements " alone as "Implement
" sounded wrong, but all the rest dropped their s's.
--
___
Python tracker
<http:
New submission from Larry Hastings:
A minor bug, but still one that could cause confusion. It's already bitten me
once.
If I change the code generator in clinic.py, then --make everything, files
using the "file" destination often won't change. All the changes to the
ge
Larry Hastings added the comment:
Can we use unicode characters? I'd like little ships, or U+1F4A9.
--
___
Python tracker
<http://bugs.python.org/is
1401 - 1500 of 2389 matches
Mail list logo