[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's likely that your global variable gets caught in the traceback attached to the SystemExit, and that either never gets deallocated, or gets deallocated too late. -- nosy: +pitrou ___ Python tracker

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor
New submission from STINNER Victor: When storing an exception in an asyncio Future object, there is a high risk of creating a reference cycle. In Python 3, exception objects store a traceback object which store frame objects. The problem is that a frame can also have a reference to the

[issue15014] smtplib: add support for arbitrary auth methods

2015-07-09 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- assignee: - barry status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15014 ___

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: Doesn't the cycle-detecting GC handle these? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24598 ___ ___

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24598 ___ ___ Python-bugs-list

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor
STINNER Victor added the comment: Hm. If the problem is most prominent with 3.3, why mark the issue as 3.6? Well, I plan to implement this feature in asyncio, so for 3.3-3.6 in fact. Do you have an implementation already? Nope, it's more a TODO task for myself :-) Maybe it can be a 3rd

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Ethan Furman
Ethan Furman added the comment: Is it too late to have the default for that option be to not allow the replacement? That would be the safer course. -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24597

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: OK, no problem. (Side comment: Future is being subclassed a lot, so parametrizing its construction may not be so easy.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24598

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't know. I'm assuming some people actually want to redefine existing specializations. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24597 ___

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor
STINNER Victor added the comment: Doesn't the cycle-detecting GC handle these? Maybe you are lucky and the GC is able to break the cycle. Maybe you are unlucky and all objects part of the cycle will never be deleted. Python 3.4 is better to handle these cases, but Python 3.3 is worse to

[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, the problem is in PyRun_SimpleFileExFlags(). The executed module is decref'ed after calling PyErr_Print(), but the latter never returns when the exception is a SystemExit. -- nosy: +ncoghlan ___ Python

[issue15014] smtplib: add support for arbitrary auth methods

2015-07-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 97a29b86a2dc by Barry Warsaw in branch '3.5': - Issue #15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional https://hg.python.org/cpython/rev/97a29b86a2dc New changeset 2d9003d44694 by Barry Warsaw in branch 'default': - Issue

[issue23319] Missing SWAP_INT in I_set_sw

2015-07-09 Thread Meador Inge
Meador Inge added the comment: I will review this today. -- assignee: - meador.inge stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23319 ___

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Ethan Furman
Ethan Furman added the comment: Sure. I just saying that @f.register(int, replace=True) requires opt-in to replacing, whilst @f.register(int, replace=False) # don't replace if one already exists is still prone to bugs. -- ___ Python tracker

Re: Good python news sites

2015-07-09 Thread Irmen de Jong
On 9-7-2015 11:28, Benj wrote: Hello, could you please recommend some python news sites: sites that post news, code samples, good practices, new libraries... things like that, to follow daily. Thanks, Benj There's a lot of stuff appearing on the Python subReddit;

[issue24595] InteractiveInterpreter always prints to stdout

2015-07-09 Thread R. David Murray
R. David Murray added the comment: Does it not work to create an unbuffered makefile object from the socket and assign that to stdout? Regardless, if you need to set it and restore it around runcode you can use super() to call the base class method. I think providing an easier API to change

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread R. David Murray
R. David Murray added the comment: Yes it is too late. You'd have to do a couple of deprecation cycles to change the default. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24597

[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread Stefano Mazzucco
Stefano Mazzucco added the comment: I have run the minimal example provided on both Python2 and Python3 with the same results. Sorry if that was not clear. I did look at issue 1424152 but it seemed to me that I was experiencing a different problem. When I try and open the page, I get a squid

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, but I wasn't suggesting to add an argument to the .register() call, but to the singledispatch() call; i.e. it would be a function-wide parameter. -- ___ Python tracker rep...@bugs.python.org

[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread Stefano Mazzucco
New submission from Stefano Mazzucco: Hello, at work, I am behind a proxy (squid) that is only available over http. So, I have to configure both the http_proxy and https_proxy environment variables to be something like http://proxy.corp.com:8181; Now, when I try and use urllib to open an

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Ethan Furman
Ethan Furman added the comment: Ah, I see. So you say up-front if you are willing to have redefinition occur later. That doesn't feel like a consenting-adults attitude, and could also make testing harder. I prefer adding an option to the register method, and move towards making the default

[issue24583] set.update(): Crash when source set is changed during merging

2015-07-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps the incref/decref pair ought to be moved into PyObject_RichCompareBool(). This wouldn't help because key can be used after PyObject_RichCompareBool(). -- ___ Python tracker rep...@bugs.python.org

[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread R. David Murray
R. David Murray added the comment: It is not clear from your description if you actually tested it with python3. In python2, I believe urllib does not support this (see issue 1424152) while urllib2 does. Assuming you have, I wonder if the not implemented error is your squid saying it

[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Sven R. Kunze
Sven R. Kunze added the comment: ... this sounds like it is encouraging staying ignorant. True. However, I being ignorant about the complexity eventually led to the development of high-level languages like Python. Each time, a next generation simply asks the question: 'does it really need to

module dependencies issues

2015-07-09 Thread Cyril Scetbon
Hi, I use pip to install modules and setuptools to install dependencies, and generate a console_script using the entry_point parameter of setup. Here is the issue : my current sources depend on modules, let's say A=1.0, B=1.0, C=2.0. And C depends on B=1.1 I have no problem with using pip to

[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Stefan Behnel
Stefan Behnel added the comment: It's generally worth running the benchmark suite for this kind of optimisation. Being mostly Python code, it should benefit quite clearly from dictionary improvements, but it should also give an idea of how much of an improvement actual Python code (and not

Re: (side-)effects and ...

2015-07-09 Thread Michael Torrie
On 07/09/2015 08:05 PM, Chris Angelico wrote: I thought so at first add well. It looks like the Mailman system handles the X-No-Archive and/or Archive headers. I couldn't find his name in this month's archive. Even if it respects that, there's no way that Mailman can know to respect his

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-07-09 Thread Michael Torrie
On 07/09/2015 02:42 PM, Marko Rauhamaa wrote: Skip Montanaro skip.montan...@gmail.com: It makes perfect sense to me that TAB and Ctrl-TAB would generate the same keycode, as TAB is itself a control character (Ctrl-I). As the Ctrl modifier bit is effectively already set, I don't think you can

[issue24601] bytes and unicode splitlines() methods differ on what is a line break

2015-07-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Jul 10, 2015 at 02:18:33AM +, Gregory P. Smith wrote: for bytes, \v (0x0b) is not considered a line break. for unicode, it is. [...] I think these should be consistent. I'm not sure that they should. Unicode includes other line breaks which

[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread JohnLeitch
JohnLeitch added the comment: Attaching repro. -- Added file: http://bugs.python.org/file39889/SRE_SEARCH_Integer_Underflow.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24602 ___

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Joshua Harlow
Joshua Harlow added the comment: Out of curiosity what reference cycles can't be broken in various python versions? Is it documented/explained anywhere? -- nosy: +Joshua.Harlow ___ Python tracker rep...@bugs.python.org

Re: Evaluation order

2015-07-09 Thread Terry Reedy
On 7/9/2015 8:10 PM, candide wrote: The official doc explains that : Python evaluates expressions from left to right. cf. https://docs.python.org/3.3/reference/expressions.html#evaluation-order But consider the following snippet : t=[2020, 42, 2015] t*(1+int(bool(t.sort( [42, 2015,

[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread JohnLeitch
JohnLeitch added the comment: Attaching proposed patch for unit tests to cover this issue. -- Added file: http://bugs.python.org/file39888/test_re.py.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24602

Re: (side-)effects and ...

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 9:27 AM, Skip Montanaro skip.montan...@gmail.com wrote: Also, he should not post here, because all articles posted here are automatically put on a mailing list and that list's web-accessible archive. I thought so at first add well. It looks like the Mailman system

Re: Evaluation order

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 10:10 AM, candide c.cand...@laposte.net wrote: The official doc explains that : Python evaluates expressions from left to right. cf. https://docs.python.org/3.3/reference/expressions.html#evaluation-order But consider the following snippet : t=[2020, 42, 2015]

[issue24601] bytes and unicode splitlines() methods differ on what is a line break

2015-07-09 Thread Gregory P. Smith
New submission from Gregory P. Smith: for bytes, \v (0x0b) is not considered a line break. for unicode, it is. this traces back to the Objects/stringlib/ code where unicode defers to the decision made by Objects/unicodeobject.c's ascii_linebreak table which contains 7 line breaks in the

[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread JohnLeitch
New submission from JohnLeitch: The Python 2.7 regular expression module suffers from an integer underflow in the SRE_SEARCH function of _sre.c, which leads to a buffer over-read condition. The issue is caused by unchecked subtraction performed while handling SR_OP_INFO blocks: if

[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +pitrou, serhiy.storchaka stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24602

[issue24583] set.update(): Crash when source set is changed during merging

2015-07-09 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Added file: http://bugs.python.org/file39890/intermediary.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24583 ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Stefan Krah
Stefan Krah added the comment: Qt had a similar initiative regarding -msse2 -mfpmath: http://lists.qt-project.org/pipermail/development/2013-December/014530.html They say that also Visual Studio 2012 has switched to sse2 by default. The only problem are the Linux distributions that are stuck

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-09 Thread David Beazley
David Beazley added the comment: Wanted to add: I see this as being about the same as having a broken window pane on the front of Python 3. Maybe there are awesome things inside, but it makes a bad first impression on anyone who dares to use the interactive console. --

[issue24166] ArgumentParser behavior does not match generated help

2015-07-09 Thread Benjamin Schubert
Benjamin Schubert added the comment: Ok, sorry for the delay. I see your point and understand the difficulty of having done right. Should I close the issue, or propose something else ? Thanks -- ___ Python tracker rep...@bugs.python.org

[issue24136] document PEP 448: unpacking generalization

2015-07-09 Thread Neil Girdhar
Neil Girdhar added the comment: Copied from closed issue 24240: Since Grammar/Grammar relies on semantic postprocessing in ast.c, it would be nice to have an update of the (human readable) Grammar in the language reference docs. -- ___ Python

[issue24594] msilib.OpenDatabase Type Confusion

2015-07-09 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24594 ___

Re: No Content-Length header, nor length property

2015-07-09 Thread zljubisic
Ah - looking at the response headers, they include Transfer-Encoding chunked - I don't think urlopen handles chunked responses by default, though I could be wrong, I don't have time to check the docs right now. The requests library (https://pypi.python.org/pypi/requests) seems to handle

[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: The problems with using concurrent.futures directly for running synchronous tasks in the background are: 1. You have to manage the lifecycle of the executor yourself, rather than letting asyncio do it for you 2. There's no easy process wide way to modify the

Re: Good python news sites

2015-07-09 Thread Joel Goldstick
On Thu, Jul 9, 2015 at 5:28 AM, Benj webko...@gmail.com wrote: Hello, could you please recommend some python news sites: sites that post news, code samples, good practices, new libraries... things like that, to follow daily. Thanks, Benj --

[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: 1. You have to manage the lifecycle of the executor yourself, rather than letting asyncio do it for you 2. There's no easy process wide way to modify the size of the background task thread pool (or switch to using processes instead) But if that's what

devpi-{server-2.2.2,web-2.4.0,client-2.3.0} releases

2015-07-09 Thread holger krekel
We just released devpi-server-2.2.2, devpi-web-2.4.0 and devpi-client-2.3.0, core parts of the private pypi package management and testing system. Among the highlights are support for distributed testing with devpi test --detox, new status pages at /+status for replica and master sites and

Re: requests.Session() how do you set 'replace' on the encoding?

2015-07-09 Thread Veek M
dieter wrote: It looks strange that you can set s.encoding after you have called s.get - but, as you apparently get an error related to the gbk encoding, it seems to work. Ooo! Sorry, typo - that was outside the function but before the call. Unfortunately whilst improving my function for

Good python news sites

2015-07-09 Thread Benj
Hello, could you please recommend some python news sites: sites that post news, code samples, good practices, new libraries... things like that, to follow daily. Thanks, Benj -- https://mail.python.org/mailman/listinfo/python-list

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-09 Thread David Beazley
David Beazley added the comment: Frivolity aside, I really wish this issue would get more traction and a fix. Indentation is an important part of the Python language (obviously). A pretty standard way to indent is to hit tab in whatever environment you're using to edit Python code. Yet, at

Re: lxml.xpath 'for/xpath' to get to a node and then xpath again within the loop?

2015-07-09 Thread Veek M
Mark Lawrence wrote: If it's provided why have you snipped it this time around? May I most humbly suggest that the next time you ask, please ensure that you tell us what you've googled for prior to putting your question. umm.. I can't determine what you mean by 'snipped it'. 1. I posted a

[issue24595] InteractiveInterpreter always prints to stdout

2015-07-09 Thread Anton Astafiev
New submission from Anton Astafiev: I have a use-case when I need to forward InteractiveConsole through Unix/TCP socket. Expected implementation: class InteractiveSocket(InteractiveConsole): def __init__(self, socket): self._socket = socket ... def raw_input(...): # read from

[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: I'll at least write a new python-ideas post, as I realised my original idea *is* wrong (and you're right not to like it). The focus needs to be on Sven's original question (How do you kick off a coroutine from otherwise synchronous code, and then later wait for

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Martin Richard
Martin Richard added the comment: Hi, I would like to update this patch so it can finally land in cpython, hopefully 3.6. tl;dr of the thread: In a nutshell, the latest patch from Kristján Valur Jónsson updates SSLContext.load_cert_chain(certfile, keyfile=None, password=None) and

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I thing adding keydata and certdata makes things more complicated, on the contrary. You start having an API with many optional arguments but some of them are exclusive with each other (because you can only specify a single key and cert chain). The cafile,

[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Petr Viktorin
New submission from Petr Viktorin: When this program is invoked as a script (`python reproducer.py`), the __del__ is never called: --- class ClassWithDel: def __del__(self): print('__del__ called') a = ClassWithDel() a.link = a raise SystemExit(0) --- Raising a different

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Martin Richard
Martin Richard added the comment: You are right. And if certfile and keyfile (args of load_cert_chain()) accept file-like objects, we agree that cafile (load_verify_location()) should accept them too? -- ___ Python tracker rep...@bugs.python.org

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 09/07/2015 15:40, Martin Richard a écrit : And if certfile and keyfile (args of load_cert_chain()) accept file-like objects, we agree that cafile (load_verify_location()) should accept them too? It could, but that's a separate issue. Let's stay focused on

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou
New submission from Antoine Pitrou: singledispatch currently doesn't defend against unwanted redefinition of an existing specialization, e.g.: def f(x): return default ... f = functools.singledispatch(f) @f.register(int) ... def _(x): return 1 ... @f.register(int) ... def _(x): return 2

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I didn't take time to read the whole discussion. For me, it's a good idea to accept a filename or a file object in the same parameter. Having two exclusive parameters for the same thing (ex: CA) doesn't smell like a great API. --

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Christian Heimes
Christian Heimes added the comment: I'd rather introduce new types and have the function accept either a string (for path to fiel) or a X509 object and a PKey object. It's more flexible and secure. With a private key type we can properly support crypto ENGINEs and wipe memory when the object

[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: Yeah, we should strongly consider writing more documentation before adding more convenience APIs. Esp. tutorial-style docs, which neither Victor nor I can supply because we've already moved beyond wizard level ourselves so it's hard for us to imagine the

[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Julian Taylor
Julian Taylor added the comment: Large objects are just if size 512: return malloc(size) there is no reason it should be slower. Also for large objects allocation speed does not matter as much. -- ___ Python tracker rep...@bugs.python.org

PyCon PL 2015 - Został niecały tydzień dla Call for Proposals

2015-07-09 Thread piotr
Cześć Polska Społeczności Pythona! Jakiś czas temu uruchomiono PyCon PL 2015 - Call for Proposals, czyli nabór na propozycje prelekcji, warsztatów, paneli dyskusyjnych oraz innych aktywności konferencyjnych. Zaakceptowani prowadzący, którzy spełnią warunki Call for Proposals, otrzymają darmowy

PyCon PL 2015 - Call for Proposal is waiting for you

2015-07-09 Thread piotr
Python Hackers, PyCon PL 2015 is pleased to announce that its Call for Proposals will be closed soon! We encourage you all to come and share experience with a varied audience of ethusiastic Pythonistas that the conference attracts each year. Talks and workshops from all Python-related areas

Re: module dependencies issues

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 6:36 AM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: How do you expect the end result to work? Will it be that your code imports one version of a module, but other code imports another? You would have to rename one of them or something. At

Re: module dependencies issues

2015-07-09 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: In general, I would expect that B 1.1 is backward-compatible with B 1.0, unless otherwise stated. Why must it be declared in any way other than the version number? To make it explicit. The generic component system shouldn't impose (m)any assumptions on version

Re: module dependencies issues

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 7:11 AM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: In general, I would expect that B 1.1 is backward-compatible with B 1.0, unless otherwise stated. Why must it be declared in any way other than the version number? To make it explicit.

[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Mark Shannon
Mark Shannon added the comment: I still think that this is a good idea, but I would like to see a small speed test for large objects. Just to be sure that it is no slower. -- ___ Python tracker rep...@bugs.python.org

Re: module dependencies issues

2015-07-09 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: How do you expect the end result to work? Will it be that your code imports one version of a module, but other code imports another? You would have to rename one of them or something. At work, we have created an analogous component system that has solved this

Re: module dependencies issues

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 5:08 AM, Cyril Scetbon cyril.scet...@free.fr wrote: Forcing my-module to use B=1.1 fixes the issue. However it's just a sample and my code is using a lot of modules that use other shared modules too. Is there a way to let dependencies use their own version of the

[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: Please move the philosophical discussion to python-ideas. Regarding the phrasing about the two Future classes being almost compatible, that is unfortunate wording. Two things can have a similar API (merely having the same methods etc.) without being

[issue21148] avoid needless pointers initialization in small tuple creation

2015-07-09 Thread Julian Taylor
Julian Taylor added the comment: right at best its probably too insignificant to really be worthwhile, closing. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21148

[issue24600] function(**dict) does not accept comma after dict (inside parenthese)

2015-07-09 Thread Grégory Starck
New submission from Grégory Starck: Consider following: Python 3.4.0 (default, Jun 19 2015, 14:20:21) [GCC 4.8.2] on linux def f(**kw): pass f(a=1 , ) # ok f(**{'a': 1} ) # ok # but : f(**{'a': 1} , ) SyntaxError: invalid syntax shouldn't the last form be also allowed as is the

Re: module dependencies issues

2015-07-09 Thread Cyril Scetbon
It's just a sample. I'd like to get a general answer. So think about the worst case. On Jul 9, 2015, at 21:50, Chris Angelico ros...@gmail.com wrote: On Fri, Jul 10, 2015 at 5:08 AM, Cyril Scetbon cyril.scet...@free.fr wrote: Forcing my-module to use B=1.1 fixes the issue. However it's just

Re: module dependencies issues

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 5:55 AM, Cyril Scetbon cyril.scet...@free.fr wrote: It's just a sample. I'd like to get a general answer. So think about the worst case. (Please don't top-post on this list.) The worst case is virtually impossible to handle. Somewhere along the way, you need to say

[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

2015-07-09 Thread Julian Taylor
Julian Taylor added the comment: any comments on the doc changes? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23530 ___ ___ Python-bugs-list

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-07-09 Thread Skip Montanaro
I thought this thread had died down. I guess not quite... It makes perfect sense to me that TAB and Ctrl-TAB would generate the same keycode, as TAB is itself a control character (Ctrl-I). As the Ctrl modifier bit is effectively already set, I don't think you can really set it a second time and

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-07-09 Thread Marko Rauhamaa
Skip Montanaro skip.montan...@gmail.com: It makes perfect sense to me that TAB and Ctrl-TAB would generate the same keycode, as TAB is itself a control character (Ctrl-I). As the Ctrl modifier bit is effectively already set, I don't think you can really set it a second time and be able to

[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Mark Shannon
Mark Shannon added the comment: Indeed there is no *obvious* reason why they should be slower. But when it comes to optimisation, *never* trust your (or anyone else's) intuition. Running a simple check is always worth the effort. -- ___ Python

Re: (side-)effects and ...

2015-07-09 Thread random832
On Thu, Jul 9, 2015, at 15:36, Tony the Tiger wrote: On Sun, 05 Jul 2015 20:29:11 +, Stefan Ram wrote: X-Copyright: (C) Copyright 2015 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I suppose the simplest fix would be to replace relevant instances of int(random() * N) with min(int(random() * N), N-1) That sounds simple and generic. It skews the distribution a tiny little bit, but it doesn't sound significant (perhaps Mark would

Re: (side-)effects and ...

2015-07-09 Thread Skip Montanaro
Also, he should not post here, because all articles posted here are automatically put on a mailing list and that list's web-accessible archive. I thought so at first add well. It looks like the Mailman system handles the X-No-Archive and/or Archive headers. I couldn't find his name in this

[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Guido van Rossum
Guido van Rossum added the comment: Hm. If the problem is most prominent with 3.3, why mark the issue as 3.6? Do you have an implementation already? Maybe it can be a 3rd party package rather than integrated in asyncio debug mode? -- ___ Python

[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Eric Snow
Eric Snow added the comment: I agree with Antoine. -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24597 ___ ___

Re: module dependencies issues

2015-07-09 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: On Fri, Jul 10, 2015 at 7:11 AM, Marko Rauhamaa ma...@pacujo.net wrote: Whoever creates B-1.1 ought to make it backward-compatible, but he should also say so. The majority of developers are careless about backward-compatibility; having the component system make

Re: module dependencies issues

2015-07-09 Thread Chris Angelico
On Fri, Jul 10, 2015 at 7:33 AM, Marko Rauhamaa ma...@pacujo.net wrote: And just how compatible does it have to be to get a tick? It must be a safe binary replacement of the earlier version. Bug fixes and new features are ok, but none of the old functionality can be obsoleted. Your

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Tim Peters
Tim Peters added the comment: It skews the distribution a tiny little bit, ... But it doesn't - that's the point ;-) If double-rounding doesn't occur at all (which appears to be the case on most platforms), absolutely nothing changes (because min(int(random() * N), N-1) == int(random() * N)

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread STINNER Victor
STINNER Victor added the comment: Again, why not using only integers? Pseudo-code to only use integers: def randint(a, b): num = b - a if not num: return a nbits = (num + 1).bit_length() while True: x = random.getrandbits(nbits) if x = num:

[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2015-07-09 Thread Martin Panter
Martin Panter added the comment: In the meantime, Issue 24599 has been opened about URLopener(), which I understand is related to the Python 2 “urllib” half of this bug. Since this issue has been closed, perhaps it is best to continue discussion of issue1424152-py27-urllib.diff there instead.

[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread Martin Panter
Martin Panter added the comment: David: the original patch made in Issue 1424152 fixed Python 2’s urllib.request.urlopen() and Python 2’s urllib2.urlopen(). But Stefano is using URLopener, which I understand comes from Python 2’s older “urllib” module. When I run the demonstration, the

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Tim Peters
Tim Peters added the comment: Victor, if people want to use getrandbits(), we should backport the Python3 code, not reinvent it from scratch. Note too Mark's comment: There are several places in the source where something of the form `int(i * random.random())` is used. The `min()` trick is

Re: module dependencies issues

2015-07-09 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: Your descriptions conflict. A safe binary replacement usually cannot even add new features, in case this breaks something. Linus Torvalds is adamant about maintaining ABI compatibility across Linux versions. That hasn't prevented him from accepting numerous new

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread STINNER Victor
STINNER Victor added the comment: Victor, if people want to use getrandbits(), we should backport the Python3 code, not reinvent it from scratch. Sorry, I don't understand your comment. Backport what? getrandbits() is available on Python 2 and Python 3, for Random and SystemRandom. I

Evaluation order

2015-07-09 Thread candide
The official doc explains that : Python evaluates expressions from left to right. cf. https://docs.python.org/3.3/reference/expressions.html#evaluation-order But consider the following snippet : t=[2020, 42, 2015] t*(1+int(bool(t.sort( [42, 2015, 2020] Is there not some

Python dashboard tutorials/frameworks for interactive, D3.js graphs in IPython Notebooks

2015-07-09 Thread Matt Sundquist
Hi all, I'm part of Plotly, and we've just finished a few releases I thought I'd pass along. These tools make it easy to craft interactive graphs and dashboards with D3.js using Python. We're especially drawn towards matplotlib, pandas, and IPython. We're still early in building, so any and

[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Tim Peters
Tim Peters added the comment: Victor, don't ask me, look at the code: the random.choice() implementations in Python 2 and Python 3 have approximately nothing in common, and the bug here should already be impossible in Python 3 (but I can't check that, because I don't have a platform that

Re: module dependencies issues

2015-07-09 Thread Mark Lawrence
On 10/07/2015 01:04, Marko Rauhamaa wrote: Chris Angelico ros...@gmail.com: Your descriptions conflict. A safe binary replacement usually cannot even add new features, in case this breaks something. New functions in C libraries do not cause runtime breakage. It's good to know that there's

  1   2   >