Re: [Python-Dev] PEP 4000 to explicitly declare we won't be doing a Py3k style compatibility break again?

2014-08-18 Thread Mark Dickinson
[Moderately off-topic] On Sun, Aug 17, 2014 at 3:39 AM, Steven D'Aprano wrote: > I used to refer to Python 4000 as the hypothetical compatibility break > version. Now I refer to Python 5000. > I personally think it should be Python 500, or Py5M. When we come to create the mercurial branch,

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-12 Thread Mark Dickinson
On Mon, Mar 12, 2018 at 4:49 PM, Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > What is the proposal? > * Add an is_integer() method to int(), Decimal(), Fraction(), and Real(). > Modify Rational() to provide a default implementation. > >From the issue discussion, it sounds to me as th

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-13 Thread Mark Dickinson
On Mon, Mar 12, 2018 at 9:18 PM, Tim Peters wrote: > [Guido] > > as_integer_ratio() seems mostly cute (it has Tim Peters all > > over it), > > Nope! I had nothing to do with it. I would have been -0.5 on adding > it had I been aware at the time. > Looks like it snuck into the float type a

Re: [Python-Dev] Deprecating float.is_integer()

2018-03-21 Thread Mark Dickinson
I'd prefer to see `float.is_integer` stay. There _are_ occasions when one wants to check that a floating-point number is integral, and on those occasions, using `x.is_integer()` is the one obvious way to do it. I don't think the fact that it can be misused should be grounds for deprecation. As far

Re: [Python-Dev] Deprecating float.is_integer()

2018-03-21 Thread Mark Dickinson
On Wed, Mar 21, 2018 at 8:49 PM, David Mertz wrote: > For example, this can be true (even without reaching inf): > > >>> x.is_integer() > True > >>> (math.sqrt(x**2)).is_integer() > False > If you have a moment to share it, I'd be interested to know what value of `x` you used to achieve this, an

Re: [Python-Dev] Using more specific methods in Python unit tests

2014-02-16 Thread Mark Dickinson
On Sun, Feb 16, 2014 at 12:22 AM, Nick Coghlan wrote: > The practical benefits of this kind of change in the test suite are > also highly dubious, because they *only help if the test fails at some > point in the future*. At that point, whoever caused the test to fail > will switch into debugging

Re: [Python-Dev] Language Summit notes

2014-04-17 Thread Mark Dickinson
On Wed, Apr 16, 2014 at 11:26 PM, Antoine Pitrou wrote: > What does this mean exactly? Under OS X and Linux, Python is typically > installed by default. Under OS X, at least, I think there are valid reasons to not want to use the system-supplied Python. On my up-to-date OS X 10.9.2 machine, I s

Re: [Python-Dev] is the concept of 'reference ownership' no long applicable in Python 3.4?

2014-04-17 Thread Mark Dickinson
On Thu, Apr 17, 2014 at 4:34 PM, Jianfeng Mao wrote: > I noticed the following changes in the C API manuals from 3.3.5 (and > earlier versions) to 3.4. I don’t know if these changes are deliberate and > imply that we C extension developers no longer need to care about > ‘reference ownership’ beca

Re: [Python-Dev] is the concept of 'reference ownership' no long applicable in Python 3.4?

2014-04-17 Thread Mark Dickinson
On Thu, Apr 17, 2014 at 5:33 PM, Mark Dickinson wrote: > This looks like a doc build issue: when I build the documentation locally > for the default branch, I still see the expected "Return value: New > reference." lines. > Opened http://bugs.python.org/issue21286 for

Re: [Python-Dev] Informal educator feedback on PEP 572 (was Re: 2018 Python Language Summit coverage, last part)

