Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Glenn Linderman
On 3/19/2010 9:20 PM, Nick Coghlan wrote: Glenn Linderman wrote: > The same person that would expect both > > 0 == "0" > 0.0 == "0.0" > > to be False... i.e. anyone that hasn't coded in Perl for too many years. Completely different - that is comparing numbers to strings. On

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Nick Coghlan
Glenn Linderman wrote: > The same person that would expect both > > 0 == "0" > 0.0 == "0.0" > > to be False... i.e. anyone that hasn't coded in Perl for too many years. Completely different - that is comparing numbers to strings. What this discussion is about is comparison between the different

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread Alexander Belopolsky
I am generally happy with the tracker workflow and in my experience, issues that are lingering are lingering for a good reason. I've decided to add my two cents to this thread because I've just had a negative experience with how issue 8154 and my input to it were handled. I will not go into detai

Re: [Python-Dev] GSoC 2010 is on -- projects?

2010-03-19 Thread C. Titus Brown
On Sat, Mar 20, 2010 at 12:00:48AM +0100, "Martin v. L?wis" wrote: > > Whether this is worth weeks of work or not will depend on a given > > student's knowledge about Python 3, and I'd suspect that the GSoC would > > be an opportunity for a number of applicant to actually learn the > > intricacies

Re: [Python-Dev] Needs Review: 2to3 fixer for sys.exitfunc to atexit.

