Serhiy Storchaka added the comment:
And
'print(hash(eval(%s.decode(utf-8' % repr_.encode(utf-8)
can be simplified to
'print(hash(eval(%a)))' % repr_
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20363
New submission from Serhiy Storchaka:
Argument Clinic copies backslashes in docstrings as is. This can produce wrong
or even invalid C string. Either backslashes should be escaped, or current
behavior should be documented.
--
components: Demos and Tools
messages: 209044
nosy: larry,
New submission from Serhiy Storchaka:
For now most hand-written functions which use Argument Clinic have the _impl
suffix and generated wrapper functions without the _impl suffix are less
interested and visible to developer (generated *_METHODDEF macros are used in
method list). I propose to
Vajrasky Kok added the comment:
Here is the updated patch of codecsmodule, based on Larry's review. Thanks! I
didn't realize clinic releases pybuffer implicitly. I also turned
_codecs.Codecs to _codecs since all of these methods are module methods.
--
Added file:
Vajrasky Kok added the comment:
Updated marshal patch. I just learned we don't need to release pybuffer (y*)
manually.
--
Added file: http://bugs.python.org/file33678/clinic_marshal_v3.patch
___
Python tracker rep...@bugs.python.org
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 rep...@bugs.python.org
Larry Hastings added the comment:
Oops! They should be escaped.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20376
___
___
Python-bugs-list
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 tracker
Vajrasky Kok added the comment:
Serhiy said, Why do you cast PyDict_Size(kwds) to int?
Sorry, Serhiy! Today I just realized there is your review for this ticket. I
couldn't really remember but I think I got conversion warning if I did not
downcast it. Something about I shouldn't not have
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 conversion to Argument Clinic later.
--
Ram Rachum added the comment:
I like the patch. Except I'd like to have support for the 'x' flag in the
`write_text` and `write_bytes` methods. I suggest an argument `exclusive`,
which defaults to `False`. When `exclusive=True`, the mode will be 'x' or 'xb'.
The first lines after each method
Vajrasky Kok added the comment:
Here is the updated patch based on Ezio's review. Sorry, for a long time, I
didn't notice you had reviewed my code, Ezio. Thanks for the review!
--
Added file:
http://bugs.python.org/file33679/fix_resource_warning_read_mime_types_v3.patch
Ned Deily added the comment:
The checked-in fixes break builds on OS X that use the Apple-supplied libedit
readline compatibility layer. See, for example:
http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/1077/steps/compile/logs/stdio
gcc -fno-strict-aliasing
STINNER Victor added the comment:
Guido van Rossum added the comment:
I've lost some context, but perhaps we should have the notion of
granularity of the poll/select timeout (e.g. 1 msec), and consider
events that are in the future by less than that granularity as ready?
Then we can round
Vajrasky Kok added the comment:
Here is the updated patch. I try to be conservative here, preserving the
current behaviour.
Negative times is same as zero.
Default value (which can be passed by omitting times) means unlimited.
I did not change the signature repeat(object [,times]) because the
Vajrasky Kok added the comment:
def repeat(object, times=-1): = it could break the code in the wild.
Current behaviour: repeat(object) - unlimited, repeat(object, -1) - 0
repetitions.
--
___
Python tracker rep...@bugs.python.org
Nick Coghlan 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)
--
___
Python tracker rep...@bugs.python.org
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 agree that tp_new
Serhiy Storchaka added the comment:
Could you please provide a link on this discussion? There were too many
discussions and I had quickly lost them.
Argument Clinic was changed too much for last weeks, so perhaps consensus is
changed.
--
___
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. It was probably
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 actual calling
Nick Coghlan added the comment:
It doesn't act like a class method, though, it acts like a static method:
int.__new__()
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: int.__new__(): not enough arguments
int.__new__(int)
0
You have to
Nick Coghlan added the comment:
(Also, I can't give you a solid reason for *why* it's like that - Guido just
wrote it that way, and the type machinery is hairy enough that I have no
intentions of second guessing him on that one)
--
___
Python
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: -serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20218
___
___
Nick Coghlan added the comment:
Oh, yes, now I remember - it *has* to be that way, otherwise upcalls from
subclass __new__ methods don't do the right thing (int.__new__(MyInt), etc),
just as you need to pass the current type in explicitly for cooperative super
calls. This is perhaps *the*
Serhiy Storchaka added the comment:
What if remove casts at all? Ned, is it compiled with libedit?
--
keywords: +patch
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file33682/readline_func_cast.patch
___
Python tracker
Roundup Robot added the comment:
New changeset b3eaeb4bdf84 by Nick Coghlan in branch '3.3':
Issue 20317: Remove debugging code from contextlib
http://hg.python.org/cpython/rev/b3eaeb4bdf84
New changeset a0bf53afedfa by Nick Coghlan in branch 'default':
Merge removal of issue 20317 debugging
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 part is
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 checkum for the *input*
Nick Coghlan added the comment:
Scanned the whole patch, especially the type changes. This looks like a solid
approach to me.
For 3.5, PEP 457 might want to consider proposing a tp_sig slot and splitting
the signature out at type creation time rather than on attribute lookup. The
current
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 necessarily *be* a
Nick Coghlan added the comment:
Yury, I believe the review comments from Rietveld go to the address you have
registered as primary in the tracker, so that's currently your address with the
.ml suffix rather than your main one.
My only suggestion was to use ._partialmethod for the attribute
Nick Coghlan added the comment:
As far as pushing goes, I'd wait until Larry lands issue 20189 - I suspect
there's a risk of conflict between these patches in the inspect module, and
that one is key to getting builtin signatures supported properly :)
--
dependencies:
Nick Coghlan added the comment:
There are probably still ways to do it, but we don't *support* doing it (and
I'm pretty sure we've fixed them all in the builtins and stdlib).
However, yes, that's another good reason to be conservative in only doing the
split into signature+doc at attribute
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 that.
--
Nick Coghlan added the comment:
Another case of don't land it until Larry has dealt with the builtins.
The patch itself looks fine, though :)
--
dependencies: +inspect.Signature doesn't recognize all builtin types
___
Python tracker
Changes by Ram Rachum r...@rachum.com:
--
components: Library (Lib)
nosy: cool-RR
priority: normal
severity: normal
status: open
title: Implement `Signature.__repr__`
versions: Python 3.5
___
Python tracker rep...@bugs.python.org
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), even
Larry Hastings added the comment:
Phew! Thanks again, everybody!
--
resolution: - fixed
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20189
Roundup Robot added the comment:
New changeset 85710aa396ef by Larry Hastings in branch 'default':
Issue #20189: Four additional builtin types (PyTypeObject,
http://hg.python.org/cpython/rev/85710aa396ef
--
nosy: +python-dev
___
Python tracker
Larry Hastings added the comment:
The patch from #20189 has landed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17481
___
___
Larry Hastings added the comment:
The patch from #20189 has landed.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20223
___
___
Glenn Langford added the comment:
Proposed patch for as_completed(). #20369 fixes wait(), and behaviour is
consistent between the two.
--
keywords: +patch
Added file: http://bugs.python.org/file33684/issue20367.patch
___
Python tracker
STINNER Victor added the comment:
Proposed patch for as_completed().
Could you please try to write a unit test. The unit test should fail without
the patch, and fail with the patch. Then create a new patch including the patch.
If it's tricky to write a reliable test reproducing the race
New submission from Ram Rachum:
Check the following example out. Putting *args in a function makes its
__defaults__ be empty.
Python 3.4.0b2 (v3.4.0b2:ba32913eb13e, Jan 5 2014, 16:13:26) [MSC v.1600
64 bit (AMD64)] on win32
Type help, copyright, credits or license for more
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
resolution: -
Ram Rachum added the comment:
Though perhaps a note in the documentation would be helpful for future confused
people.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20380
___
Ram Rachum added the comment:
My mistake. Thanks for the clarification.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20380
___
___
Brett Cannon added the comment:
I agree with Antoine; this can wait for Python 3.5.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20355
___
___
Larry Hastings added the comment:
Okay, then yes, let's save this for 3.5. Thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20355
___
___
Glenn Langford added the comment:
Could you please try to write a unit test.
Revised patch with unit test for as_completed().
--
Added file: http://bugs.python.org/file33685/issue20367.patch
___
Python tracker rep...@bugs.python.org
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 rep...@bugs.python.org
http://bugs.python.org/issue20260
STINNER Victor added the comment:
Hum, you should also modify the documentation to explicit the
behaviour. Example: Duplicates futures are only yielded once.
You may add the same sentence in the asyncio.as_completed()
documentation. It looks like asyncio tests doesn't test as_completed()
with
New submission from Zachary Ware:
The fix for #20189 broke simple expression defaults. Specifically, with the
latest #20172 patch applied, Clinic fails on winreg.c at winreg line 1351 with
this traceback:
Error in file PC\winreg.c on line 1351:
Exception raised during parsing:
Traceback
Ned Deily added the comment:
Serhiy, I'm not sure I understand your question. libedit includes a GNU
readline compatibility layer and that is what _readline.so builds and links
with on OS X systems (with an ABI of 10.5 and later) since OS X does not ship
with GNU readline. This is also the
Serhiy Storchaka added the comment:
With your patch, _readline.so again builds correctly.
Yes, this is what I wanted to know. Sorry for the awkward formulation.
Type casting is dangerous because it may hide the signature mismatch, which
can cause problems later in run time. It is better to
Benjamin Peterson added the comment:
Okay then. Off we go.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20374
___
___
Python-bugs-list mailing
Roundup Robot added the comment:
New changeset 5e42e5764ac6 by Benjamin Peterson in branch '2.7':
new plan: just remove typecasts (closes #20374)
http://hg.python.org/cpython/rev/5e42e5764ac6
New changeset fc62fcd8e990 by Benjamin Peterson in branch '3.3':
new plan: just remove typecasts
New submission from mailination:
python/Modules/cStringIO.c:648
cStringIO.StringI,/*tp_name*/
maybe Should be
cStringIO.StringIO,/*tp_name*/
--
components: Library (Lib)
messages: 209099
nosy: mailination
priority: normal
severity:
New submission from Brett Cannon:
Would allow for the name attribute to be optional since it can be grabbed from
the spec. Since having module.__spec__ set is now expected we should help
ensure that by supporting it in the constructor.
--
components: Library (Lib)
messages: 209100
STINNER Victor added the comment:
I don't think that it is a typo. cStringIO.StringIO(str) returns a StringI
object, whereas cStringIO.StringIO() returns a StringO object.
$ python
Python 2.7.5 (default, Nov 12 2013, 16:45:54)
[GCC 4.8.2 20131017 (Red Hat 4.8.2-1)] on linux2
Type help,
Glenn Langford added the comment:
Thanks for the feedback. The new patch is modified for PEP8 with naming
consistent with other concurrent tests. assertEqual I think is clearer by
checking list length, so it is not changed. The docstring is updated.
I suggest asyncio be handled separately.
Zachary Ware added the comment:
This also prevents a vanilla trunk build (as of 85710aa396ef) from succeeding
at 'Tools/clinic/clinic.py --make':
Error in file .\Modules\_sre.c on line 574:
Unsupported expression as default value: 'sys.maxsize'
I think the only reasonable check we can do is
Zachary Ware added the comment:
This should do it, correct?
--
keywords: +patch
nosy: +zach.ware
Added file: http://bugs.python.org/file33688/issue20376.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20376
Serhiy Storchaka added the comment:
Here are updated patches for 3.3 and 3.4. Changed tests for 3.4, a patch for
3.3 is changed more. Unfortunately in 3.3 exceptions still can be raised when
try to emit a warning during shutdown. Is there any way to determine the
shutdown mode?
--
Derek Wilson added the comment:
sslv2 should not be deprecated yet.
in the field of security research it is highly valuable to locate servers that
are still using sslv2 because it is a security risk.
i'm fine with making it not used by default, but there is no reason to remove
the capability
Antoine Pitrou added the comment:
Thanks for the insight. Then I suggest to close this issue as postponed or
rejected.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20209
___
Terry J. Reedy added the comment:
What matters to other programs is what the inspect functions return, not what
help() does or does not do to the returned string before displaying it. So I
see the issue as the discrepancy in this.
class C:
def foo(self, a): pass
c = C()
import inspect
New submission from Serhiy Storchaka:
On Linux for 2.7, 3.3 and 3.4 the open of non-existing file raises an exception
which contains file name.
Python 2.7:
open('non-existing', 'rb')
Traceback (most recent call last):
File stdin, line 1, in module
IOError: [Errno 2] No such file or
Mark Lawrence added the comment:
Not on my system, so what's changed?
Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32 bit
(Intel)] on win32
Type help, copyright, credits or license for more information.
open('non-existing', 'rb')
Traceback (most recent call last):
Serhiy Storchaka added the comment:
Mark, could you please try following commands?
import tarfile; tarfile.open('non-existing', 'r|')
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
Changes by Serhiy Storchaka storch...@gmail.com:
--
components: +Windows
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +brian.curtin, tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
___
___
New submission from Terry J. Reedy:
Signature.__repr__ already exits. It is inherited from object. So you must be
proposing to override the inherited method. For what purpose? With what outcome?
Without reading the signature PEP, I believe the current difference between str
and repr is
Mark Lawrence added the comment:
Two attempts, one with the pipe | symbol in the mode, one without.
import tarfile; tarfile.open('non-existing', 'r|')
Traceback (most recent call last):
File stdin, line 1, in module
File C:\Python33\lib\tarfile.py, line 1594, in open
stream =
Ram Rachum added the comment:
My impression is that the `__repr__` method of any object is intended to
describe that object, hopefully in a succinct way, possibly in a REPL-friendly
way (like `list.__repr__` for example) but if not then at least
human-friendly. This is for easy
Serhiy Storchaka added the comment:
Ah, here is os.open() raises an exception. Thank you Mark.
On Linux it raises an exception with file name.
import os; os.open('non-existing', os.O_RDONLY | getattr(os, 'O_BINARY',
0), 0x666)
Traceback (most recent call last):
File stdin, line 1, in
Roundup Robot added the comment:
New changeset 69d885ac042d by Serhiy Storchaka in branch '3.3':
Issue #20384: Fix the test_tarfile test on Windows.
http://hg.python.org/cpython/rev/69d885ac042d
--
nosy: +python-dev
___
Python tracker
Mark Lawrence added the comment:
I think there's a typo in the patch, test = 'xxx' but after the check for
platform and mode, text = ''.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
Serhiy Storchaka added the comment:
Yes, thank you. It is alredy fixed in 38a50d8102be (thanks Arfrever).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
title: open() exception doesn't contain file name on Windows - os.open()
exception doesn't contain file name on Windows
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20384
Zachary Ware added the comment:
I don't think there's any danger of changing inspect.Signature's behavior here;
it's doing the right thing. What we're concerned with here is just making sure
that the output of 'help(some_kind_of_method)' is equivalent to the output of
Larry Hastings added the comment:
Remove the winreg.
On Jan 24, 2014 8:02 AM, Zachary Ware rep...@bugs.python.org wrote:
New submission from Zachary Ware:
The fix for #20189 broke simple expression defaults. Specifically, with the
latest #20172 patch applied, Clinic fails on winreg.c
Zachary Ware added the comment:
Removing 'winreg.' gives the very similar traceback:
Error in file PC\winreg.c on line 1351:
Exception raised during parsing:
Traceback (most recent call last):
File Tools\clinic\clinic.py, line 1541, in parse
parser.parse(block)
File
New submission from Tal Einat:
To quote issue20294 where Larry Hastings added AC support for __new__ and
__init__:
* __init__ and __new__ always take kwargs.
* if the function signature doesn't accept keyword arguments,
it calls _PyArg_NoKeywords().
However, due to issue1486663, many
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 to do this
Larry Hastings added the comment:
How about I add the if type == our own type checks as per #1486663?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20385
___
Larry Hastings added the comment:
I agree.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20209
___
___
Python-bugs-list mailing list
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20209
___
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
for the
Tal Einat added the comment:
In general, that sounds like a reasonable suggestion to me. A quick search
shows that most classes that call _PyArg_NoKeywords check the type first. I
think we should strive for uniformity in this respect, so I'm +1 for your
suggestion.
I do see some classes
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 rep...@bugs.python.org
Tal Einat added the comment:
Great. Most of the classes in itertools could use this.
BTW, you'll need to supply a way to supply the C name of the type, to use in
the type check.
--
___
Python tracker rep...@bugs.python.org
Zachary Ware added the comment:
How does this one strike you? Somewhat reversed logic compared to the first
patch, but with this one we get either success or a nicely formatted fail
message, no more tracebacks.
--
Added file: http://bugs.python.org/file33691/issue20381.v2.diff
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't have to write
custom
Tal Einat added the comment:
+1 for that as well, I've written quite a few self converters for that reason.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20385
___
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
through eval
New submission from Giampaolo Rodola':
Python 2.7
import socket
socket.SocketType
class 'socket._socketobject'
s = socket.socket()
isinstance(s, socket.SocketType)
True
Python 3.4
socket.SocketType
enum 'SocketType'
s = socket.socket()
isinstance(s, socket.SocketType)
False
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.jan.24.diff.1.txt
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.jan.24.diff.1.txt
1 - 100 of 133 matches
Mail list logo