2018-07-01 Thread Mark Dickinson
On Fri, Jun 22, 2018 at 7:28 PM, Chris Barker via Python-Dev < python-dev@python.org> wrote: > > But once it becomes a more common idiom, students will see it in the wild > pretty early in their path to learning python. So we'll need to start > introducing it earlier than later. > > I think this r

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-03-31 Thread Mark Dickinson
On Sun, Mar 31, 2013 at 2:29 PM, Mark Shannon wrote: > class Int1(int): > def __init__(self, val=0): > print("new %s" % self.__class__) > > class Int2(Int1): > def __int__(self): > return self > > and two instances > i1 = Int1() > i2 = Int2() > > we get the following behav

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-02 Thread Mark Dickinson
On Tue, Apr 2, 2013 at 1:44 AM, Nick Coghlan wrote: > int() and operator.index() are both type coercion calls to produce true > Python integers - they will never return a subclass, and this is both > deliberate and consistent with all the other builtin types that accept an > instance of themselve

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-02 Thread Mark Dickinson
On Tue, Apr 2, 2013 at 8:07 AM, Mark Dickinson wrote: > On Tue, Apr 2, 2013 at 1:44 AM, Nick Coghlan wrote: > >> There's code in the slot wrappers so that if you return a non-int object >> from either __int__ or __index__, then the interpreter will complain about >

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-02 Thread Mark Dickinson
On Tue, Apr 2, 2013 at 9:33 AM, Mark Shannon wrote: > > Hence my original question: what *should* the semantics be? > > I like Nick's answer to that: int *should* always return something of exact type int. Otherwise you're always left wondering whether you have to do "int(int(x))", or perhaps ev

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-02 Thread Mark Dickinson
On Tue, Apr 2, 2013 at 9:58 AM, Maciej Fijalkowski wrote: > > My 2 cents here is that which one is called seems to be truly random. > Try looking into what builtin functions call (for example list.pop > calls __int__, who knew) > That sounds like a clear bug to me. It should definitely be using

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-02 Thread Mark Dickinson
On Tue, Apr 2, 2013 at 10:02 AM, Mark Dickinson wrote: > On Tue, Apr 2, 2013 at 9:58 AM, Maciej Fijalkowski wrote: > >> >> My 2 cents here is that which one is called seems to be truly random. >> Try looking into what builtin functions call (for example list.pop &g

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-03 Thread Mark Dickinson
On Wed, Apr 3, 2013 at 12:17 PM, Nick Coghlan wrote: > Perhaps we should start emitting a DeprecationWarning for int subclasses > returned from __int__ and __index__ in 3.4? > +1. Sounds good to me. > (I like the idea of an explicit error over implicit conversion to the base > type, so deprecat

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-06 Thread Mark Dickinson
On Fri, Apr 5, 2013 at 6:34 PM, Terry Jan Reedy wrote: > 2. int(rational): for floats, Fractions, and Decimals, this returns the > integral part, truncating toward 0. Decimal and float have __int__ methods. > Fractions, to my surprise, does not, so int must use __floor__ or __round__ > as a backu

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
The PEP and code look generally good to me. I think the API for median and its variants deserves some wider discussion: the reference implementation has a callable 'median', and variant callables 'median.low', 'median.high', 'median.grouped'. The pattern of attaching the variant callables as attr

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
On Thu, Aug 15, 2013 at 2:25 AM, Steven D'Aprano wrote: > Can I request that people please look at this issue, with an aim to ruling > on the PEP and (hopefully) adding the module to 3.4 before feature freeze? > If it is accepted, I am willing to be primary maintainer for this module in > the futu

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano wrote: > > - Each scheme ended up needing to be a separate function, for ease of both > implementation and testing. So I had four private median functions, which I > put inside a class to act as namespace and avoid polluting the main > namespace. Th

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Mark Dickinson
cs import median; m = median(my_data)" should still work in the simple case. Mark > > Steven D'Aprano wrote: > >> On 15/08/13 21:42, Mark Dickinson wrote: >> >>> The PEP and code look generally good to me. >>> >>> I think the API

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Mark Dickinson
> I am interested in making a non-trivial improvement to list.sort() [...] Would your proposed new sorting algorithm be stable? The language currently guarantees stability for `list.sort` and `sorted`. -- Mark ___ Python-Dev mailing list Python-Dev@pyt

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Mark Dickinson
On Sun, Sep 11, 2016 at 7:43 PM, Elliot Gorokhovsky wrote: > So I suppose the thing to do is to benchmark stable radix sort against > timsort and see if it's still worth it. Agreed; it would definitely be interesting to see benchmarks for the two-array stable sort as well as the American Flag un

Re: [Python-Dev] 64 bit units in PyLong

2017-07-05 Thread Mark Dickinson
On Mon, Jul 3, 2017 at 5:52 AM, Siyuan Ren wrote: > The current PyLong implementation represents arbitrary precision integers in > units of 15 or 30 bits. I presume the purpose is to avoid overflow in > addition , subtraction and multiplication. But compilers these days offer > intrinsics that all

[Python-Dev] Re: What is __int__ still useful for?

2021-10-15 Thread Mark Dickinson
I'd propose that we relegate `__trunc__` to the same status as `__floor__` and `__ceil__`: that is, have `__trunc__` limited to being support for `math.trunc`, and nothing more. Right now the `int` constructor potentially looks at all three of `__int__`, `__index__` and `__trunc__`, so the proposal

[Python-Dev] Re: What is __int__ still useful for?

2021-10-15 Thread Mark Dickinson
Meta: apologies for failing to trim the context in the previous post. -- Mark ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/

[Python-Dev] Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2021-12-30 Thread Mark Dickinson
tl;dr: I'd like to deprecate and eventually remove the option to use 15-bit digits in the PyLong implementation. Before doing so, I'd like to find out whether there's anyone still using 15-bit PyLong digits, and if so, why they're doing so. History: the use of 30-bit digits in PyLong was introd

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2021-12-31 Thread Mark Dickinson
Thanks all! So to summarize: - 15-bit digits are still very much in use, and deprecating the option would likely be premature at this point - the main users are old 32-bit (x86), which it's difficult to care about too much, and new 32-bit (principally ARM microarchitectures), which we *do* care ab

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2021-12-31 Thread Mark Dickinson
On Fri, Dec 31, 2021 at 12:40 PM Skip Montanaro wrote: > Perhaps I missed it, but maybe an action item would be to add a > buildbot which configures for 15-bit PyLong digits. > Yep, good point. I was wrong to say that "15-bit builds don't appear to be exercised by the buildbots": there's a 32-b

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2022-01-02 Thread Mark Dickinson
On Sat, Jan 1, 2022 at 9:05 PM Antoine Pitrou wrote: > Note that ARM is merely an architecture with very diverse > implementations having quite differing performance characteristics. [...] > Understood. I'd be happy to see timings on a Raspberry Pi 3, say. I'm not too worried about things like

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2022-01-14 Thread Mark Dickinson
On Sun, Jan 2, 2022 at 10:35 AM Mark Dickinson wrote: > Division may still be problematic. > On that note: Python divisions are somewhat crippled even on x64. Assuming 30-bit digits, the basic building block that's needed for multi-precision division is a 64-bit-by-32-bit unsig

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2022-01-16 Thread Mark Dickinson
On Sat, Jan 15, 2022 at 8:12 PM Tim Peters wrote: > Something is missing here, but can't guess what without seeing the > generated machine code.But I trust Mark will do that. > Welp, there goes my weekend. :-) $ python -m timeit -n 150 -s "x = 10**1000" "x//10" 150 loops, best of 5: 3

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2022-01-16 Thread Mark Dickinson
On Sun, Jan 16, 2022 at 4:11 PM Terry Reedy wrote: > > > https://stackoverflow.com/questions/41183935/why-does-gcc-use-multiplication-by-a-strange-number-in-implementing-integer-divi > > and > > > https://stackoverflow.com/questions/30790184/perform-integer-division-using-multiplication > > have

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2022-01-16 Thread Mark Dickinson
On Sun, Jan 16, 2022 at 12:08 PM Mark Dickinson wrote: > So gcc is anticipating divisions by 10 and introducing special-case > divide-by-reciprocal-multiply code for that case, and presumably the > profile generated for the PGO backs up this being a common enough case, so > we end

[Python-Dev] Re: Is anyone using 15-bit PyLong digits (PYLONG_BITS_IN_DIGIT=15)?

2022-01-16 Thread Mark Dickinson
On Sun, Jan 16, 2022 at 9:28 PM Guido van Rossum wrote: > Does the optimization for //10 actually help in the real world? [...] > Yep, I don't know. If 10 is *not* the most common small divisor in real world code, it must at least rank in the top five. I might hazard a guess that division by 2 w

[Python-Dev] Should we require IEEE 754 floating-point for CPython?

2022-02-07 Thread Mark Dickinson
On Mon, Feb 7, 2022 at 5:11 PM Victor Stinner wrote: > I made a change to require C99 "NAN" constant [...] There's a separate discussion topic lurking here. It's equally in need of discussion here (IMO), but it's orthogonal to the "should we require C99" discussion. I've changed the subject li

[Python-Dev] Re: PEP 682: Format Specifier for Signed Zero

2022-03-06 Thread Mark Dickinson
PEP 682 (Format Specifier for Signed Zero) has been accepted! Please see https://discuss.python.org/t/accepting-pep-682-format-specifier-for-signed-zero/14088 Thanks to all involved, Mark ___ Python-Dev mailing list -- python-dev@python.org To unsubscri

Re: [Python-Dev] negative PyLong integer -> unsigned integer, TypeError or OverflowError?

2009-02-06 Thread Mark Dickinson
On Fri, Feb 6, 2009 at 9:04 PM, Lisandro Dalcin wrote: > At Objects/longobject.c, you should see that in almost all cases > OverflowError is raised when a unsigned integral is requested from a > negative PyLong. However, See this one: > [...] > if (!is_signed) { >

Re: [Python-Dev] negative PyLong integer -> unsigned integer, TypeError or OverflowError?

2009-02-07 Thread Mark Dickinson
On Fri, Feb 6, 2009 at 11:38 PM, Lisandro Dalcin wrote: > Done, http://bugs.python.org/issue5175 Thank you! Mark ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/m

Re: [Python-Dev] Tracker archeology

2009-02-10 Thread Mark Dickinson
On Tue, Feb 10, 2009 at 1:23 PM, Daniel (ajax) Diniz wrote: > If anyone is interested in being added as nosy for any category of > bugs, let me know and I'll do that as I scan the tracker. Feel free to assign anything math-related (math and cmath modules, float and complex objects) to me. Thanks

Re: [Python-Dev] Adding T_SIZET to structmember.h

2009-02-13 Thread Mark Dickinson
On Thu, Feb 12, 2009 at 8:42 PM, Lisandro Dalcin wrote: > I would like to propose the inclusion of a new T_SIZET in structmember.h > in order to suport 'size_t' struct fields with PyMemberDef. Would such > addition be accepted for 2.7 and 3.1? Please open a feature request at bugs.python.org, and

[Python-Dev] 30-bit PyLong digits in 3.1?

2009-02-17 Thread Mark Dickinson
A few months ago there was a discussion [1] about changing Python's long integer type to use base 2**30 instead of base 2**15. http://bugs.python.org/issue4258 was opened for this. With much help from many people (but especially Antoine and Victor), I've finally managed to put together an essenti

Re: [Python-Dev] 30-bit PyLong digits in 3.1?

2009-02-17 Thread Mark Dickinson
On Tue, Feb 17, 2009 at 7:49 PM, "Martin v. Löwis" wrote: > Can you please upload it to Rietveld also? Will do. I'm getting a "500 Server Error" at the moment, but I'll keep trying. Mark ___ Python-Dev mailing list Python-Dev@python.org http://mail.py

Re: [Python-Dev] 30-bit PyLong digits in 3.1?

2009-02-17 Thread Mark Dickinson
On Tue, Feb 17, 2009 at 8:42 PM, Guido van Rossum wrote: > Use the upload.py script (/static/upload.py) rather than the Create Issue > page. Thanks. That worked. http://codereview.appspot.com/14105 ___ Python-Dev mailing list Python-Dev@python.org ht

Re: [Python-Dev] Attention Bazaar mirror users

2009-02-25 Thread Mark Dickinson
On Wed, Feb 25, 2009 at 2:23 PM, Barry Warsaw wrote: > This is now done. Please let me know if you have any problems with the > mirrors. Is the cron job that's supposed to update the bzr repository still running? I'm getting 'No revisions to pull' when I do 'bzr pull' for the py3k branch: Macin

Re: [Python-Dev] Attention Bazaar mirror users

2009-02-27 Thread Mark Dickinson
On Fri, Feb 27, 2009 at 7:26 PM, Barry Warsaw wrote: > On Feb 25, 2009, at 2:03 PM, Mark Dickinson wrote: >> Is the cron job that's supposed to update the bzr repository still >> running? > I think I have this fixed now.  The branch updater is running on dinsdale &

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Mark Dickinson
2009/3/24 Daniel Stutzbach : > [...] > 100 nanoseconds, py3k trunk: > ceval -> PyObject_GetItem (object.c) -> list_subscript (listobject.c) -> > PyNumber_AsSsize_t (object.c) -> PyLong_AsSsize_t (longobject.c) > [more timings snipped] Does removing the PyLong_Check call in PyLong_AsSsize_t make an

Re: [Python-Dev] speeding up PyObject_GetItem

2009-03-24 Thread Mark Dickinson
On Tue, Mar 24, 2009 at 3:50 PM, Daniel Stutzbach wrote: > On Tue, Mar 24, 2009 at 10:13 AM, Mark Dickinson wrote: >> Does removing the PyLong_Check call in PyLong_AsSsize_t >> make any noticeable difference to these timings? > > Making no other changes from the trunk, remo

Re: [Python-Dev] pyc files, constant folding and borderline portability issues

2009-04-06 Thread Mark Dickinson
[Antoine] > - Issue #5593: code like 1e16+2. is optimized away and its result stored > as > a constant (again), but the result can vary slightly depending on the internal > FPU precision. [Guido] > I would just not bother constant folding involving FP, or only if the > values involved have an

Re: [Python-Dev] pyc files, constant folding and borderline portability issues

2009-04-06 Thread Mark Dickinson
On Mon, Apr 6, 2009 at 9:05 PM, Raymond Hettinger wrote: > The code for the lsum() recipe is more readable with a line like: > >  exp = long(mant * 2.0 ** 53) > > than with > >  exp = long(mant * 9007199254740992.0) > > It would be ashamed if code written like the former suddenly > started doing t

[Python-Dev] Shorter float repr in Python 3.1?

2009-04-07 Thread Mark Dickinson
Executive summary (details and discussion points below) = Some time ago, Noam Raphael pointed out that for a float x, repr(x) can often be much shorter than it currently is, without sacrificing the property that eval(repr(x)) == x, and proposed changing Python accordingly. See ht

Re: [Python-Dev] slightly inconsistent set/list pop behaviour

2009-04-07 Thread Mark Dickinson
On Wed, Apr 8, 2009 at 7:13 AM, John Barham wrote: > If you play around a bit it becomes clear that what set.pop() returns > is independent of the insertion order: It might look like that, but I don't think this is true in general (at least, with the current implementation): >>> foo = set([1, 65

Re: [Python-Dev] Test failure on Py3k branch

2009-04-11 Thread Mark Dickinson
On Sat, Apr 11, 2009 at 11:14 AM, Chris Withers wrote: > Also got the following failure from a py3k checkout: > > test test_cmd_line failed -- Traceback (most recent call last): >  File "/Users/chris/py3k/Lib/test/test_cmd_line.py", line 143, in > test_run_code >    0) > AssertionError: 1 != 0 Ar

Re: [Python-Dev] Python 2.6.2 final

2009-04-11 Thread Mark Dickinson
On Fri, Apr 10, 2009 at 2:31 PM, Barry Warsaw wrote: > bugs.python.org is apparently down right now, but I set issue 5724 to > release blocker for 2.6.2.  This is waiting for input from Mark Dickinson, > and it relates to test_cmath failing on Solaris 10. I'd prefer to leave this a

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 9:45 AM, Ned Deily wrote: > Ned Deily wrote: >> Eric Smith wrote: >> > Before then, if anyone could build and test the py3k-short-float-repr >> > branch on any of the following machines, that would be great: >> > >> [...] >> > Something bigendian, like a G4 Mac >> >> I'

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
By the way, a simple native build on OS X 10.4/PPC passed all tests (that we're already failing before). Mark ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailma

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 11:37 AM, Mark Dickinson wrote: > By the way, a simple native build on OS X 10.4/PPC passed all tests (that > we're already failing before). s/we're/weren't ___ Python-Dev mailing list Pytho

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 9:45 AM, Ned Deily wrote: > FIrst attempt was a fat (32-bit i386 and ppc) build on 10.5 targeted for > 10.3 and above; this is the similar to recent python.org OSX installers. What's the proper way to create such a build? I've been trying: ./configure --with-universal-ar

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
Okay, I think I might have fixed up the float endianness detection for universal builds on OS X. Ned, any chance you could give this another try with an updated version of the py3k-short-float-repr branch? One thing I don't understand: Is it true that to produce a working universal/fat build of

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 5:14 PM, Antoine Pitrou wrote: > If this approach is sane, could it be adopted for all other instances of > endianness detection in the py3k code base? I think everything else is fine: float endianness detection (for marshal, pickle, struct) is done at runtime. Integer e

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 5:49 PM, Antoine Pitrou wrote: > Mark Dickinson gmail.com> writes: >> Do you know the right way to create a universal build? > > Not at all, sorry. No problem :). I might try asking on the pythonmac-sig list. Mark

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 6:55 PM, "Martin v. Löwis" wrote: > The outcome of AC_C_BIGENDIAN isn't used on OSX. Depending on the exact > version you look at, things might work differently; in trunk, > Include/pymacconfig.h should be used [...] Many thanks---that was the missing piece of the puzzle.

Re: [Python-Dev] Shorter float repr in Python 3.1?

2009-04-14 Thread Mark Dickinson
On Tue, Apr 14, 2009 at 6:32 PM, Ned Deily wrote: > The OSX installer script is in Mac/BuildScript/build-installer.py. > > For 2-way builds, it essentially does: > > export MACOSX_DEPLOYMENT_TARGET=10.3 > configure -C --enable-framework >   --enable-universalsdk=/Developer/SDKs/MacOSX10.4u.sdk >  

Re: [Python-Dev] Python-Dev Digest, Vol 69, Issue 143

2009-04-17 Thread Mark Dickinson
On Fri, Apr 17, 2009 at 3:58 PM, Scott David Daniels wrote: > Non-associativity is what makes for floating point headaches. > To my knowledge, floating point is at least commutative. Well, mostly. :-) >>> from decimal import Decimal >>> x, y = Decimal('NaN123'), Decimal('-NaN456') >>> x + y Deci

Re: [Python-Dev] Summary of Python tracker Issues

2009-04-24 Thread Mark Dickinson
On Fri, Apr 24, 2009 at 9:25 PM, Terry Reedy wrote: > In going through this, I notice a lot of effort by Mark Dickenson and others Many others, but Eric Smith's name needs to be in big lights here. There's no way the short float repr would have been ready for 3.1 if Eric hadn't shown an interest

[Python-Dev] Two proposed changes to float formatting

2009-04-26 Thread Mark Dickinson
I'd like to propose two minor changes to float and complex formatting, for 3.1. I don't think either change should prove particularly disruptive. (1) Currently, '%f' formatting automatically changes to '%g' formatting for numbers larger than 1e50. For example: >>> '%f' % 2**166. '93536104789177

[Python-Dev] Bug tracker down?

2009-04-26 Thread Mark Dickinson
The bugs.python.org site seems to be down. ping gives me the following (from Ireland): Macintosh-4:py3k dickinsm$ ping bugs.python.org PING bugs.python.org (88.198.142.26): 56 data bytes 36 bytes from et.2.16.rs3k6.rz5.hetzner.de (213.239.244.101): Destination Host Unreachable Vr HL TOS Len ID

Re: [Python-Dev] Bug tracker down?

2009-04-26 Thread Mark Dickinson
On Sun, Apr 26, 2009 at 4:19 PM, Aahz wrote: > On Sun, Apr 26, 2009, Mark Dickinson wrote: >> >> The bugs.python.org site seems to be down. > > Dunno -- forwarded to the people who can do something about it.  (There's > a migration to a new mailserver going on, but I

Re: [Python-Dev] Two proposed changes to float formatting

2009-04-26 Thread Mark Dickinson
On Sun, Apr 26, 2009 at 5:59 PM, Eric Smith wrote: > Mark Dickinson wrote: >> I propose changing the complex str and repr to behave like the >> float version.  That is, repr(4. + 10.j) should be "(4.0 + 10.0j)" >> rather than "(4+10j)". > > I

Re: [Python-Dev] Two proposed changes to float formatting

2009-04-26 Thread Mark Dickinson
On Sun, Apr 26, 2009 at 8:11 PM, Scott David Daniels wrote: > As a user of Idle, I would not like to see the change you seek of > having %f stay full-precision.  When a number gets too long to print > on a single line, the wrap depends on the current window width, and > is calculated dynamically.

Re: [Python-Dev] Two proposed changes to float formatting

2009-04-26 Thread Mark Dickinson
On Sun, Apr 26, 2009 at 10:42 PM, Scott David Daniels wrote: > I had also said (without explaining: >> > only the trailing zeroes with the e, so we wind up with: >> >      1157920892373161954235709850086879078532699846656405640e+23 >> >  or 115792089237316195423570985008687907853269984665640564.0

[Python-Dev] One more proposed formatting change for 3.1

2009-04-28 Thread Mark Dickinson
Here's one more proposed change, this time for formatting of floats using format() and the empty presentation type. To avoid repeating myself, here's the text from the issue I just opened: http://bugs.python.org/issue5864 """ In all versions of Python from 2.6 up, I get the following behaviour:

Re: [Python-Dev] Proposed: drop unnecessary "context" pointer from PyGetSetDef

2009-05-04 Thread Mark Dickinson
On Mon, May 4, 2009 at 10:10 AM, Larry Hastings wrote: > So: you don't need it, it clutters up our code (particularly typeobject.c), > and it adds overhead.  The only good reason to keep it is backwards > compatibility, which I admit is a fine reason. Presumably whoever added the context field h

Re: [Python-Dev] Proposed: drop unnecessary "context" pointer from PyGetSetDef

2009-05-04 Thread Mark Dickinson
On Mon, May 4, 2009 at 8:11 PM, Daniel Stutzbach wrote: > If you make the change, will 3rd party code that relies on it fail in > unexpected ways, or will they just get a compile error? I *think* that third party code that's recompiled for 3.1 and that doesn't use the closure field will either ju

Re: [Python-Dev] Proposed: drop unnecessary "context" pointer from PyGetSetDef

2009-05-04 Thread Mark Dickinson
On Mon, May 4, 2009 at 9:15 PM, Antoine Pitrou wrote: > Mark Dickinson gmail.com> writes: >> >> I *think* that third party code that's recompiled for 3.1 and that >> doesn't use the closure field will either just work, or will produce an >> easily-fixe

Re: [Python-Dev] pylinting the stdlib

2009-08-02 Thread Mark Dickinson
On Sat, Aug 1, 2009 at 11:40 PM, Vincent Legoll wrote: > Hello, > > I've fed parts of the stdlib to pylint and after some filtering > there appears to be some things that looks strange, I've > filled a few bugs to the tracker for them. > > > > Is this useless and taking reviewer's time for nothing

Re: [Python-Dev] PEP 385: pruning/reorganizing branches

2009-08-04 Thread Mark Dickinson
Comments on some of the branches I've had involvement with... On Mon, Aug 3, 2009 at 11:51 AM, Dirkjan Ochtman wrote: > py3k-short-float-repr: strip streamed-merge Sounds fine. > py3k-issue1717: keep-clone I don't think there's any need to keep this branch; its contents were all merged (in pi

Re: [Python-Dev] random number generator state

2009-08-15 Thread Mark Dickinson
On Sat, Aug 15, 2009 at 8:54 PM, Scott David Daniels wrote: > [...] input to .setstate: old, new-short, and new-long.  In trying to > get this to work, I found what might be a bug: > code says >  mt[0] = 0x8000UL; /* MSB is 1; assuring non-zero initial array */ > but probably should be: >  mt[0

Re: [Python-Dev] Numeric alignment issue with PEP 3101

2009-09-08 Thread Mark Dickinson
On Mon, Sep 7, 2009 at 11:10 PM, Eric Smith wrote: > Hmm, I never noticed that. At this point, I think changing the formatting > for any types would break code, so we should just change the documentation > to reflect how currently works. I think the alignment for Decimal *does* need to be changed,

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-22 Thread Mark Dickinson
On Tue, Sep 22, 2009 at 3:37 PM, Chris Withers wrote: > Where are the specifications on what happens if two objects are compared and > both have implementations of __eq__? Which __eq__ is called? > What happens if the first one called returns False? Is the second one called? > What is one implem

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-22 Thread Mark Dickinson
On Tue, Sep 22, 2009 at 4:12 PM, Mark Dickinson wrote: > I'll open an issue for the duplicate __eq__ calls. http://bugs.python.org/issue6970 Mark ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/py

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-23 Thread Mark Dickinson
On Wed, Sep 23, 2009 at 9:12 AM, Chris Withers wrote: > Mark Dickinson wrote: >> >> I (still :-) think this is covered, for Python 2.x at least, by: >> >> http://docs.python.org/reference/datamodel.html#coercion-rules > > But this isn't coercion! :-) Agree

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-23 Thread Mark Dickinson
On Wed, Sep 23, 2009 at 4:43 AM, wrote: > >    Dino> For IronPython we wrote a set of tests which go through and define >    Dino> the various operator methods in all sorts of combinations on both >    Dino> new-style and old-style classes as well as subclasses of those >    Dino> classes and the

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-23 Thread Mark Dickinson
On Wed, Sep 23, 2009 at 4:54 PM, Dino Viehland wrote: > We are going to start contributing tests back real soon now.  I'm not sure > that these are the best tests to contribute as they require a version of > Python to compare against rather than being nice and stand alone.  But I'm > sure we have

[Python-Dev] Python build question (fixing pymath.c).

2009-09-27 Thread Mark Dickinson
Hello all, I'm looking for advice on how to clean up an ugliness (one that I'm at least partly responsible for) in the Python build setup. Here's the problem: some of the exported functions (e.g. atanh, log1p) in the Python/pymath.c file aren't needed by the Python core at all; they're exported

Re: [Python-Dev] Python build question (fixing pymath.c).

2009-09-27 Thread Mark Dickinson
On Sun, Sep 27, 2009 at 8:48 AM, Brett Cannon wrote: > On Sun, Sep 27, 2009 at 00:21, Mark Dickinson wrote: [...] >> So I've now got a file Modules/math_support.c that contains >> some functions needed by both mathmodule.c and >> cmathmodule.c, as well as a couple of f

Re: [Python-Dev] PEP 3144 review.

2009-09-28 Thread Mark Dickinson
On Mon, Sep 28, 2009 at 3:04 PM, Daniel Stutzbach wrote: > On Mon, Sep 28, 2009 at 7:24 AM, Nick Coghlan wrote: >> >> I should note that I've softened my position slightly from what I posted >> yesterday. I could live with the following compromise: >> >>    >>> x = IPv4Network('192.168.1.1/24') >

Re: [Python-Dev] PEP 3144 review.

2009-09-28 Thread Mark Dickinson
On Mon, Sep 28, 2009 at 3:42 PM, Dj Gilcrease wrote: > On Mon, Sep 28, 2009 at 8:04 AM, Daniel Stutzbach > wrote: >> On Mon, Sep 28, 2009 at 7:24 AM, Nick Coghlan wrote: >>> >>> I should note that I've softened my position slightly from what I posted >>> yesterday. I could live with the followin

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Mark Dickinson
On Wed, Sep 30, 2009 at 1:44 AM, Nick Coghlan wrote: > Martin v. Löwis wrote: >>> I would say that there certainly are precedents in other areas for >>> keeping the information about the input form around. For example, >>> occasionally it would be handy if parsing a hex integer returned an >>> obj

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Mark Dickinson
On Wed, Sep 30, 2009 at 10:52 AM, Paul Moore wrote: > 2009/9/30 Mark Dickinson : >> Please could someone who understands the uses of IPNetwork better than >> I do explain why the following wouldn't be a significant problem, if __eq__ >> and __hash__ were modified to disr

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Mark Dickinson
On Wed, Sep 30, 2009 at 12:06 PM, Nick Coghlan wrote: > Mark Dickinson wrote: >> Okay, so maybe this is an abuse of IPv4Network.  But I'd (mis?)understood >> that the retention of the .ip attribute was precisely a convenience to allow >> this sort of use.  If not, then

Re: [Python-Dev] summary of transitioning from % to {} formatting

2009-10-03 Thread Mark Dickinson
On Sat, Oct 3, 2009 at 4:41 PM, Steven Bethard wrote: > I thought it might be useful for those who don't have time to read a > million posts to have a summary of what's happened in the formatting > discussion. Definitely useful. Thanks for the summary! [...] > * Add a parameter which declares

[Python-Dev] Backport new float repr to Python 2.7?

2009-10-11 Thread Mark Dickinson
In a recent #python-dev IRC conversation, it was suggested that we should consider backporting the new-style float repr from py3k to trunk. I'd like to get people's opinions on this idea. To recap quickly, the algorithm for computing the repr of floats changed between Python 2.x and Python 3.x (w

Re: [Python-Dev] Backport new float repr to Python 2.7?

2009-10-12 Thread Mark Dickinson
[Guido] > I think you mean doctests? These are the primary reason I've always > been hesitant to change this in 2.x. Yes, sorry. I did of course mean doctests. It occurs to me that any doctests that depend on the precise form of repr(x) are, in a sense, already broken, since 2.x makes no guarante

Re: [Python-Dev] Backport new float repr to Python 2.7?

2009-10-12 Thread Mark Dickinson
On Mon, Oct 12, 2009 at 7:48 PM, Guido van Rossum wrote: > On Mon, Oct 12, 2009 at 11:41 AM, Mark Dickinson wrote: >> But str still has some value in py3k:  it protects users from >> accumulated rounded errors produced by arithmetic operations: > [...] > > I kno

Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Mark Dickinson
[I originally sent this reply to Skip instead of to the list; apologies.] On Thu, Oct 15, 2009 at 12:39 PM, wrote: > I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files > but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in > configure or pyconfig.h.

Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Mark Dickinson
On Thu, Oct 15, 2009 at 4:06 PM, Antoine Pitrou wrote: > pobox.com> writes: >> >> I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files >> but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in >> configure or pyconfig.h.in.  Are builds --without-complex s

Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Mark Dickinson
On Thu, Oct 15, 2009 at 8:17 PM, Antoine Pitrou wrote: (-1)**.5 > (6.123031769111886e-17+1j) > > Don't we have a precision problem here? 0.5 is supposed to be represented > exactly, isn't it? 0.5 is represented exactly, but complex.__pow__ makes no pretence of being correctly rounded (and ma

Re: [Python-Dev] SIGCHECK() in longobject.c

2009-10-18 Thread Mark Dickinson
On Sun, Oct 18, 2009 at 9:01 PM, Antoine Pitrou wrote: > In Objects/longobject.c, there's the SIGCHECK() macro which periodically > checks > for signals when doing long integer computations (divisions, multiplications). > It does so by messing with the _Py_Ticker variable. > > It was added in 19

  1   2   3   4   >