[issue4087] equality involving Decimals is not transitive; strange set behaviour results

2008-10-09 Thread Mark Dickinson
New submission from Mark Dickinson <[EMAIL PROTECTED]>: The Decimal module breaks transitivity of equality: Decimal(2) == 2 and 2 == float(2), but Decimal(2) != float(2). The Python set and dict implementations rely on transitivity of equality for correct operation. These two facts to

[issue3724] math.log(x, 10) gives different result than math.log10(x)

2008-10-09 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: > Mark, is some of the inaccuracy due to double rounding? No, I don't think so; at least, not in the sense of rounding the same value twice (with different precisions). I get similar results on my Core 2 Duo machine, w

[issue4091] python dll not installed in windows system directory

2008-10-09 Thread Mark Hammond
Changes by Mark Hammond <[EMAIL PROTECTED]>: -- nosy: +mhammond ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4091> ___ ___ Python

[issue4090] Documenting set comparisons and operations

2008-10-10 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: [Raymond] > I don't think this is necessary. I disagree. I think some sort of warning is necessary; it doesn't need to be particularly prominent, but it should be there. Almost *all* expectations are broken for set

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: I've applied a minimal fix for bugs 5 and 7 in r77530 (trunk). (I wasn't able to produce any strings that trigger bug 7, so it may not technically be a bug.) I'm continuing to review, comment, and clean up the remainder of the

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: Fixes merged to py3k and release31-maint in r77535 and r77537. -- priority: release blocker -> normal ___ Python tracker <http://bugs.python.org/iss

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: One of the buildbots just produced a MemoryError from test_strtod: http://www.python.org/dev/buildbot/all/builders/i386%20Ubuntu%203.x/builds/411 It looks as though there's a memory leak somewhere in dtoa.c. It's a bit difficult to tell, though,

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: Okay, so there's a memory leak for overflowing values: if an overflow is detected in the main correction loop of _Py_dg_strtod, then 'references' to bd0, bd, bb, bs and delta aren't released. There may be other leaks; I'm trying t

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: Stefan, thanks for that! I'm not entirely sure how to make use of it, though. Is there a way to tell Valgrind that some leaks are expected? The main problem with leak detection is that dtoa.c deliberately keeps hold of any malloc'ed chunks l

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-16 Thread Mark Dickinson
Mark Dickinson added the comment: Upgrading to release blocker again: the memory leak should be fixed for 2.7 (and more immediately, for 3.1.2). -- priority: normal -> release blocker ___ Python tracker <http://bugs.python.org/iss

[issue7721] Code in xrange documentation does not work

2010-01-17 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue7721> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue2531] float compared to decimal is silently incorrect.

2010-01-17 Thread Mark Dickinson
Mark Dickinson added the comment: I'll try to find time to look at this again before 2.7 beta. -- assignee: -> mark.dickinson ___ Python tracker <http://bugs.python.or

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-17 Thread Mark Dickinson
Mark Dickinson added the comment: Stefan, I'm not particularly familiar with Valgrind: can you tell me what would need to be done? Is a non-caching version of pow5mult all that's required? Here's the patch that I'm using to detect leaks at the moment. (It includes a s

[issue7632] dtoa.c: oversize b in quorem, and a menagerie of other bugs

2010-01-17 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Stefan. Applied in r77589 (trunk), r77590 (py3k), r77591 (release31-maint) with one small change: I moved the freelist and p5s declarations inside the #ifndef Py_USING_MEMORY_DEBUGGER conditionals. The leak itself was fixed in revisions r77578

[issue7710] Inconsistent Exception for int() conversion

2010-01-20 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue7710> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7743] Additional potential string -> float conversion issues.

2010-01-20 Thread Mark Dickinson
New submission from Mark Dickinson : 1. Another potential crash caused by Python/dtoa.c: if the bigcomp functionality is disabled by replacing "#define STRTOD_DIGLIM 40" with "#define STRTOD_DIGLIM 4000", then the following string ca

[issue7743] Additional potential string -> float conversion issues.

2010-01-20 Thread Mark Dickinson
Mark Dickinson added the comment: Okay, it's not that difficult to trigger (2). With the bigcomp functionality disabled as above: AssertionError: Incorrectly rounded str->float conver

