[issue8540] Make Context._clamp public in decimal module

2011-10-24 Thread Mark Dickinson
Mark Dickinson added the comment: New changeset 221638ba5d2a by Mark Dickinson in branch 'default': Issue #13248, issue #8540: Remove deprecated Context._clamp attribute from Decimal module. http://hg.python.org/cpython/rev/221638ba5d2a -- ___ Pytho

[issue8540] Make Context._clamp public in decimal module

2010-05-22 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for catching the doc typo! Actually, I didn't like that doc addition anyway, so I rewrote it. Committed in r81476. -- resolution: -> accepted status: open -> closed ___ Python tracker

[issue8540] Make Context._clamp public in decimal module

2010-05-22 Thread Stefan Krah
Stefan Krah added the comment: The patch looks good, +1 for applying it. I'm not a native speaker, but probably: "are subject to clamping this manner" => "are subject to clamping in this manner" -- ___ Python tracker

[issue8540] Make Context._clamp public in decimal module

2010-05-22 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a patch for changing '_clamp' into 'clamp'. -- keywords: +patch Added file: http://bugs.python.org/file17438/decimal_public_clamp.patch ___ Python tracker __

[issue8540] Make Context._clamp public in decimal module

2010-05-22 Thread Mark Dickinson
Mark Dickinson added the comment: BTW, let's open another issue for support of the IEEE 754 contexts, and keep this one for exposing _clamp. Otherwise life gets confusing when you're trying to decide when an issue can be closed, etc... -- ___ Pyth

[issue8540] Make Context._clamp public in decimal module

2010-05-22 Thread Mark Dickinson
Mark Dickinson added the comment: > 1) c = Decimal64Context > > 2) c = Context(Decimal64) Rather that complicating the Context constructor, I'd prefer a separate factory function. I was thinking of something like: def IEEEContext(n): """Return the decimal IEEE 754 context. n should be

[issue8540] Make Context._clamp public in decimal module

2010-05-22 Thread Stefan Krah
Stefan Krah added the comment: I'm busy implementing the IEEE754 contexts for cdecimal. To keep things in sync, it would be nice to agree how they should be created. Suggestions: 1) c = Decimal64Context 2) c = Context(Decimal64) 3) ? I have a preference for 2). It's clear that you get a n

[issue8540] Make Context._clamp public in decimal module

2010-04-30 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue8540] Make Context._clamp public in decimal module

2010-04-29 Thread Stefan Krah
Stefan Krah added the comment: > Were you thinking of any deviations in particular? More or less a commentary on what is listed here: http://speleotrove.com/decimal/dascope.html ==> Restrictions I only have a draft of IEEE754, but for instance I can't find a power or remainder-near functi

[issue8540] Make Context._clamp public in decimal module

2010-04-27 Thread Mark Dickinson
Mark Dickinson added the comment: > I'd prefer to drop the ExtendedContext completely. We have to be careful not to break existing 3rd party code, though. A newly-designed decimal module, prepared with 20/20 hindsight, probably wouldn't include an ExtendedContext with the current definition.

[issue8540] Make Context._clamp public in decimal module

2010-04-27 Thread Stefan Krah
Stefan Krah added the comment: I'd prefer to drop the ExtendedContext completely. Reasons are: 1) _clamp, prec, emin and emax aren't set to IEEE754 values. 2) The use of 'extended' is decNumber specific (see http://speleotrove.com/decimal/dncont.html ). In IEEE754 'extended' has

[issue8540] Make Context._clamp public in decimal module

2010-04-27 Thread Mark Dickinson
Mark Dickinson added the comment: Re: ExtendedContext, the comments in decimal.py say: # Pre-made alternate contexts offered by the specification # Don't change these; the user should be able to select these # contexts and be able to reproduce results from other implementations # of the spec.

[issue8540] Make Context._clamp public in decimal module

2010-04-27 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. Yes, the spec itself is rather vague on the subject of clamping, so I withdraw my claim that clamping is necessary for compliance with the spec. It *is* necessary to make the those testcases with 'clamp=1' pass, though. So from the point of view of com

[issue8540] Make Context._clamp public in decimal module

2010-04-27 Thread Stefan Krah
Stefan Krah added the comment: I knew it was somewhere: In the test case description, clamp=0 is specified as the default: http://speleotrove.com/decimal/dtfile.html#syntax -- ___ Python tracker __

[issue8540] Make Context._clamp public in decimal module

2010-04-27 Thread Stefan Krah
Stefan Krah added the comment: (1) Perhaps I missed the relevant part in the spec, so I had to check what decNumber does: In the default context, clamp is 0, in the extended contexts, it is 1. So Python's ExtendedContext should indeed set _clamp to 1. (2) I agree about the importance of the fo

[issue8540] Make Context._clamp public in decimal module

2010-04-26 Thread Mark Dickinson
Changes by Mark Dickinson : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue8540] Make Context._clamp public in decimal module

2010-04-26 Thread Mark Dickinson
New submission from Mark Dickinson : The Context class in the decimal module has a hidden _clamp attribute, that controls whether to clamp values with large exponents. (Clamping a Decimal value involves adding extra significant zeros to decrease its exponent, while not altering the numeric va