[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I'm -1 on moving this module to the standard library. There has been basically *zero* demand for something like this. Because rational implementations seem to be more fun to write than to use, I think there are some competing implementations. -

[issue1763] Winpath module - easy access to Windows directories like My Documents

2008-01-09 Thread Martin v. Löwis
Martin v. Löwis added the comment: It was never explicitly discussed, however, I always assumed that NT4 support is not necessary anymore. I would like to pose a policy that Python does not need to support Windows releases which have left Microsoft's "extended support". For NT 4 WS, this was on

[issue1763] Winpath module - easy access to Windows directories like My Documents

2008-01-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > It uses SHGetFolderPathW which is compatible with Windows 2000. Is Python supposed to still work on Windows NT 4? http://svn.python.org/projects/python/trunk/README says that support will be droppen in 2.6 for Win9x and WinME, but says nothing about NT4

[issue1763] Winpath module - easy access to Windows directories like My Documents

2008-01-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: OK. We should also remove references to older versions on the website: http://www.python.org/download/releases/2.5.1/ and the various READMEs. For testing older platforms, we can still use virtual machines. I think this is how Christian develops on Windows

[issue1774] Reference to New style classes documentation is incorrect

2008-01-09 Thread albert hofkamp
New submission from albert hofkamp: In the Python reference manual (the online current documentation), in Section 3.3 "New-style and classic classes", there is a reference to external documentation about new style classes. The reference is however incorrect, it should be http://www.python.org/doc

[issue1773] Reference to Python issue tracker incorrect

2008-01-09 Thread albert hofkamp
New submission from albert hofkamp: In the Python reference manual (the online current documentation), in the "About this document" section, there is a reference to the Sourceforge bug tracker for reporting errors in the document. This tracker however has been closed, and has been replaced by the

[issue1114] _curses issues on 64-bit big-endian (e.g, AIX)

2008-01-09 Thread A.M. Kuchling
A.M. Kuchling added the comment: Rev. 59870 on trunk fixes another usage of &attr in the wrapper for the chgat() method. Luke, a 2.5.2 release is not too far off. If possible, can you please try compiling the 25-maint branch on AIX to check that the problems are fixed? Thanks! ___

[issue1731] Random errors on interpreter shutdown

2008-01-09 Thread A.M. Kuchling
A.M. Kuchling added the comment: The fix has been applied (by GvR) to 2.5 in r59724. This issue can probably be closed now. -- nosy: +akuchling __ Tracker <[EMAIL PROTECTED]> __ _

[issue1266] segfault in curses when calling redrawwin() before refresh()

2008-01-09 Thread A.M. Kuchling
Changes by A.M. Kuchling: -- assignee: -> akuchling nosy: +akuchling __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsub

[issue1775] filehandle.write() does not return None (Python 3.0a2)

2008-01-09 Thread Andre Roberge
New submission from Andre Roberge: According to the docs, and consistent with the Python 2.x behavior, filehandle.write() should return None. However, under 3.0a2 (and 3.0a1), it returns the number of characters written. Either the documentation http://docs.python.org/dev/3.0/tutorial/inputoutp

[issue1773] Reference to Python issue tracker incorrect

2008-01-09 Thread A.M. Kuchling
A.M. Kuchling added the comment: Fixed in rev. 57394 of the 2.5 branch; thanks for reporting this! The web site's copy of the documentation will be updated when Python 2.5.2 is released. -- assignee: -> akuchling nosy: +akuchling resolution: -> fixed status: open -> closed __

[issue1774] Reference to New style classes documentation is incorrect

2008-01-09 Thread Facundo Batista
Changes by Facundo Batista: -- assignee: -> facundobatista nosy: +facundobatista __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing

[issue1761] Bug in re.sub()

2008-01-09 Thread Fredrik Lundh
Fredrik Lundh added the comment: For the record, $ is defined to match "before a newline at the end of the string, or at the end of the string" in normal mode, and "before any newline, or at the end of the string" in multiline mode. (and I have a vague memory that the "before a newline" behaviou

[issue1763] Winpath module - easy access to Windows directories like My Documents

2008-01-09 Thread Christian Heimes
Christian Heimes added the comment: Amaury Forgeot d'Arc wrote: > For testing older platforms, we can still use virtual machines. I think > this is how Christian develops on Windows XP. Correct, I'm using a VMWare installation of Windows XP SP2 German and DesktopBSD (FreeBSD variant) to test Pyt

[issue1642054] Python 2.5 gets curses.h warning on HPUX

2008-01-09 Thread A.M. Kuchling
Changes by A.M. Kuchling: -- assignee: -> akuchling _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mailing list Unsubscribe:

[issue1776] __import__ must not accept filenames

2008-01-09 Thread Christian Heimes
New submission from Christian Heimes: See http://permalink.gmane.org/gmane.comp.python.devel/90960 It's also "broken" in 2.5 but we must not change the behavior in a maintenance release. -- components: Interpreter Core messages: 59602 nosy: tiran priority: normal severity: normal statu

[issue1379209] socket.recv(OOB) raises exception on closed socket

2008-01-09 Thread Facundo Batista
Facundo Batista added the comment: Tried it on Linux, but the behaviour is the same on Py2.5. It was already fixed in the trunk (it returns "", as in the inbound read). Thanks for the report! -- resolution: -> out of date status: open -> closed _ T

[issue1775] filehandle.write() does not return None (Python 3.0a2)

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: The intention was that the lowest-level (unbuffered) stream object can write fewer bytes than given to it, as it is a direct interface to the underlying system call, which has this property (especially when the file is in non-blocking mode). I think it's fine

[issue846388] Check for signals during regular expression matches

2008-01-09 Thread Facundo Batista
Facundo Batista added the comment: Retried it in a platform where I trust timing, and it proved ok. So, problem solved, no performance impact, all tests pass ok. Commited in r59862. Thank you all! -- resolution: -> fixed status: open -> closed Tra

[issue1729930] 2.5.1 latest svn fails test_curses and test_timeout

2008-01-09 Thread A.M. Kuchling
A.M. Kuchling added the comment: According to the man page for endwin() from ncurses, "In this implementation endwin returns an error if the terminal was not initialized." This doesn't make the problem any clearer to me. Perhaps the setupterm() or initscr() in Lib/tests/test_curses is failing in

[issue1775] filehandle.write() does not return None (Python 3.0a2)

2008-01-09 Thread Christian Heimes
Christian Heimes added the comment: Guido, Mike and Mark have implemented most of the new IO library. I'm sure they can shed some light on the design decision. I've fixed the other bug a while ago. I don't use exit() and I didn't noticed the problem until Joseph pointed me in the right direction

[issue1774] Reference to New style classes documentation is incorrect

2008-01-09 Thread Christian Heimes
Changes by Christian Heimes: -- priority: -> low __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue1761] Bug in re.sub()

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Which is why I like to use \Z to match *only* the end of the string. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bug

[issue1761] Bug in re.sub()

2008-01-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Aha, I always thought that \Z was an alias for $. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing

[issue1210] imaplib does not run under Python 3

2008-01-09 Thread Jean-Paul Calderone
Jean-Paul Calderone added the comment: You're correct in pointing out that IMAP4 supports arbitrary encodings, so simply hard-coding ASCII is not correct. The encoding isn't connection-level, but applies to particular sequences of bytes in the connection stream. To correctly interpret the bytes

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Raymond, do you *always* have to be such a grinch? The mere existance of competing implementations proves that there's a need. Hopefully having one in the stdlib will inspire others to contribute improvements rather than starting from scratch. __

[issue1774] Reference to New style classes documentation is incorrect

2008-01-09 Thread Facundo Batista
Facundo Batista added the comment: It was ok in the trunk docs. Fixed it in the 2.5 maint branch. Thanks for the report! -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> ___

[issue1621] Do not assume signed integer overflow behavior

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Alexandre, which Python version did you compile with -Wstrict-overflow? It would behoove us to check 2.5.2 thoroughly before it goes out the door. I will contact Coverity to ask if they check for this kind of thing. (They just upgraded us to "Rung 2", whatev

[issue1608] test_str.py crashes

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: It would actually be better to use -fno-strict-overflow instead of -fwrapv, if it exists (GCC 4.2 and later). See also http://bugs.python.org/issue1621 which suggests there aren't actually many places that need this; gcc -Wstrict-overflow should help auditing

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Not sure I'm the grinch on this one. I thought PEPs on this were rejected long ago and no one complained afterwards. After years of watching newsgroup discussions and feature requests, I do not recall a single request or seeing a single problem that was b

[issue1621] Do not assume signed integer overflow behavior

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Marc-Andre: what do you mean by breaking lots and lots of extensions? Extensions also contain buffer overflow checks (at least I hope they do :-) and those should also be guaranteed safe by using -fwrapv or -fno-strict-overflow (GCC 4.2 and higher) until we're

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Facundo Batista
Facundo Batista added the comment: The PEP 239 is Rejected (http://www.python.org/dev/peps/pep-0239/). If a Rational data type would be included in the stdlib, my recommendation is that first that PEP would be reopened and pushed until get accepted. Also, note the kind of questions Mark is aski

[issue1621] Do not assume signed integer overflow behavior

2008-01-09 Thread Ismail Donmez
Ismail Donmez added the comment: -Wstrict-overflow=3 with gcc 4.3 trunk here shows : Modules/cPickle.c: In function 'Unpickler_noload': Modules/cPickle.c:4232: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false Modules/cPickle.c:194: warning: assumin

[issue1777] ElementTree/cElementTree findtext inconsistency

2008-01-09 Thread Grant Monroe
New submission from Grant Monroe: cElementTree findtext seems to return None when it should return a string. -- components: Library (Lib) files: etree_test.py messages: 59618 nosy: gmonroe severity: normal status: open title: ElementTree/cElementTree findtext inconsistency type: behavior

[issue1621] Do not assume signed integer overflow behavior

2008-01-09 Thread Martin v. Löwis
Martin v. Löwis added the comment: > But also note that -fno-strict-aliasing is also just another workaround > and its more serious than -fwrapv. Sure - however, that is fixed in Python 3 (and unrelated to this issue) __ Tracker <[EMAIL PROTECTED]>

[issue1763] Winpath module - easy access to Windows directories like My Documents

2008-01-09 Thread Martin v. Löwis
Martin v. Löwis added the comment: > OK. We should also remove references to older versions on the website: > http://www.python.org/download/releases/2.5.1/ and the various READMEs. No. Python 2.5.1 *does* support Windows 95 (I have myself tested that). Only 2.6 will drop support for 9x. __

[issue1777] ElementTree/cElementTree findtext inconsistency

2008-01-09 Thread Martin v. Löwis
Martin v. Löwis added the comment: Fredrik, can you take a look? -- assignee: -> effbot nosy: +effbot, loewis __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1731] Random errors on interpreter shutdown

2008-01-09 Thread Guido van Rossum
Changes by Guido van Rossum: -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list

[issue1776] __import__ must not accept filenames

2008-01-09 Thread Christian Heimes
Christian Heimes added the comment: Fixed in r59876 -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___ Python

[issue1750] Test: This is title

2008-01-09 Thread Georg Brandl
Georg Brandl added the comment: testing __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

[issue1777] ElementTree/cElementTree findtext inconsistency

2008-01-09 Thread Fredrik Lundh
Fredrik Lundh added the comment: Looks like the mechanisms used decide when to invoke the full ElementPath machinery differs somewhat. I've added this to the TODO list for ET 1.3; in the meantime, my advice is "don't do that". (adding a check for '.' to the PATHCHAR macro should fix this, I thi

[issue1750] Test: This is title

2008-01-09 Thread Georg Brandl
Georg Brandl added the comment: testing __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailma

[issue1775] filehandle.write() does not return None (Python 3.0a2)

2008-01-09 Thread Andre Roberge
Andre Roberge added the comment: After doing some more reading, I realize that the current behaviour is totally consistent with http://www.python.org/dev/peps/pep-3116/ which I should have consulted first. So perhaps it should be considered to be simply a case of a documentation error, as I allud

[issue1448325] re search infinite loop

2008-01-09 Thread Ralf Schmitt
Ralf Schmitt added the comment: You're being a victim of two issues here: 1.regular expression matching can take a long time. see: http://bugs.python.org/issue1662581 2. regular expression matching was not interruptible: http://bugs.python.org/issue846388 -- nosy: +schmir versions: +Py

[issue1662581] the re module can perform poorly: O(2**n) versus O(n**2)

2008-01-09 Thread Ralf Schmitt
Ralf Schmitt added the comment: here are two other bug reports about the same issue: http://bugs.python.org/issue1448325 http://bugs.python.org/issue1566086 -- nosy: +schmir _ Tracker <[EMAIL PROTECTED]> ___

[issue1277] mailbox.Maildir: factory not used

2008-01-09 Thread A.M. Kuchling
Changes by A.M. Kuchling: -- assignee: -> akuchling nosy: +akuchling __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsub

[issue1566086] RE (regular expression) matching stuck in loop

2008-01-09 Thread Ralf Schmitt
Ralf Schmitt added the comment: With python 2.6 the program can be interrupted with ctrl-c (see http://bugs.python.org/issue846388). I think this one should be closed as a duplicate of: http://bugs.python.org/issue1662581 -- nosy: +schmir _ Tracker <[

[issue1720992] automatic imports

2008-01-09 Thread Ralf Schmitt
Ralf Schmitt added the comment: it won't get better than: http://pypi.python.org/pypi/autoimp/ I suggest this should be closed. -- nosy: +schmir _ Tracker <[EMAIL PROTECTED]> _

[issue756982] mailbox should use email not rfc822

2008-01-09 Thread A.M. Kuchling
Changes by A.M. Kuchling: -- assignee: barry -> akuchling Tracker <[EMAIL PROTECTED]> ___ Python-bugs-list mailing list Unsubscribe

[issue1488934] file.write + closed pipe = no error

2008-01-09 Thread Ralf Schmitt
Ralf Schmitt added the comment: the c program is broken as it does not check the error code of fflush. The real problem is buffering. while True: __print 'Hello' __time.sleep (1) will not notice an error until the buffers are flushed. Running python t.py |head -n2 and killing head does not give

[issue1488934] file.write + closed pipe = no error

2008-01-09 Thread Ralf Schmitt
Ralf Schmitt added the comment: ahh.no. the c program does the fflush on the logfile...sorry. _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-

[issue1566086] RE (regular expression) matching stuck in loop

2008-01-09 Thread Georg Brandl
Georg Brandl added the comment: Done. -- nosy: +georg.brandl resolution: -> duplicate status: open -> closed superseder: -> the re module can perform poorly: O(2**n) versus O(n**2) _ Tracker <[EMAIL PROTECTED]>

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: The rejection of PEP 239 was years ago. PEP 3141 was accepted; it includes adding a rational type to the stdlib, and Jeffrey is doing this with my encouragement. The motivation is to have at least one example of each type in our modest numeric tower in the st

[issue1778] SyntaxError.offset sometimes wrong

2008-01-09 Thread Achim Gaedke
New submission from Achim Gaedke: The value SyntaxError.offset is for most SyntaxErrors an offset from beginning of line SyntaxError.lineno. In case of an triple-quoted string which is not at all closed, offset seems to be the offset from beginning of the buffer. -- components: Interpret

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: If this goes in, I have some recommendations: * Follow the decimal module's lead in assiduously avoiding float->rational conversions. Something like Rat.from_float(1.1) is likely to produce unexpected results (like locking in an inexact input and having an u

[issue1778] SyntaxError.offset sometimes wrong

2008-01-09 Thread Christian Heimes
Changes by Christian Heimes: -- priority: -> normal __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue1277] mailbox.Maildir: factory not used

2008-01-09 Thread Christian Heimes
Changes by Christian Heimes: -- keywords: +patch priority: -> normal versions: +Python 2.6 __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-li

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Facundo Batista
Facundo Batista added the comment: 2008/1/9, Raymond Hettinger said: > * Consider adding Decimal.from_rational and Rational.from_decimal. I > believe these are both easy and can be done losslessly. If it's lossless, why not just allow Decimal(Rational(...)) and Rational(Decimal(...))? ___

[issue1381] cmath is numerically unsound

2008-01-09 Thread Christian Heimes
Christian Heimes added the comment: Guido, how do you like the idea of Include/pymath.h and Python/pymath.c containing supplementary mathematical functions and mathematical constants? Mark's patch for cmath is rather large, can it still be applied to 2.5? -- nosy: +gvanrossum versions: +

[issue1381] cmath is numerically unsound

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Are you crazy? Adding new features to 2.5? No way! __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing l

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > If it's lossless, why not just allow >Decimal(Rational(...)) and Rational(Decimal(...))? Those conversions are fine. It's the float<-->rational conversions that are problematic. There are exact float to rational conversions using math.frexp() but I don

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: On Jan 9, 2008 4:29 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > I think the history of rational modules is that simplistic > implementations get built and then the writers find that exploding > denominators limit their usefulness for anything other than

[issue1779] int("- 1") is valud, but float("- 1") isn't. Which is right?

2008-01-09 Thread Guido van Rossum
New submission from Guido van Rossum: I discovered that when converting a string to an int or float, the int conversion allows whitespace after the sign, while the float conversion doesn't. I think they should be consistent. -- components: Interpreter Core messages: 59641 nosy: gvanrossu

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Mark Dickinson
New submission from Mark Dickinson: After seeing issue #1761, I realized that there's a bug in the Decimal constructor: it accepts newline-terminated strings: >>> from decimal import * >>> s = "2.3\n" >>> Decimal(s) Decimal("2.3") I think this is, strictly speaking, a bug because: (1) The IB

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: I'd propose doing the same thing as int() and float(), which accept and strip leading and trailing whitespace. -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> _

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Guido. The to-number operation is part of the spec. The constructor belongs to us and should match the rest of the language. -- nosy: +rhettinger __ Tracker <[EMAIL PROTECTED]>

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: > * Follow the decimal module's lead in assiduously avoiding > float->rational conversions. Something like Rat.from_float(1.1) is > likely to produce unexpected results (like locking in an inexact input > and having an unexpectedly large denominator). I agree

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: Okay: in that case, I propose: (1) adding a to_number method to the Decimal and Context class, so that we're still in full compliance with the specification, and (2) altering Decimal.__new__ to allow trailing and leading whitespace. ___

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: Aargh! It's only the Context class that needs a to_number method---it makes no sense as a Decimal method. And to_number is almost already there, in the form of Context.create_decimal. I'll work out exactly what the minimum is that needs to be done to comply

[issue1720992] automatic imports

2008-01-09 Thread Christian Heimes
Christian Heimes added the comment: The idea is against the basic principals and Zen Of Python (type "import this at the Python prompt to read more about the Zen Of Python). Ralf's link about autoimp is a nice solution but don't ever use it in real code! -- nosy: +tiran resolution: ->

[issue1448325] re search infinite loop

2008-01-09 Thread Christian Heimes
Christian Heimes added the comment: Duplicate and partly fixed -- nosy: +tiran resolution: -> duplicate status: open -> closed superseder: -> Check for signals during regular expression matches _ Tracker <[EMAIL PROTECTED]>

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Decimal.from_rational(Rat(1, 3)) wouldn't be lossless It should be implemented as Decimal(1)/Decimal(3) and then let the context handle any inexactness. > Rational.from_decimal is easier than from_float. Yes. Just use Decimal.as_tuple() to get the intege

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought, the Decimal and Rational constructors can be made to talk to each other via a magic method so that neither has to import the other (somewhat like we do now with __int__ and __float__). __ Tracker <[EMAIL PROT

[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-01-09 Thread Tim Lesher
New submission from Tim Lesher: ConfigParser doesn't prevent "manually" adding a section named DEFAULT; however, doing so creates a duplicate, inaccessible [DEFAULT] section in the config file: >>> import sys, ConfigParser >>> c = ConfigParser.ConfigParser() >>> c.add_section('DEFAULT') >>>

[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: Care to provide a patch? Otherwise this may be a good bug day candidate. The next one's Jan 19. -- nosy: +gvanrossum __ Tracker <[EMAIL PROTECTED]> __

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: In the spirit of making the Decimal constructor match the rest of the language, can I propose another change: make Decimal("not a decimal") raise a ValueError. Currently, Decimal("not a decimal") either raises InvalidOperation or returns a Decimal NaN, depen

[issue1780] Decimal constructor accepts newline terminated strings

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think the decimal exceptions should continue to be raised as-is. There is a well-defined and thought-out structure for the Decimal exceptions. Also, the constructor's exceptions tend to be raised in an environment where there are other decimal operations t

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Mark Dickinson
Mark Dickinson added the comment: Allowing automatic coercion to and from Decimal sounds dangerous and complicated to me. Mightn't it be safer just to disallow this (at least for now)? I think something like trim() (find the closest rational approximation with denominator bounded by a given

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Guido van Rossum
Guido van Rossum added the comment: All in all, Decimal is the odd man out -- it may never become a full member of the Real ABC. The built-in types complex, float and int (and long in 2.x) all support mixed-mode arithmetic, and this is one of the assumptions of the numeric tower -- and of course

[issue1720992] automatic imports

2008-01-09 Thread Juan Manuel Borges Caño
Juan Manuel Borges Caño added the comment: Thank you for the link. I think this bug is already closed. _ Tracker <[EMAIL PROTECTED]> _ ___ P

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Would it be reasonable then to not have any of the numeric tower stuff put in the decimal module -- basically leave it alone (no __ceil__, etc)? __ Tracker <[EMAIL PROTECTED]> __