[issue7754] decimal.Decimal 0.0**0.0 error

2010-01-22 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report. Unfortunately, this behaviour is by design: the decimal module follows the specification at http://speleotrove.com/decimal/decarith.html See particularly: http://speleotrove.com/decimal/daops.html#refpower Yes, I think this is

[issue7754] decimal.Decimal 0.0**0.0 error

2010-01-22 Thread Mark Dickinson
Mark Dickinson added the comment: Now that I think about it, this could be 'fixed' without breaking compliance: all the specification requires is that a power function with the specified behaviour is present *somewhere* in the decimal module; it needn't be linked to the *

[issue7743] Additional potential string -> float conversion issues.

2010-01-22 Thread Mark Dickinson
Mark Dickinson added the comment: Second bug listed here fixed in r77698 in the trunk. -- ___ Python tracker <http://bugs.python.org/issue7743> ___ ___ Python-bug

[issue7754] decimal.Decimal 0.0**0.0 error

2010-01-22 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the feedback, Raymond. I'll close this, then. -- status: open -> closed ___ Python tracker <http://bugs.python.or

[issue7743] Additional potential string -> float conversion issues.

2010-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: > Out of curiosity, is it possible to write unit tests for any/all of this? There are some tests in Lib/test/test_strtod.py, that I added around two weeks ago and have been updating since; I don't have mechanism for running tests with the

[issue7743] Additional potential string -> float conversion issues.

2010-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: I forgot to mention: the other reason one might want to disable the bigcomp stuff is that it seems less reliable than the rest of the code: of the 11-12 independent bugs that I found in dtoa.c recently, around 9 of them were related to the bigcomp code

[issue7743] Additional potential string -> float conversion issues.

2010-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: First bug fixed (in the trunk) in r77713. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-24 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue7767> ___ ___ Python-bugs-lis

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the latest patch! It's looking good, but I have a few comments: (1) It's not necessary to do an isinstance(a, Decimal) check before calling _convert_other, since _convert_other does that check anyway. It doesn't really harm

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: One more: (5) The patch includes a (presumably accidental) change to the divmod docstring, from "Return (a // b, a % b)" to "Return (self // other, self % other)". I think the first v

[issue7633] decimal.py: type conversion in context methods

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: And another. :) (6) I think that with these changes, the single argument methods, like Context.exp, and Context.sqrt, should also accept integers. Thoughts? -- ___ Python tracker <http://bugs.python.

[issue2531] float compared to decimal is silently incorrect.

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: So here's the plan for trunk. The big question is: what should be done for py3k? For trunk: - all comparisons (==, !=, <=, >=, <, >) between floats and Decimals return the correct numerical result, as though the float were conve

[issue2531] float compared to decimal is silently incorrect.

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Stefan: the problem is backwards compatibility. In 2.6 it's possible to sort a heterogeneous list that contains both Decimal instances and floats. The resulting order may not be particularly meaningful, but for some applications that doesn't m

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: I think that recipe is meant more as a simple example of what's possible than as a bullet-proof library function. Can you suggest changes that would improve accuracy while also keeping the recipe clear and simple? The usual method for sin/cos is to

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. Isn't sine periodic with period 2*pi, not pi? I'd also suggest making use of remainder_near. -- ___ Python tracker <http://bugs.python.

[issue7770] sin/cos function in decimal-docs

2010-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: Johannes: note that the reduction needs to be by 2*pi, not pi. The remainder_near method is slightly better than the modulo operator here: remainder_near reduces to the range [-pi, pi], while the modulo operator reduces to the range (-2*pi, 2*pi), so ends up

[issue1205239] Let shift operators take any integer value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Interesting. I agree that that looks like a case where it would be desirable for a >> -n to do a << n. By the way, I don't think your formula is quite correct: your crc is going to grow unboundedly as extra data bytes come in. I suspect

[issue1205239] Let shift operators take any integer value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: One other thought: you could always compute the expression crc >> (crc_width - 8) as crc << 8 >> crc_width Since you're computing crc << 8 anyway, this doesn't increase the operations count, so probably would

