Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue3287] Fraction constructor should raise TypeError instead of AttributeError

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 4, 2008, 12:57 PM

Post #1 of 3 (68 views)
Permalink
[issue3287] Fraction constructor should raise TypeError instead of AttributeError

New submission from Raymond Hettinger <rhettinger[at]users.sourceforge.net>:

>>> from fractions import *
>>> Fraction(3.1)

Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
Fraction(3.1)
File "C:\Python26\lib\fractions.py", line 100, in __new__
numerator = numerator.__index__()
AttributeError: 'float' object has no attribute '__index__'

----------
assignee: jyasskin
components: Library (Lib)
messages: 69267
nosy: jyasskin, rhettinger
severity: normal
status: open
title: Fraction constructor should raise TypeError instead of AttributeError
type: behavior
versions: Python 2.6, Python 3.0

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3287>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 4, 2008, 1:08 PM

Post #2 of 3 (67 views)
Permalink
[issue3287] Fraction constructor should raise TypeError instead of AttributeError [In reply to]

Changes by Raymond Hettinger <rhettinger[at]users.sourceforge.net>:


----------
keywords: +patch
Added file: http://bugs.python.org/file10811/fractype.diff

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3287>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 10, 2008, 2:31 AM

Post #3 of 3 (49 views)
Permalink
[issue3287] Fraction constructor should raise TypeError instead of AttributeError [In reply to]

Raymond Hettinger <rhettinger[at]users.sourceforge.net> added the comment:

Applied in r64835.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report[at]bugs.python.org>
<http://bugs.python.org/issue3287>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.