2010-03-19 Thread Benjamin Peterson
2010/3/19 Sean Reifschneider : > Issue 2356 ( http://bugs.python.org/issue2356 ) looks like it has a patch > candidate, but just needs review to put in place.  Seems like it may be > low hanging fruit critical that just needs a quick review to either apply > or at least get back to the folks who ar

[Python-Dev] Needs Review: 2to3 fixer for sys.exitfunc to atexit.

2010-03-19 Thread Sean Reifschneider
Issue 2356 ( http://bugs.python.org/issue2356 ) looks like it has a patch candidate, but just needs review to put in place. Seems like it may be low hanging fruit critical that just needs a quick review to either apply or at least get back to the folks who are working on a patch. Thanks, Sean --

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-19 Thread Steven D'Aprano
On Sat, 20 Mar 2010 08:50:04 am Guido van Rossum wrote: > I'd like to reboot this thread. I've been spinning this topic in my > head for most of the morning, and I think we should seriously > reconsider allowing mixed arithmetic involving Decimal, not just > mixed comparisons. [Quick summary: embed

Re: [Python-Dev] containment checking

2010-03-19 Thread Glenn Linderman
On 3/19/2010 5:20 PM, Michael Foord wrote: On 20/03/2010 00:19, Glenn Linderman wrote: On 3/19/2010 5:18 PM, Michael Foord wrote: will probably get you buggy results, somehow or another. That's what > design, code reviews, and testing are for. We'll have to "agree to disagree" then. If you want

Re: [Python-Dev] Decimal & lt; -& gt; float comparisons in py3k.

2010-03-19 Thread Greg Ewing
Glenn Linderman wrote: In order to do implicit comparisons, one must do an implicit coercion. Hence the PEP actually already prohibits implicit comparisons, as well as implicit arithmetic. Not necessarily -- you could compare them as though they had both been converted to the equivalent rati

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Greg Ewing
Glenn Linderman wrote: Sounds to me like containment checking is wrong; that if it gets an exception during the comparison that it should assume unequal, rather than aborting, and continue to the next entry. What exception would it catch, though? Catching something as generic as TypeError wou

Re: [Python-Dev] 0.1

2010-03-19 Thread Antoine Pitrou
Greg Ewing canterbury.ac.nz> writes: > > So do you think that float("0.1") and Decimal("0.1") should be > equal or not, and why? Given that float("0.1") is not the mathematical 0.1, while Decimal("0.1") is, I'd say no. ___ Python-Dev mailing list Pyt

Re: [Python-Dev] containment checking

2010-03-19 Thread Michael Foord
On 20/03/2010 00:19, Glenn Linderman wrote: On 3/19/2010 5:18 PM, Michael Foord wrote: will probably get you buggy results, somehow or another. That's what > design, code reviews, and testing are for. We'll have to "agree to disagree" then. If you want error silencing by default, Python is not

Re: [Python-Dev] containment checking

2010-03-19 Thread Glenn Linderman
On 3/19/2010 5:18 PM, Michael Foord wrote: will probably get you buggy results, somehow or another. That's what > design, code reviews, and testing are for. We'll have to "agree to disagree" then. If you want error silencing by default, Python is not the language you are looking for. We can a

Re: [Python-Dev] containment checking

2010-03-19 Thread Michael Foord
On 20/03/2010 00:15, Glenn Linderman wrote: On 3/19/2010 4:58 PM, Antoine Pitrou wrote: Glenn Linderman g.nevcal.com> writes: > > If there's a bug in your __eq__ method, it may or may not raise an > exception, which may or may not get you wrong containment results. But > it will probably get y

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Greg Ewing
Antoine Pitrou wrote: We forbid comparisons when there is a real danger or ambiguity, such as unicode vs. bytes. There is no such danger or ambiguity when comparing a decimal with a float. So do you think that float("0.1") and Decimal("0.1") should be equal or not, and why? -- Greg __

Re: [Python-Dev] containment checking

2010-03-19 Thread Glenn Linderman
On 3/19/2010 4:58 PM, Antoine Pitrou wrote: Glenn Linderman g.nevcal.com> writes: > > If there's a bug in your __eq__ method, it may or may not raise an > exception, which may or may not get you wrong containment results. But > it will probably get you buggy results, somehow or anoth

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-19 Thread Glenn Linderman
On 3/19/2010 2:50 PM, Guido van Rossum wrote: I'd like to reboot this thread. I'll go along with that idea! I've been spinning this topic in my head for most of the morning, and I think we should seriously reconsider allowing mixed arithmetic involving Decimal, not just mixed comparisons.

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Greg Ewing
Nick Coghlan wrote: Mark Dickinson wrote: It seems to me that given the existing conflation of numeric equivalence and containment testing, going the whole hog and fixing the set membership problem for all of our rational types would be the right thing to do. Isn't this only solving half the

Re: [Python-Dev] containment checking

2010-03-19 Thread Antoine Pitrou
Glenn Linderman g.nevcal.com> writes: > > If there's a bug in your __eq__ method, it may or may not raise an > exception, which may or may not get you wrong containment results. But > it will probably get you buggy results, somehow or another. That's what > design, code reviews, and testing

Re: [Python-Dev] containment checking

2010-03-19 Thread Glenn Linderman
On 3/19/2010 3:02 PM, Antoine Pitrou wrote: Glenn Linderman g.nevcal.com> writes: > > Sounds to me like containment checking is wrong; that if it gets an > exception during the comparison that it should assume unequal, rather > than aborting, and continue to the next entry. Wel

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-19 Thread Facundo Batista
On Fri, Mar 19, 2010 at 5:50 PM, Guido van Rossum wrote: > As a downside, there is the worry that inadvertent mixing of Decimal > and float can compromise the correctness of programs in a way that is > hard to detect. But the anomalies above indicate that not fixing the Decimal already has somet

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-19 Thread Mark Dickinson
Just a couple of quick side comments on this; I haven't got my head around the whole mixed-operations idea yet. On Fri, Mar 19, 2010 at 9:50 PM, Guido van Rossum wrote: > There is one choice which I'm not sure about. Should a mixed > float/Decimal operation return a float or a Decimal? I'll jus

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Terry Reedy
On 3/19/2010 3:16 PM, Glenn Linderman wrote: I perceive that the whole thread is about _all_ comparison operators with one float and one decimal operand currently producing an exception (3.x) Not true for equality comparison. That returns False regardless of value, just as order comparisons r

Re: [Python-Dev] GSoC 2010 is on -- projects?

2010-03-19 Thread Martin v. Löwis
> Whether this is worth weeks of work or not will depend on a given > student's knowledge about Python 3, and I'd suspect that the GSoC would > be an opportunity for a number of applicant to actually learn the > intricacies of Python 3. > Developing Python 3-specific features could be used to incre

[Python-Dev] RELEASED Python 2.6.5

2010-03-19 Thread Barry Warsaw
On behalf of the Python community, I'm happy to announce the availability of Python 2.6.5 final. This is the latest production-ready version in the Python 2.6 series. Python 2.6.5 fixes dozens of issues in the core, built-in modules, libraries, and documentation since Python 2.6.4 was released ba

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-19 Thread Raymond Hettinger
On Mar 19, 2010, at 2:50 PM, Guido van Rossum wrote: > I'd like to reboot this thread. I've been spinning this topic in my > head for most of the morning, and I think we should seriously > reconsider allowing mixed arithmetic involving Decimal, not just mixed > comparisons. [Quick summary: embed

Re: [Python-Dev] containment checking

2010-03-19 Thread Antoine Pitrou
Glenn Linderman g.nevcal.com> writes: > > Sounds to me like containment checking is wrong; that if it gets an > exception during the comparison that it should assume unequal, rather > than aborting, and continue to the next entry. Well as the Zen says: Errors should never pass silently. Unless

[Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-19 Thread Guido van Rossum
I'd like to reboot this thread. I've been spinning this topic in my head for most of the morning, and I think we should seriously reconsider allowing mixed arithmetic involving Decimal, not just mixed comparisons. [Quick summary: embed Decimal in the numeric tower but add a context flag to disallow

Re: [Python-Dev] Decimal [...] float comparisons in py3k.

2010-03-19 Thread Antoine Pitrou
Guido van Rossum python.org> writes: > > Antoine, I think your email client turns replies whose subject > contains '&' into new subjects containing sequences like this: > > & amp; lt; -& amp; gt; > > There's a number of new threads with ever-more occurrences of "amp" in > the subject,

[Python-Dev] "expected a character buffer object" messages

2010-03-19 Thread aditya bhargava
I found an old thread on Python-Dev that suggested replacing the error "TypeError: expected a character buffer object" with something more helpful for non-experts like "expected a string or character buffer". Here's the thread: http://mail.python.org/pipermail/python-dev/2006-May/065301.html I thi

Re: [Python-Dev] Decimal & amp; amp; lt; -& amp; amp; gt; float comparisons in py3k.

2010-03-19 Thread Guido van Rossum
Antoine, I think your email client turns replies whose subject contains '&' into new subjects containing sequences like this: & amp; lt; -& amp; gt; There's a number of new threads with ever-more occurrences of "amp" in the subject, and you are the first poster in each thread (and the f

Re: [Python-Dev] 3.1.2 tagging delayed a little

2010-03-19 Thread Benjamin Peterson
2010/3/19 Brett Cannon : > On Thu, Mar 18, 2010 at 20:20, Benjamin Peterson wrote: >> Pending the resolution of a few Mac OS issues (#8068, #8069, and >> #8133), I'm not going to tag the release at the moment. Hopefully, >> we'll still be able to have a release in the next week. > > Do you want is

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread R. David Murray
On Fri, 19 Mar 2010 12:16:35 -0700, Glenn Linderman wrote: > On 3/19/2010 11:43 AM, Terry Reedy wrote: > > It still strikes me as a bit crazy for Python to say that 0.0 == 0 and > > 0 == Decimal(0) but that 0.0 != Decimal(0). Who would expect such a > > thing? > > The same person that would ex

Re: [Python-Dev] Attribute lookup ambiguity

2010-03-19 Thread Michael Foord
On 19/03/2010 18:58, Pascal Chambon wrote: Hello I've already crossed a bunch of articles detailing python's attribute lookup semantic (__dict__, descriptors, order of base class traversing...), but I have never seen, so far, an explanation of WHICH method did waht, exactly. I assumed that

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Glenn Linderman
On 3/19/2010 12:50 PM, Mark Dickinson wrote: Hah. This is a very good point, and one I'd somehow missed up until now. I don't think we*can* reasonably make equality comparisons raise NotImplemented (in either 2.x or 3.x), since that messes up containment tests: something like "1.0 in {2, Deci

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Mark Dickinson
On Fri, Mar 19, 2010 at 7:50 PM, Mark Dickinson wrote: > So the patch > I've put on the issue tracker is wrong, since it does raise TypeError ... s/I've put/I have yet to put/ I really shouldn't admit to errors in things that I haven't even been made public yet. :) Mark ___

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Mark Dickinson
On Fri, Mar 19, 2010 at 6:43 PM, Terry Reedy wrote: > On 3/19/2010 2:11 PM, Antoine Pitrou wrote: >> >> Raymond Hettinger  gmail.com>  writes: >>> >>> The reason to prefer an exception is that decimal/float comparisons >>> are more likely to be a programmer error than an intended behavior. > > If

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread R. David Murray
On Fri, 19 Mar 2010 12:39:58 -0400, "A.M. Kuchling" wrote: > On Fri, Mar 19, 2010 at 10:22:05AM -0400, R. David Murray wrote: > > > Real world example with issue8151. It is an issue with a trivial patch > > > in it. Everything what is needed is to dispatch it to stable `commit > > > queue` and por

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread R. David Murray
On Fri, 19 Mar 2010 14:09:28 -0400, Zvezdan Petkovic wrote: > On Mar 19, 2010, at 1:15 PM, Terry Reedy wrote: > > On 3/19/2010 10:22 AM, R. David Murray wrote: > >> This can be done by anyone just by saying, eg: 'see issue 1234' (roundup > >> turns that into a link), > > > > That should be 'see i

Re: [Python-Dev] 3.1.2 tagging delayed a little

2010-03-19 Thread Brett Cannon
On Thu, Mar 18, 2010 at 20:20, Benjamin Peterson wrote: > Pending the resolution of a few Mac OS issues (#8068, #8069, and > #8133), I'm not going to tag the release at the moment. Hopefully, > we'll still be able to have a release in the next week. Do you want issue8133 to be a release blocker?

[Python-Dev] Attribute lookup ambiguity

2010-03-19 Thread Pascal Chambon
Hello I've already crossed a bunch of articles detailing python's attribute lookup semantic (__dict__, descriptors, order of base class traversing...), but I have never seen, so far, an explanation of WHICH method did waht, exactly. I assumed that getattr(a, b) was the same as a.__getattribu

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Glenn Linderman
On 3/19/2010 11:43 AM, Terry Reedy wrote: On 3/19/2010 2:11 PM, Antoine Pitrou wrote: Raymond Hettinger gmail.com> writes: The reason to prefer an exception is that decimal/float comparisons are more likely to be a programmer error than an intended behavior. If you really believe that, the

Re: [Python-Dev] Decimal &amp; amp; lt; -&a mp;amp; amp; gt; float comparisons in py3k.

2010-03-19 Thread Antoine Pitrou
Raymond Hettinger gmail.com> writes: > > The conversion of a float to a decimal is not as straight-forward > (most people don't even know that an exact conversion is possible). I still don't follow you. You are saying that an exact conversion is possible, but don't want it to be done because it

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Antoine Pitrou
Glenn Linderman g.nevcal.com> writes: > > So when a coder choose to use Decimal, it is because float is > inappropriate. Because float is inappropriate, mixing Decimal and float > is inappropriate. Having the language coerce implicitly, is > inappropriate. I'm sorry but this is very dogmati

Re: [Python-Dev] Decimal & lt; -& gt; float comparisons in py3k.

2010-03-19 Thread Raymond Hettinger
On Mar 19, 2010, at 11:42 AM, Glenn Linderman wrote: >> > > The whole point of providing Decimal is for applications for which float is > inappropriate. I didn't think I needed to reproduce PEP 327 in my email. > > So when a coder choose to use Decimal, it is because float is inappropriate.

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Terry Reedy
On 3/19/2010 2:11 PM, Antoine Pitrou wrote: Raymond Hettinger gmail.com> writes: The reason to prefer an exception is that decimal/float comparisons are more likely to be a programmer error than an intended behavior. If you really believe that, then equality comparisons should also be disa

Re: [Python-Dev] Decimal & lt; -& gt; float comparisons in py3k.

2010-03-19 Thread Glenn Linderman
On 3/19/2010 4:50 AM, Antoine Pitrou wrote: Glenn Linderman nevcal.com> writes: On the other hand, if the default behavior is to do an implicit conversion, I don't know of any way that that could be turned into an exception for those coders that don't want or don't like the particular type

Re: [Python-Dev] Decimal & amp; lt; -& amp; gt; float comparisons in py3k.

2010-03-19 Thread Raymond Hettinger
On Mar 19, 2010, at 11:11 AM, Antoine Pitrou wrote: > Raymond Hettinger gmail.com> writes: >> >> The reason to prefer an exception is that decimal/float comparisons >> are more likely to be a programmer error than an intended behavior. > > Not more so than float/int or decimal/int or bool/int

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread Zvezdan Petkovic
On Mar 19, 2010, at 1:15 PM, Terry Reedy wrote: > On 3/19/2010 10:22 AM, R. David Murray wrote: > >> This can be done by anyone just by saying, eg: 'see issue 1234' (roundup >> turns that into a link), > > That should be 'see issue #1234' to get the autolink. > From http://wiki.python.org/moin/

Re: [Python-Dev] Decimal &amp; lt; -&am p; gt; float comparisons in py3k.

2010-03-19 Thread Antoine Pitrou
Raymond Hettinger gmail.com> writes: > > The reason to prefer an exception is that decimal/float comparisons > are more likely to be a programmer error than an intended behavior. Not more so than float/int or decimal/int or bool/int comparisons, which all work. We forbid comparisons when there

Re: [Python-Dev] binary operation heuristics -- bug or undocumented?

2010-03-19 Thread Terry Reedy
On 3/19/2010 8:46 AM, Alex A. Naanou wrote: A friend of mine stumbled upon the following behavior: [snip] Questions like this are more appropriately posted to python-list, where you would have gotten the same answer. tjr ___ Python-Dev mailing li

Re: [Python-Dev] Joel Spolsky on Mercurial

2010-03-19 Thread Terry Reedy
On 3/19/2010 5:00 AM, Dirkjan Ochtman wrote: On Thu, Mar 18, 2010 at 22:38, Terry Reedy wrote: Having gotten that far, I think this might be worth referencing in new dev docs. Will do. I finally read hginit yesterday, after having seen people rave about it on twitter for a few weeks, and it's

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread Terry Reedy
On 3/19/2010 10:22 AM, R. David Murray wrote: This can be done by anyone just by saying, eg: 'see issue 1234' (roundup turns that into a link), That should be 'see issue #1234' to get the autolink. From http://wiki.python.org/moin/TrackerDocs/ The tracker converts some specially formatted wor

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread A.M. Kuchling
On Fri, Mar 19, 2010 at 10:22:05AM -0400, R. David Murray wrote: > > Real world example with issue8151. It is an issue with a trivial patch > > in it. Everything what is needed is to dispatch it to stable `commit > > queue` and port to trunk. It is not 'easy' - it is 'trivial', but I > > have no me

Re: [Python-Dev] Decimal & lt; -& gt; float comparisons in py3k.

2010-03-19 Thread Raymond Hettinger
On Mar 19, 2010, at 4:50 AM, Antoine Pitrou wrote: > Glenn Linderman nevcal.com> writes: >> >> On the other hand, if the default behavior is to do an implicit >> conversion, I don't know of any way that that could be turned into an >> exception for those coders that don't want or don't like t

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Adam Olsen
On Thu, Mar 18, 2010 at 12:41, Mark Dickinson wrote: > I'm only seeing two arguments against this at the moment: (1) it has > the potential to break code that relies on being able to sort > heterogeneous lists.  But given that heterogeneous lists can't be > sorted stably anyway (see my earlier pos

Re: [Python-Dev] GSoC 2010 is on -- projects?

2010-03-19 Thread Laurent Gautier
On 3/19/10 12:57 PM, Arc Riley wrote: Hi Laurent If your community project would like help porting to Python 3, and you feel this work is enough for a student to work full time for several weeks on, then please do add it to the GSoC ideas page on the wiki. Whether this is worth weeks of work o

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread R. David Murray
On Fri, 19 Mar 2010 10:09:16 +0200, anatoly techtonik wrote: > I want to push some of my patches before 2.7 and use 5-1 rule for > that, but I can't come up with any review workflow other than mailing > status of my comments to the issues here. I can't mark issues in any > way. How about giving u

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread Brian Curtin
On Fri, Mar 19, 2010 at 03:09, anatoly techtonik wrote: > I want to push some of my patches before 2.7 and use 5-1 rule for > that, but I can't come up with any review workflow other than mailing > status of my comments to the issues here. I can't mark issues in any > way. How about giving users a

Re: [Python-Dev] Bug? syslog.openlog using ident "python" by default.

2010-03-19 Thread Eric Smith
Sean Reifschneider wrote: If you call: from syslog import syslog, openlog syslog('My error message') Something like the following gets logged: Mar 18 05:20:22 guin python: My error message ^^ Where I'm annoyed by the "python" in the above. This is pulled

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Case Vanhorsen
On Fri, Mar 19, 2010 at 3:07 AM, Mark Dickinson wrote: > On Fri, Mar 19, 2010 at 9:37 AM, Mark Dickinson wrote: >> Making hashes of int, >> float, Decimal *and* Fraction all compatible with one another, >> efficient for ints and floats, and not grossly inefficient for >> Fractions and Decimals, i

Re: [Python-Dev] binary operation heuristics -- bug or undocumented?

2010-03-19 Thread Alex A. Naanou
Thanks! On Fri, Mar 19, 2010 at 16:05, Michael Foord wrote: > On 19/03/2010 12:46, Alex A. Naanou wrote: >> >> [snip...] > > class C(object): > >> >> ...     def __radd__(self, other): >> ...         print 'C: adding C and %s objects.' % other.__class__.__name__ >> ... >> > >

Re: [Python-Dev] Joel Spolsky on Mercurial

2010-03-19 Thread skip
M> Is Python-dev going to consider shifting their repo to mercurial/git M> instead of SVN? :) Yes, Dirkjan has been working on it. My initial experience with hg as a quick way to revision control anything anywhere on a small scale ("hmmm, I should track changes to /etc/hosts... cd /etc ;

Re: [Python-Dev] right-side binary operations

2010-03-19 Thread Oleg Broytman
On Fri, Mar 19, 2010 at 03:46:07PM +0300, Alex A. Naanou wrote: > >>> class C(object): > ... def __radd__(self, other): > ... print 'C: adding C and %s objects.' % other.__class__.__name__ > ... > >>> 1 + c > C: adding C and int objects. > > My first expectation would be to get a TypeE

Re: [Python-Dev] binary operation heuristics -- bug or undocumented?

2010-03-19 Thread Michael Foord
On 19/03/2010 12:46, Alex A. Naanou wrote: [snip...] class C(object): ... def __radd__(self, other): ... print 'C: adding C and %s objects.' % other.__class__.__name__ ... a, b, c = A(), B(), C() 1 + c C: adding C and int objects. That is the whole

Re: [Python-Dev] binary operation heuristics -- bug or undocumented?

2010-03-19 Thread Mark Dickinson
On Fri, Mar 19, 2010 at 12:46 PM, Alex A. Naanou wrote: > A friend of mine stumbled upon the following behavior: > > > ---cut--- > class A(object): pass > ... class B(object): > ...     def __add__(self, other): > ...         print 'B: adding B and %s objects.' % other.__class__.__name__

[Python-Dev] binary operation heuristics -- bug or undocumented?

2010-03-19 Thread Alex A. Naanou
Hi, A friend of mine stumbled upon the following behavior: ---cut--- >>> class A(object): pass ... >>> class B(object): ... def __add__(self, other): ... print 'B: adding B and %s objects.' % other.__class__.__name__ ... >>> class C(object): ... def __radd__(self, other): ...

Re: [Python-Dev] Joel Spolsky on Mercurial

2010-03-19 Thread Oleg Broytman
On Fri, Mar 19, 2010 at 04:59:38PM +0500, M. Shuaib Khan wrote: > Is Python-dev going to consider shifting their repo to mercurial/git instead > of SVN? :) http://mail.python.org/pipermail/python-dev/2009-March/087931.html The decision was made about a year ago. http://www.python.org/dev/peps

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Nick Coghlan
Mark Dickinson wrote: > On Fri, Mar 19, 2010 at 9:37 AM, Mark Dickinson wrote: > For ints, this hash function is almost identical to what Python > already has, except that the current int hash does a reduction modulo > 2**32-1 or 2**64-1 rather than 2**31-1. For all small ints, hash(n) > == n, as

Re: [Python-Dev] Joel Spolsky on Mercurial

2010-03-19 Thread M. Shuaib Khan
On Fri, Mar 19, 2010 at 4:52 PM, Nick Coghlan wrote: > Dirkjan Ochtman wrote: > > On Thu, Mar 18, 2010 at 22:38, Terry Reedy wrote: > >> Having gotten that far, I think this might be worth referencing in new > dev > >> docs. > > > > Will do. I finally read hginit yesterday, after having seen peo

Re: [Python-Dev] GSoC 2010 is on -- projects?

2010-03-19 Thread Arc Riley
Hi Laurent If your community project would like help porting to Python 3, and you feel this work is enough for a student to work full time for several weeks on, then please do add it to the GSoC ideas page on the wiki. There will be another program running for high school students which is more s

Re: [Python-Dev] Joel Spolsky on Mercurial

2010-03-19 Thread Nick Coghlan
Dirkjan Ochtman wrote: > On Thu, Mar 18, 2010 at 22:38, Terry Reedy wrote: >> Having gotten that far, I think this might be worth referencing in new dev >> docs. > > Will do. I finally read hginit yesterday, after having seen people > rave about it on twitter for a few weeks, and it's a very frie

Re: [Python-Dev] Decimal & lt; -& gt; float comparisons in py3k.

2010-03-19 Thread Antoine Pitrou
Glenn Linderman nevcal.com> writes: > > On the other hand, if the default behavior is to do an implicit > conversion, I don't know of any way that that could be turned into an > exception for those coders that don't want or don't like the particular > type of implicit conversion chosen. You s

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Mark Dickinson
On Fri, Mar 19, 2010 at 9:37 AM, Mark Dickinson wrote: > Making hashes of int, > float, Decimal *and* Fraction all compatible with one another, > efficient for ints and floats, and not grossly inefficient for > Fractions and Decimals, is kinda hairy, though I have a couple of > ideas of how it cou

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-19 Thread Mark Dickinson
On Thu, Mar 18, 2010 at 9:48 PM, Nick Coghlan wrote: > Note that even in Py3k there are some fairly serious weirdnesses kicking > around due to the intransitive nature of numeric equality though: Yep. My personal favourite is: >>> from decimal import Decimal as dec >>> set((1, 1.0, dec(1))) ==

Re: [Python-Dev] Joel Spolsky on Mercurial

2010-03-19 Thread Dirkjan Ochtman
On Thu, Mar 18, 2010 at 22:38, Terry Reedy wrote: > Having gotten that far, I think this might be worth referencing in new dev > docs. Will do. I finally read hginit yesterday, after having seen people rave about it on twitter for a few weeks, and it's a very friendly introduction. Cheers, Dirk

[Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread anatoly techtonik
I want to push some of my patches before 2.7 and use 5-1 rule for that, but I can't come up with any review workflow other than mailing status of my comments to the issues here. I can't mark issues in any way. How about giving users ability to set flags or keywords? Maybe entering a separate field