Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Sam Partington
On 23 May 2013 22:02, Ronan Lamy wrote: > 2013/5/23 Łukasz Langa >> Last one wins. Just like with assigning names in a scope, defining methods >> in a class or overriding them in a subclass. > > This is a serious annoyance, considering that there are several places where > a large library can rea

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Devin Jeanpierre
On Thu, May 23, 2013 at 6:40 PM, Steven D'Aprano wrote: > I don't think that they will. Being able to register multiple types with a > single call reads very naturally to me, while multiple decorators still > looks weird. Even after many years of seeing them, I still get a momentary > "What the he

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Steven D'Aprano
On 24/05/13 15:09, Nick Coghlan wrote: On Fri, May 24, 2013 at 8:40 AM, Steven D'Aprano wrote: I don't think that they will. Being able to register multiple types with a single call reads very naturally to me, while multiple decorators still looks weird. Even after many years of seeing them, I

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Nick Coghlan
On Fri, May 24, 2013 at 8:53 PM, Steven D'Aprano wrote: > Python built-ins and the standard library already have a standard idiom for > specifying multiple values at once. A tuple of types is the One Obvious Way > to do this: > > @fun.register((float, Decimal)) It's not obvious, it's ambiguous -

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Nick Coghlan
On Fri, May 24, 2013 at 9:41 PM, Nick Coghlan wrote: > Furthermore, the proposed registration syntax in the PEP is identical > to the syntax which already exists for ABC registration as a class > decorator (http://docs.python.org/3/library/abc#abc.ABCMeta.register). Sorry, I withdraw that observa

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Nick Coghlan
On Fri, May 24, 2013 at 7:54 PM, Sam Partington wrote: > But isn't it much much worse than names in scope, as with assigning > names in a scope it is only your scope that is affected : > > from os.path import join > def join(wibble): > 'overloads join in this module only' > > any other module

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Ronan Lamy
2013/5/24 Ethan Furman > On 05/23/2013 02:02 PM, Ronan Lamy wrote: > >> 2013/5/23 Łukasz Langa mailto:luk...@langa.pl>> >> >> >> On 23 maj 2013, at 20:13, Éric Araujo > mer...@netwok.org>> wrote: >> >> > Question: what happens if two functions (say in two different >> modules) >> > ar

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Łukasz Langa
On 24 maj 2013, at 14:22, Ronan Lamy wrote: >> 2013/5/24 Ethan Furman >> What would you suggest happen in this case? > Raise a ValueError, maybe? In that case, there needs to be a way to force the > overriding when it is explicitly desired. One way would be to allow > unregistering implementa

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Nick Coghlan
On Fri, May 24, 2013 at 10:22 PM, Ronan Lamy wrote: > Raise a ValueError, maybe? In that case, there needs to be a way to force > the overriding when it is explicitly desired. One way would be to allow > unregistering implementations: overriding is then done by unregistering the > old implementati

Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Łukasz Langa
On 24 maj 2013, at 14:53, Ronan Lamy wrote: >> 2013/5/24 Łukasz Langa >> >> I recognize the need for such behaviour to be discoverable. This is >> important for debugging purposes. This is why I'm going to let users >> inspect registered overloads, as well as provide their own mapping >> for th

[Python-Dev] Summary of Python tracker Issues

2013-05-24 Thread Python tracker
ACTIVITY SUMMARY (2013-05-17 - 2013-05-24) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open3972 ( +6) closed 25850 (+45) total 29822 (+51) Open issues wit

[Python-Dev] Bilingual scripts

2013-05-24 Thread Barry Warsaw
Here's something that seems to come up from time to time in Debian. Take a Python application like tox, nose, or pyflakes. Their executables work with both Python 2 and 3, but require a #! line to choose which interpreter to invoke. When we add Python 3 support in Debian for such a script, all t

Re: [Python-Dev] Bilingual scripts

2013-05-24 Thread R. David Murray
On Fri, 24 May 2013 15:56:29 -0400, Barry Warsaw wrote: > Have any other *nix distros addressed this, and if so, how do you solve it? > It would be nice if we could have some cross-platform recommendations so > things work the same wherever you go. To that end, if we can reach some > consensus, I

Re: [Python-Dev] Bilingual scripts

2013-05-24 Thread Dirkjan Ochtman
On Fri, May 24, 2013 at 10:23 PM, R. David Murray wrote: > Gentoo has a (fairly complex) driver script that is symlinked to all > of these bin scripts. The system then has the concept of the > "current python", which can be set to python2 or python3. The default > bin then calls the current defa