[issue7633] decimal.py: type conversion in context methods

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Juan, don't worry about the documentation if you don't want to. I can fix that up easily. (Of course, if you do want to, go ahead!) -- ___ Python tracker <http://bugs.python.

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue7788> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Raising priority: it shouldn't be possible to crash Python this easily. Ezio, are you on a 64-bit or 32-bit system? -- priority: normal -> critical ___ Python tracker <http://bugs.python.or

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: I don't immediately see why it would be considered a security issue. -- ___ Python tracker <http://bugs.python.org/i

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: There's a suspicious looking test in list_ass_subscript in Objects/listobject.c: if (cur + step >= Py_SIZE(self)) { lim = Py_SIZE(self) - cur - 1; } I think what's happening here is that cur + step is overflowing, so that th

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks. Yes, that fix seems to work. I also tried rewriting the suspect test as if (step >= Py_SIZE(self) - cur) but this produced a different failure: it looks like there's more than one point with potential overflow for cur. Not to mention

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: And judging by flox's result for bytearray, we should check all the other sequence types, too. -- stage: test needed -> needs patch ___ Python tracker <http://bugs.python.or

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Nice! Marcin, are you interested in contributing a patch that fixes the three known cases (bytearray, list, array), and also adds suitable tests? -- ___ Python tracker <http://bugs.python.org/issue7

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Great---thank you! I'll review the patch when it's ready. -- assignee: -> mark.dickinson ___ Python tracker <http://bugs.pyth

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-26 Thread Mark Dickinson
Mark Dickinson added the comment: Raising priority again. I'm not sure when 3.1.2 is going out, but I'd like to make sure that this issue at least gets considered before it does. -- priority: critical -> release blocker ___ Python t

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: Perfect! Applied in r77821 through r77824; thank you. -- status: open -> closed ___ Python tracker <http://bugs.python.org/iss

[issue7807] test_macostools fails on OS X 10.6: no attribute 'FSSpec'

2010-01-29 Thread Mark Dickinson
New submission from Mark Dickinson : I've been seeing the following test failure for trunk and release26-maint for a while, on OS X 10.6, on a relatively recent Macbook Pro (clean installation of Snow Leopard). This is from a non-framework debug build (i.e., a simple ./configure &a

