[issue7974] Valgrind error when running Python command within Vim

2010-02-21 Thread Mark Dickinson
Changes by Mark Dickinson : -- resolution: -> invalid ___ Python tracker <http://bugs.python.org/issue7974> ___ ___ Python-bugs-list mailing list Unsubscri

[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: Please could you generate and upload a patch against the Python source? (For Windows, you can do this using the WinMerge tool, amongst others.) I'm unable to open the file you attached on my machine: """No applicati

[issue3132] implement PEP 3118 struct changes

2010-02-21 Thread Mark Dickinson
Mark Dickinson added the comment: About long doubles again: I just encountered someone on the #python IRC channel who wanted to know whether struct.pack and struct.unpack supported reading and writing of x87 80-bit long doubles (padded to 12 bytes each in the input). A few quotes from him

[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: The ideal exponent for three-argument pow should definitely be zero. You're returning what's essentially an integer, loosely disguised as a decimal instance. -- ___ Python tracker <http://bu

[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: I've fixed the docs to accurately describe three-argument pow results (the exponent in particular) in r78312 through r78315. -- ___ Python tracker <http://bugs.python.org/i

[issue3132] implement PEP 3118 struct changes

2010-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: > One benefit of having a type code for 'long double' (assuming you are > mapping the value to the platform's 'long double') is that the you > don't have to know how many bytes are in the underlying representation.

[issue4174] Performance optimization for min() and max() over lists

2010-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: I agree that the performance improvement isn't worth the extra code, or the risk of introducing bugs (the comments so far show that it's not trivial to get this right). Closing as rejected. -- nosy: +mark.dickinson resolution: -> re

[issue7049] decimal.py: Three argument power issues

2010-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: Well, the real problem is that powmod doesn't really belong in the decimal module at all. It's not a natural primitive arithmetic operation; it's certainly not naturally a floating-point operation; nothing like this appears in any floating

[issue7997] http://www.python.org/dev/faq/ doesn't seem to explain how to regenerate "configure"

2010-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: This looks good! Is it worth mentioning that autoreconf updates pyconfig.h.in as well as configure? There's also an OS X oddity to be aware of, though I'm not sure whether it's worth mentioning in the FAQ. On OS X 10.6, the system auto

[issue7997] http://www.python.org/dev/faq/ doesn't seem to explain how to regenerate "configure"

2010-02-23 Thread Mark Dickinson
Mark Dickinson added the comment: > BTW, should the changes to the generated "configure" be excluded > from such patches, or should they be included? (to what extent do > they contain meaningful information during review?) Not sure. I think it's fine to leave the co

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Mark Dickinson
Mark Dickinson added the comment: Might it be T_PYSSIZET rather than T_INT? In which case it's PyLong_AsSsize_t that's at fault: it should raise TypeError for non-integers. What's slightly less clear is whether PyLong_AsSsize_t should also try to call int to conv

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch that raises TypeError if either PyLongAs_Size_t or PyLong_As_Ssize_t gets called with a valid non-integer PyObject *. I'm not sure where the most appropriate place for a test is. -- assignee: -> mark.dickinson key

[issue8023] bug in s.append(x)

2010-02-26 Thread Mark Dickinson
Mark Dickinson added the comment: This is a bug in your code, rather than in Python. A simpler example, for the purposes of explanation: >>> root, total = [0], [] >>> total.append(root) >>> total # good so far [[0]] >>> root[0] = 1 # modify root >&

[issue8023] bug in s.append(x)

2010-02-26 Thread Mark Dickinson
Mark Dickinson added the comment: > So s.append(x) just copies the pointer, not the actual value. Yes, that's a reasonable way to think about it (though the term 'reference' seems to more popular than 'pointer' in this context). It matches the implementation

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-01 Thread Mark Dickinson
Mark Dickinson added the comment: I'd be open to re-allowing use of __int__ (and __long__) consistently for all integer packing codes in 2.7, as a temporary measure; I'd really prefer not to allow this for 3.x. What would make more sense, IMO, would be to allow use of the __inde

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-01 Thread Mark Dickinson
Mark Dickinson added the comment: More or less, yes: when trying to pack a non-integer `x` (i.e. something that's not an instance of int or long) with an integer format code (one of 'bBhHiIlLqQ', or 'P'), `x.__index__()` would be called to convert `x` to an intege

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-01 Thread Mark Dickinson
Mark Dickinson added the comment: Also, it may be that some of r73858 needs to be reverted; going from accepting non-ints and longs in 2.6 to a TypeError in 2.7 is a bit much; there should have at least been a DeprecationWarning. I need to find some time to look at this properly, and work

[issue8062] PEP 3101 string formatting missing hexadecimal separator _ for every 4 hex digits

2010-03-05 Thread Mark Dickinson
Mark Dickinson added the comment: How common is this 'common practice'? Could you point to some publicly available examples? Are there other languages that have built-in facilities for dealing with hexadecimal representations of integers in this way? I think I've seen hex st

[issue8062] PEP 3101 string formatting missing hexadecimal separator _ for every 4 hex digits

2010-03-05 Thread Mark Dickinson
Mark Dickinson added the comment: Closing this for now; if you want to pursue this, please take the suggestion to the python-ideas mailing list. -- resolution: -> rejected status: open -> closed ___ Python tracker <http://bugs.p

[issue8060] PEP 3101 string formatting missing engineering presentation type for floating point

2010-03-05 Thread Mark Dickinson
Mark Dickinson added the comment: Before a patch, there needs to be a concrete proposal: how would this be specified, and what would the precise semantics be? -- ___ Python tracker <http://bugs.python.org/issue8

[issue8069] struct documentation problem and suggestion to add fixed size formats

2010-03-05 Thread Mark Dickinson
Mark Dickinson added the comment: Please note that the docs distinguish 'standard size and alignment' from 'native size and alignment'. The standard size (which is what you get if your struct format string doesn't start with '<', '>', &#

[issue8069] struct documentation problem and suggestion to add fixed size formats

2010-03-05 Thread Mark Dickinson
Mark Dickinson added the comment: Oops. In "... struct format string doesn't start with.. " in my comment above, replace "doesn't start with" with "starts with". -- ___ Python tr

[issue8069] struct documentation problem and suggestion to add fixed size formats

2010-03-05 Thread Mark Dickinson
Mark Dickinson added the comment: Well, it's a bug inasmuch as the docs aren't as clear as they could be.I've got issue 7355 open to remind me to do something about that, though, so this one can probably be closed. -- resolution: -> invalid stat

[issue8062] PEP 3101 string formatting missing hexadecimal separator _ for every 4 hex digits

2010-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: I'm confused: are you talking about producing underscores when formatting an integer for hexadecimal output, or allowing numeric literals to contain underscores? Your perl example produces: 305441741 with not an underscore in sight. I'm

[issue4180] warnings.simplefilter("always") does not make warnings always show up

2010-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: +1 for Benjamin's patch, having just been bitten by this exact problem. I'm trying to do unit testing, checking both that a piece of code produces a DeprecationWarning and that it gives the correct result, with something like:

[issue7849] Improve "test_support.check_warnings()"

2010-03-06 Thread Mark Dickinson
Mark Dickinson added the comment: This is somewhat orthogonal, but it might also be nice to have some way to tell check_warnings not to touch __warningregistry__. See also issue 4180. -- nosy: +mark.dickinson ___ Python tracker <h

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-07 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch to restore the old usage of __int__ to convert non-integer arguments; it also produces a DeprecationWarning whenever __int__ is used in this way. For consistency and simplicity, __int__ will be tried for *any* non-integer argument

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-07 Thread Mark Dickinson
Mark Dickinson added the comment: Updated patch, with slightly saner warnings checks. -- Added file: http://bugs.python.org/file16484/issue1530559__int__2.patch ___ Python tracker <http://bugs.python.org/issue1530

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-07 Thread Mark Dickinson
Mark Dickinson added the comment: Restored use of __int__ for all integer conversion codes in r78762. -- ___ Python tracker <http://bugs.python.org/issue1530

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-07 Thread Mark Dickinson
Mark Dickinson added the comment: Recent checkins messed up Meador Inge's __index__ patch; here's a regenerated version. -- Added file: http://bugs.python.org/file16485/issue-1530559__index__.patch ___ Python tracker <http://bu

[issue1530559] struct.pack raises TypeError where it used to convert

2010-03-07 Thread Mark Dickinson
Mark Dickinson added the comment: Comments and thoughts on the __index__ patch: (1) Thank you for a remarkably complete patch! (2) For 2.x, I'm a bit uncomfortable with introducing the extra Python layer on top of the C layer. Partly I'm worried about accidentally breaking someth

[issue8116] Addition problem

2010-03-11 Thread Mark Dickinson
Mark Dickinson added the comment: This isn't a bug in Python: it's an unavoidable symptom of using binary floating-point arithmetic internally to store values. I recommend looking at the last chapter of the Python tutorial, which gives a very nice explanation of floating-point iss

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

2010-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Applied in r78902. -- resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Benjamin! test_structmembers.py looks perfect. -- ___ Python tracker <http://bugs.python.org/issue8014> ___ ___ Pytho

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Tests for this issue, currently failing on T_INT/T_UINT (internal error), T_LONG/T_ULONG (fails to raise TypeError), T_PYSSIZET (internal error). The older patch only fixes the T_PYSSIZET failures; I'm working on a fix for the others. --

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Internal errors for T_UINT and T_PYSSIZET fixed in r78918. The fix needs to be backported to the release31-maint branch, but I don't think it's urgent enough to try getting it in between 3.1.2 rc1 and 3.1.2 final. There's still a probl

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed reason for failing tests (there was a bad error check in structmembers.c that compared a return value with (unsigned int)-1 instead of (unsigned long)-1), and re-enabled those tests, in r78920. Leaving open for the backport to 3.1. -- versions

[issue8133] test_imp fails on OS X 10.6; filename normalization issue.

2010-03-13 Thread Mark Dickinson
New submission from Mark Dickinson : test_issue5604 from test_imp is currently failing on OS X !0.6 (py3k branch), with the following output: == ERROR: test_issue5604 (__main__.ImportTests

[issue8133] test_imp fails on OS X 10.6; filename normalization issue.

2010-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: Also affects 3.1. -- versions: +Python 3.1 ___ Python tracker <http://bugs.python.org/issue8133> ___ ___ Python-bugs-list mailin

[issue2531] float compared to decimal is silently incorrect.

2010-03-14 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch: - comparisons between a Decimal and float produce a result based on the numeric values of the Decimal and float - change Decimal.__hash__ so that floats and Decimals with (exactly) equal value have the same hash. This pres

[issue8152] Divide error on Windows 7 Home Premium 64 bits

2010-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: I see that you already closed this; but just for completeness: This is expected behaviour: in 2.x, the '/' operator does floor division unless you've done a 'from __future__ import division', in which case it does true division.

[issue8133] test_imp fails on OS X 10.6; filename normalization issue.

2010-03-16 Thread Mark Dickinson
Mark Dickinson added the comment: Brett: any thoughts on this? Should imp.find_module automatically apply NFD normalization to the given string on OS X? It seems to me that doing this properly is a bit nasty, since the correct condition isn't that the OS is OS X, but that the rel

[issue2531] float compared to decimal is silently incorrect.

2010-03-17 Thread Mark Dickinson
Mark Dickinson added the comment: For anyone interested, there's an ongoing python-dev discussion about how to resolve this at http://mail.python.org/pipermail/python-dev/2010-March/098437.html -- ___ Python tracker <http://bugs.py

[issue3690] sys.getsizeof wrong for Py3k bool objects

2010-03-19 Thread Mark Dickinson
Mark Dickinson added the comment: I don't think there's anything worth fixing here. It's true that getsizeof is sometimes going to return results that are too small, because there are a good few places in the longobject internals where it's not predictable in advance ex

[issue8133] test_imp fails on OS X; filename normalization issue.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: That patch works for me. (You should probably commit the comment fix in the patch separately though, rather than mixing it up with this issue.) -- ___ Python tracker <http://bugs.python.org/issue8

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
New submission from Mark Dickinson : Here's a patch that makes hash(x) == hash(y) for any numeric types (int, float, complex, Decimal, Fraction, bool) when x and y are numerically equal. This is a prerequisite for making all numeric types accurately comparable with each

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: Uploaded to Rietveld: http://codereview.appspot.com/660042 -- ___ Python tracker <http://bugs.python.org/issue8188> ___ ___

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: Updated patch, with a bit of cleanup and some comments describing the hashing strategy; I'll update the Rietveld issue as well. -- Added file: http://bugs.python.org/file16606/numeric_hash2.patch ___ P

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Changes by Mark Dickinson : Removed file: http://bugs.python.org/file16606/numeric_hash2.patch ___ Python tracker <http://bugs.python.org/issue8188> ___ ___ Python-bug

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: Whoops; that patch included some accidental Lib/test/test_decimal changes. Here's the correct patch. -- Added file: http://bugs.python.org/file16607/numeric_hash2.patch ___ Python tracker <http://bugs.py

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: > Why aren't you using 64-bit hashes on 64-bit architectures? Mostly because I haven't got around to putting that in yet. :) Ideal would be to use _PyHASH_BITS=61 for 64-bit machines, throughout. -- _

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: No, I mean 61. 2**61 - 1 is prime; 2**63-1 is not. (So 2 bits of the hash get wasted, but that's not a big deal, especially since they're the high-end bits and Python mostly cares about the lower-

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Mark Dickinson added the comment: Restore tests accidentally omitted from second patch. -- Added file: http://bugs.python.org/file16608/numeric_hash2.patch ___ Python tracker <http://bugs.python.org/issue8

[issue8188] Unified hash for numeric types.

2010-03-20 Thread Mark Dickinson
Changes by Mark Dickinson : Removed file: http://bugs.python.org/file16607/numeric_hash2.patch ___ Python tracker <http://bugs.python.org/issue8188> ___ ___ Python-bug

[issue8188] Unified hash for numeric types.

2010-03-21 Thread Mark Dickinson
Mark Dickinson added the comment: Updated patch: - put hash parameters into pyport.h, to avoid repetition; make them available to Python code via a private attribute sys._hash_info. - use a modulus of 2**61-1 on systems where SIZEOF_LONG >= 8, and a modulus of 2**31 - 1 otherw

[issue8188] Unified hash for numeric types.

2010-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: Another update, partly to address comments raised by Guido on Rietveld. I'll upload these changes to Rietveld later today. - rename sys._hash_info to sys.hash_info and make it public rather than private (it still needs docs somewhere) - add

[issue7279] decimal.py: == and != comparisons involving NaNs

2010-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: Re-opening to address a couple of points that came out of the python-dev discussion: (1) As Stefan pointed out on python-dev, equality and inequality comparisons involving signaling nans should signal (order comparisons already do). IEEE 754 is fairly

[issue7279] decimal.py: == and != comparisons involving NaNs

2010-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: > I think hash(Decimal("snan")) should also succeed On second thoughts, this would be bad, since it would lead to unpredictable results for sets of dicts containing a signaling nan: >>> from decimal import Decimal [69536 refs] >

[issue7279] decimal.py: == and != comparisons involving NaNs

2010-03-23 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch (against py3k) to make all comparisons involving signaling nans raise InvalidOperation. Stefan, does this look okay to you? -- keywords: +patch Added file: http://bugs.python.org/file16631/issue7279.

[issue8188] Unified hash for numeric types.

2010-03-27 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a version of the patch that adds exact comparisons between the various numeric types. The only slightly tricky comparison is the Fraction <-> Decimal one: an obvious strategy is to convert the Decimal exactly to a Fraction and then use t

[issue8265] test_float fails on ARM Linux EABI with soft floating point

2010-04-01 Thread Mark Dickinson
Mark Dickinson added the comment: >From the values in the report, float.fromhex is giving the correct value here, >but MIN-3*TINY is somehow coming out incorrectly. Correct values (with Python 2.6, so old float repr; OS X 10.6.2): Python 2.6.5+ (release26-maint:79559:79560, Apr 1 20

[issue8257] Decimal constructor to accept float

2010-04-02 Thread Mark Dickinson
Changes by Mark Dickinson : -- priority: -> high ___ Python tracker <http://bugs.python.org/issue8257> ___ ___ Python-bugs-list mailing list Unsubscri

[issue2531] float compared to decimal is silently incorrect.

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Float-to-decimal comparisons have been fixed, and the Decimal hash function changed so that numerically equal Decimal and float instances hash equal, in r79583. The idea of raising an exception for float<->Decimal comparisons was discarded part

[issue8257] Decimal constructor to accept float

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Raymond, do you want this to go into 2.7 as well? I'm assuming that we're not going to allow mixed-type float+decimal operations in 2.7. Also, if we're doing this, it seems to me that all the reasons you give for the Decimal constructor a

[issue7279] decimal.py: == and != comparisons involving NaNs

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Stefan. Applied to trunk in r79588. Still needs to be forward ported to py3k. -- versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue7

[issue7279] decimal.py: == and != comparisons involving NaNs

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Allowed hashing of Decimal('nan') in r79589; Decimal('snan') continues to raise TypeError. I've also rewritten Decimal.__hash__ a little bit, so that it won't care if float('inf') raises an exception. This will al

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

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: The backport wasn't as straightforward as I'd hoped, and we've pretty much run out of time for 2.7. One issue is that long.from_bytes(b, ...) converts b to bytes type using the equivalent of "bytes(b)". This doesn't work wel

[issue8259] left shift operator doesn't accepts long as second argument

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: The original error, for a 32-bit machine, looks like expected behaviour to me; at worst, it's a doc bug. If the right-hand argument doesn't fit into a Py_ssize_t, then I think it's reasonable to refuse to do the shift. But Antoine's &#

[issue8257] Decimal constructor to accept float

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: > Mark, I do think we should have decimal+float-->float in 2.7 also. That's fine with me in principle. But isn't 2.7 in feature freeze from tomorrow? -- ___ Python tracker <http://bugs.p

[issue8257] Decimal constructor to accept float

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: > And yes, I agree that Fraction(somedecimal) should work too. What about Fraction(1.1)? -- ___ Python tracker <http://bugs.python.org/iss

[issue8265] test_float fails on ARM Linux EABI with soft floating point

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: I made a couple of experimental checkins to the release26-maint branch (I didn't want to do a temporary checkin to the trunk with a release imminent): see r79560 (which didn't work :) and its fix in r79601. Results: MIN = 2.2250738585072014e-

[issue8032] Add gdb7 hooks to make it easier to debug Python

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: A nitpick: on OS X, the gdb script ends up being called: python.exe-gdb.py Is this intentional? If it is, then I'll add this filename to the svn:ignore property. (And also to make distclean, I guess. Is python-gdb.py currently deleted by a

[issue8032] Add gdb7 hooks to make it easier to debug Python

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Added python.exe-gdb.py to svn:ignore in r79616. -- ___ Python tracker <http://bugs.python.org/issue8032> ___ ___ Python-bug

[issue8032] Add gdb7 hooks to make it easier to debug Python

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: > To my knowledge, OS X doesn't ship with gdb 7 That sounds right. On my OS X 10.6.3 machine, the system gdb is: Mark-Dickinsons-MacBook-Pro:py3k dickinsm$ gdb --version GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)

[issue8294] Allow Fraction constructor to accept float and decimal instances directly.

2010-04-02 Thread Mark Dickinson
New submission from Mark Dickinson : Here's a patch that allows direct construction of a Fraction instance from a float or Decimal instance, performing an exact conversion in either case. >>> from fractions import Fraction >>> from decimal import Decimal >

[issue8294] Allow Fraction constructor to accept float and decimal instances directly.

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: (The patch is against trunk, btw.) -- ___ Python tracker <http://bugs.python.org/issue8294> ___ ___ Python-bugs-list mailin

[issue8294] Allow Fraction constructor to accept float and decimal instances directly.

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Unfortunately, that line is wrong (or at least incomplete), since decimals in exponential form are also accepted: >>> Fraction('2.3e4') Fraction(23000, 1) I could try to reinstate a fixed version. Attaching a second version of the patch:

[issue8294] Allow Fraction constructor to accept float and decimal instances directly.

2010-04-02 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks, Raymond. Committed to trunk in r79629. Will forward port to py3k. -- versions: -Python 2.7 ___ Python tracker <http://bugs.python.org/issue8

[issue8294] Allow Fraction constructor to accept float and decimal instances directly.

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Merged to py3k in r79670. -- stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue7279] decimal.py: == and != comparisons involving NaNs

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: r79588 and r79589 were merged to py3k in r79668. -- resolution: invalid -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

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

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Closing this; it's too late for Python 2.7. -- status: open -> closed versions: -Python 2.7 ___ Python tracker <http://bugs.python.org/i

[issue2531] float compared to decimal is silently incorrect.

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Merged to py3k in r79668. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue1530559] struct.pack raises TypeError where it used to convert

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Closing this; a separate feature request should be opened for the idea of adding __index__ awareness to struct.pack in py3k. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
New submission from Mark Dickinson : In Python 2.7, struct.pack with an integer format can handle non-integers that provide an __int__ method (although this *does* raise a DeprecationWarning). Python 2.7a4+ (trunk:79659:79661, Apr 3 2010, 11:28:19) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
Changes by Mark Dickinson : -- components: +Extension Modules stage: -> test needed type: -> feature request ___ Python tracker <http://bugs.python.org/

[issue1530559] struct.pack raises TypeError where it used to convert

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: I've opened issue 8300 for adding the __index__ handling. -- superseder: -> Allow struct.pack to handle objects with an __index__ method. ___ Python tracker <http://bugs.python.org/i

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch for trunk. It combines the docs and tests from Meador Inge's patch in issue 1530559 with a C-level change to get_pylong in Modules/struct.c. -- keywords: +patch versions: +Python 2.7 Added file: http://bugs.python.org

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Adding Meador Inge to nosy. -- nosy: +minge ___ Python tracker <http://bugs.python.org/issue8300> ___ ___ Python-bugs-list m

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: That patch was a bit hasty in many respects; here's a better one. For 2.7, the scheme is as follows: when packing a non-integer with an integer format: (1) First __index__ is tried (2) If the __index__ method doesn't exist, or the call to __inde

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
Changes by Mark Dickinson : -- priority: -> normal stage: test needed -> patch review ___ Python tracker <http://bugs.python.org/issue8300> ___ ___ Pyth

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Committed this patch to trunk in r79674. Will forward port to py3k. -- ___ Python tracker <http://bugs.python.org/issue8

[issue7772] test_py3kwarn fails when running the whole test suite

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: This still seems to be an issue for OS X. With the current trunk (r79716), I get: Mark-Dickinsons-MacBook-Pro:trunk dickinsm$ ./python.exe -3 ./Lib/test/regrtest.py test_macostools test_py3kwarn test_macostools /Users/dickinsm/python/svn/trunk/Lib/importlib

[issue8307] test_pep263 failure on OS X

2010-04-03 Thread Mark Dickinson
New submission from Mark Dickinson : I'm seeing a very peculiar test_pep263 failure when doing 'make test' on OS X 10.6.3. It's enough to run test___all__ and test_pep263, in that order: Mark-Dickinsons-MacBook-Pro:trunk dickinsm$ ./python.exe -Wd -3 -E -tt ./

[issue8307] test_pep263 failure on OS X

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: That should be "NameError" in the last line of the previous message, not "TypeError". -- ___ Python tracker <http://bu

[issue8307] test_pep263 failure on OS X

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: After some more digging, it looks as though this is due to the Tkinter import (that ends up happening as a result of test___all__) changing the locale(?), and in particular the meaning of isalpha: Python 2.7a4+ (trunk:79716, Apr 3 2010, 22:06:18) [GCC

[issue8307] test_pep263 failure on OS X

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: > (Is there some way that I can see the locale change more explicitly from > Python?) Found it. :) >>> locale.nl_langinfo(locale.CODESET) 'US-ASCII' [40683 refs] >>> import Tkinter [56953 refs] >>> locale.nl_l

[issue8307] test_pep263 failure on OS X

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: I realize that the above doesn't really explain why the NameError is occurring: Python's token recognition algorithm, in tok_get in tokenizer.c, uses isalpha, which is locale-aware. In particular, it seems that chr(255) is considered alphabetic in

[issue8307] test_pep263 failure on OS X

2010-04-03 Thread Mark Dickinson
Mark Dickinson added the comment: Ned: yes, that works too. Thanks! -- ___ Python tracker <http://bugs.python.org/issue8307> ___ ___ Python-bugs-list mailin

[issue8309] Sin(x) is Wrong

2010-04-04 Thread Mark Dickinson
Mark Dickinson added the comment: What Ilya Sandler said! Computing sin or cos with large arguments requires high precision for the intermediate calculations (e.g., for sin(1e22) you'd need around 40 digits of precision for the reduction step), so most math libraries don't bother.

[issue8300] Allow struct.pack to handle objects with an __index__ method.

2010-04-04 Thread Mark Dickinson
Mark Dickinson added the comment: Probably both those conditions can't be satisfied; I'm wasn't sure what happened if something's __index__ method returned something other than an int or long. But now I bother to look at the source (in Objects/abstract.c) I see that th

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