[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: The updated patch looks good---thank you! We're getting there... :) I'm not sure about the extra 'Operand can be Decimal or int.' in the method docstrings; this just looks like extra clutter to me. Rather, I think it would be

[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: > copy_sing fixed and documented to have the same behaibour. Hmm. Thanks for noticing this: it looks like Decimal.copy_sign is missing a _convert_other call. I think that should be fixed in the Decimal class rather than in the Context class

[issue7684] decimal.py: infinity coefficients in tuples

2010-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: Issue 1: (passing coefficients to decimal constructor): While I agree that passing a coefficient for an infinity doesn't make a lot of sense, there's a backwards compatibility problem here: it worked in 3.1, so making it raise an exception in

[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: Re: canonical. Yes, this made me pause for a second, too. But I don't see the harm in allowing it to accept ints and longs. Actually, it then provides a nice public version of _convert_other. I'd probably also allow is_canonical and number_class

[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: The proposed addition sounds entirely reasonable to me. In your patch, is there a reason for leaving out the first PyInt_Check (compare with PyLong_AsLongAndOverflow)? -- ___ Python tracker <h

[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: Ok, great. I'll add the PyInt_Check back in and commit the patch, then. I just wanted to check that I wasn't missing something obvious. Thank you! -- ___ Python tracker <http://bugs.python.

[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: Applied in r77842 (trunk), r77843 (py3k). -- resolution: -> accepted status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue7844] Add -3 warning for absolute imports.

2010-02-03 Thread Mark Dickinson
New submission from Mark Dickinson : It would be good to have a -3 warning for any use of import in 2.7 whose semantics change in 3.x, as a result of the absolute imports PEP (PEP 328). -- components: Interpreter Core messages: 98781 nosy: mark.dickinson severity: normal status: open

[issue7845] complex.__lt__ should return NotImplemented instead of raising TypeError

2010-02-03 Thread Mark Dickinson
New submission from Mark Dickinson : Currently in py3k, order comparisons for complex numbers raise a TypeError. This was necessary in Python 2.x in order to make a complex <-> complex comparison raise an exception. In 3.x, it's no longer necessary, since if both sides of a

[issue7845] complex.__lt__ should return NotImplemented instead of raising TypeError

2010-02-03 Thread Mark Dickinson
Changes by Mark Dickinson : -- stage: -> needs patch ___ Python tracker <http://bugs.python.org/issue7845> ___ ___ Python-bugs-list mailing list Unsubscri

[issue5211] Fix complex type to avoid coercion in 2.7.

2010-02-03 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, I'd certainly be interested in reviewing a patch. Though the current behaviour is at most a minor wart, and since it's gone in Python 3.x the motivation to fix it isn't huge. :) > Where as I think gumtree wants the xcomplex case

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-02-03 Thread Mark Dickinson
Mark Dickinson added the comment: This patch is producing warnings about signed <-> unsigned comparisons on the Windows buildbots; these should be fixed. See: http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%202.6/builds/781/steps/compile/logs/warnings -- pr

[issue5211] Fix complex type to avoid coercion in 2.7.

2010-02-04 Thread Mark Dickinson
Mark Dickinson added the comment: Blair: I don't think you'll have any problems getting the behaviour you in Python 3. For example: Python 3.2a0 (py3k:77952, Feb 4 2010, 10:56:12) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright&quo

[issue5211] Fix complex type to avoid coercion in 2.7.

2010-02-04 Thread Mark Dickinson
Mark Dickinson added the comment: > As you pointed out in issue 3734, the patch is basically: > Yes, that's the essence of it. In addition, each of the functions implementing a complex special method would need to do its own argument conversion. (Compare the implementation of

[issue5211] Fix complex type to avoid coercion in 2.7.

2010-02-04 Thread Mark Dickinson
Mark Dickinson added the comment: > Yes, that was what I was proposing. But as you point out, the new > behaviour wouldn't even match the behaviour of Python 3.x, so it really > wouldn't be a terribly useful change. Hmm. I take this back: if complex were made 'ne

[issue5211] Fix complex type to avoid coercion in 2.7.

2010-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks. I'll try to find time to look at this tomorrow. -- assignee: -> mark.dickinson ___ Python tracker <http://bugs.python.or

[issue7873] Remove precision restriction for integer formatting.

2010-02-07 Thread Mark Dickinson
New submission from Mark Dickinson : Currently, in trunk: >>> '%0.116x' % 1 '0001' >>> '%0.117x' % 1 Traceback (most recent call la

[issue7873] Remove precision restriction for integer formatting.

2010-02-07 Thread Mark Dickinson
Mark Dickinson added the comment: Looks like I accidentally truncated that traceback. Here's the full version: Python 2.7a2+ (trunk:78008M, Feb 5 2010, 23:39:39) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits"

[issue7873] Remove precision restriction for integer formatting.

2010-02-07 Thread Mark Dickinson
Mark Dickinson added the comment: Removing 3.2 from the versions: the OverflowError appears to be specific to 2.x ints: >>> '%0.117x' % 1L '1'

[issue7296] OverflowError: signed integer is greater than maximum on mips64

2010-02-08 Thread Mark Dickinson
Mark Dickinson added the comment: Many thanks for the update. I'll close this as not a Python bug, then. (Unless there's an easy and nonintrusive workaround...) -- resolution: -> wont fix status: open -> closed ___ Pytho

[issue7889] random produces different output on different architectures

2010-02-09 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue7889> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7889] random produces different output on different architectures

2010-02-09 Thread Mark Dickinson
Mark Dickinson added the comment: [Antoine] > >>> random.seed(int.from_bytes(b'foo', 'little')) +1 for either documenting this useful trick, or modifying init_by_array to do this automatically for buffer-like objects. Disallowing other types of input for t

[issue1533] Bug in range() function for large values

2010-02-10 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue1533> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7906] float("INFI") returns inf on certain platforms

2010-02-11 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the report, and for the analysis. I'd call this a bug in the Solaris strtod function (though that doesn't preclude adding a workaround for Python): the C standards (well, C99, anyway; I don't have access to C89 at the moment) en

[issue7906] float("INFI") returns inf on certain platforms

2010-02-11 Thread Mark Dickinson
Mark Dickinson added the comment: > Is there any chance to get those changes you mentioned backported to 2.6? Actually, to be honest, I'm not sure that backporting these changes to the release branch is a good idea. Is this bug causing problems in real code (besides the test sui

[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson
Mark Dickinson added the comment: Out of curiosity, where are your data coming from? For Python, this seems like a needless complication. It should be simple enough to replace the 'D's with 'E's prior to passing the strings to float. I notice that some varieties of Li

[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson
Mark Dickinson added the comment: Sorry, I'm -1 on this: outside Fortran, using 'E' for the exponent marker seems to be near universal. It just doesn't seem worth adding the extra complication to the Python code, or going through all the various places that expect an &#

[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson
Mark Dickinson added the comment: > I would rather not do a search and replace every time before reading in > the > data. There's no need to do a search and replace *before* reading the data: read the data first, then have Python do the replace for you before passing each st

[issue7919] reading scientific notation using d instead of e on max osx

2010-02-12 Thread Mark Dickinson
Mark Dickinson added the comment: Done in r78166 (trunk), r78167 (py3k). -- ___ Python tracker <http://bugs.python.org/issue7919> ___ ___ Python-bugs-list mailin

[issue3132] implement PEP 3118 struct changes

2010-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: Some of the proposed struct module additions look far from straightforward; I find that section of the PEP significantly lacking in details and motivation. "Unpacking a long-double will return a decimal object or a ctypes long-double." Returning

[issue3132] implement PEP 3118 struct changes

2010-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: Whoops. ctypes does have long double, of course. Apologies. -- ___ Python tracker <http://bugs.python.org/issue3132> ___ ___

[issue1023290] Conversion of longs to bytes and vice-versa.

2010-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: A couple of questions for the backport: (1) should the 'signed' parameter remain keyword-only in 2.7? I'd say yes, to avoid issues when forward-porting code from 2.7 to 3.2. On the other hand, 2.7 doesn't support keyword-only arguments

[issue1023290] Conversion of longs to bytes and vice-versa.

2010-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Alexandre! Agreed on both points. I don't really want to allow u'big' and u'little', but I think that's just my laziness talking. (Apart from that, I have a working patch.) There's some precedent for not allowi

[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks both of you for (finally) tracking this down! I've applied flox's quick fix in r78172, and reverted the old attempted fix in r78173. Both merged to py3k in r78174. -- resolution: -> fixed stage: patch review -> committed

[issue5125] Strange locale problem with Python 3

2010-02-13 Thread Mark Dickinson
Mark Dickinson added the comment: Actually, for Python 3.x, rather than using strtod directly it would be better to use the PyOS_string_to_double C-API function. That function is entirely locale-agnostic: it should behave identically to the float constructor. Python 3.0 is no longer

[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-02-14 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, adding carefully placed (size_t) casts seems like the right way to solve the problem. I've fixed all (I think) the warnings in r78183, r78184, r78189. I also fixed one case (unrelated to this issue) of potential undefined behaviour from s

[issue7947] Documentation of math.pow, math.hypot, and complex.__abs__

2010-02-16 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for reporting this. Rather than documenting corner cases explicitly, maybe it would be enough to point to the C99 standard: the corner cases for the math functions should (modulo bugs) all follow Annex F of the C standard, while the corner cases for

[issue7947] Documentation of math.pow, math.hypot, and complex.__abs__

2010-02-16 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. Looking at the docs, there are a number of revisions that would be useful. For example, the docs mention signaling NaNs, but that doesn't make a lot of sense: Python essentially treats all NaNs as quiet. I'll add this to my

[issue3132] implement PEP 3118 struct changes

2010-02-17 Thread Mark Dickinson
Mark Dickinson added the comment: > And under what conditions would a ctype long double be used vs. a > Decimal object. Well, I'm guessing that this was really just an open question for the PEP, and that the PEP authors hadn't decided which of these two options was more appr

[issue3132] implement PEP 3118 struct changes

2010-02-17 Thread Mark Dickinson
Mark Dickinson added the comment: I'm looking for previous discussions of this PEP. There's a python-dev thread in April 2007: http://mail.python.org/pipermail/python-dev/2007-April/072537.html Are there other discussions that I

[issue7633] decimal.py: type conversion in context methods

2010-02-17 Thread Mark Dickinson
Mark Dickinson added the comment: The latest patch looks fine. I've attached a slightly tweaked version: - Add conversions for number_class; without this, number_class is inconsistent with the various is_*** methods. "c.is_normal(3)" should be equivalent to "

[issue7633] decimal.py: type conversion in context methods

2010-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: Tweaked some doctests in r78218: - add integer argument doctest for logical_invert - fix integer literals with a leading zero for the other logical_*** methods, since they're illegal in Python 3. Merged to py3k in r78219. Thanks, eve

[issue7958] test_platform failure on OS X 10.6

2010-02-18 Thread Mark Dickinson
New submission from Mark Dickinson : With a 64-bit debug non-framework builds of the trunk and py3k, on OS X 10.6, I'm consistently getting the following failure in test_platform: trunk dickinsm$ ./python.exe Lib/test/regrtest.py -uall test_platform test_platform [18064 refs] 'i

[issue7961] Py3k: decoding empty bytestring with invalid encoding throws no error

2010-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: Specifically, the behaviour comes from an early check for empty strings in the PyUnicode_FromEncodedObject function: /* Convert to Unicode */ if (len == 0) { Py_INCREF(unicode_empty); v = (PyObject *)unicode_empty; } else

[issue7961] Py3k: decoding empty bytestring with invalid encoding throws no error

2010-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the patch. Rather than remove that optimization entirely, I'd consider pushing it into PyUnicode_Decode. All tests (whether for the standard library or for the core) go into Lib/test, so that would be the right place. test_codecs_errors in

[issue7961] Py3k: decoding empty bytestring with invalid encoding throws no error

2010-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: I take that back: test_codecs_errors isn't the right function to add these tests to. I actually don't see any current tests for invalid codecs. Part of the problem would be coming up with an invalid codec name in the first place: as I understa

[issue7961] Py3k: decoding empty bytestring with invalid encoding throws no error

2010-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: And PyUnicode_Decode doesn't look up the encoding in the registry either: that's somewhere in PyCodec_Decode. I'm going to butt out now and leave this to those who know the code better. :) -- ___

[issue5211] Fix complex type to avoid coercion in 2.7.

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: Apologies for the delay; tomorrow was a long time coming... The patch looks great---thank you! I added a ".. versionchanged" note to the documentation, and fixed a couple of whitespace issues; apart from that I didn't change anything. Ap

[issue2395] [Py3k] struct module changes of PEP 3118

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: I think this can be closed as a duplicate of issue 3132. (Yes, this issue came first, but all the interesting(?) discussion is over in issue 3132.) -- dependencies: -implement PEP 3118 struct changes nosy: +mark.dickinson resolution: -> duplic

[issue3132] implement PEP 3118 struct changes

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: [Meador Inge] > So the next step is to kick off a thread on python-dev summarizing the > questions\problems we have come up with? I can get that started. Sounds good. I'd really like to see some examples of how these struct-module additions would

[issue7384] curses crash on FreeBSD

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: > It does appear that curses itself is broken on FreeBSD Rereading this, it doesn't say what I meant it to say: I meant that the Python curses module seems to be broken, not that the system-level curses library is broken (though that seems poss

[issue7974] Valgrind error when running Python command within Vim

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: The code you identify looks okay to me: in PyMarshal_ReadObjectFromString, isn't it only the temporary variable rf that has a pointer to the string? Have you read Misc/README.valgrind in the Python source? -- nosy: +mark.dick

[issue7974] Valgrind error when running Python command within Vim

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the update! -- ___ Python tracker <http://bugs.python.org/issue7974> ___ ___ Python-bugs-list mailing list Unsub

<    13   14   15   16   17   18   19   20   21   22   >