Commit Graph

17 Commits

Author SHA1 Message Date
Christian Heimes c5f05e45cf Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
Georg Brandl c325556505 Port test_class to unittest. Patch #1671298. 2007-08-24 19:33:53 +00:00
Martin v. Löwis 3a62404264 Correctly forward exception in instance_contains().
Fixes #1591996. Patch contributed by Neal Norwitz.
Will backport.
2006-11-08 06:46:37 +00:00
Armin Rigo fd01d7933b (arre, arigo) SF bug #1350060
Give a consistent behavior for comparison and hashing of method objects
(both user- and built-in methods).  Now compares the 'self' recursively.
The hash was already asking for the hash of 'self'.
2006-06-08 10:56:24 +00:00
Michael W. Hudson abb103b17a Don't use 'is not' to compare strings.
(spotted by reading pypy-svn :)
2005-05-04 11:59:38 +00:00
Neil Schemenauer 3a313e3655 Check the type of values returned by __int__, __float__, __long__,
__oct__, and __hex__.  Raise TypeError if an invalid type is
returned.  Note that PyNumber_Int and PyNumber_Long can still
return ints or longs.  Fixes SF bug #966618.
2004-07-19 16:29:17 +00:00
Walter Dörwald f0dfc7ac5c Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:01:56 +00:00
Guido van Rossum 2c9590f625 Added test for this fix to classobject.c:
Since properties are supported here, is possible that
instance_getattr2() raises an exception.  Fix all code that made this
assumption.

Backport candidate.
2002-10-29 19:08:29 +00:00
Barry Warsaw 408b6d34de Complete the absolute import patch for the test suite. All relative
imports of test modules now import from the test package.  Other
related oddities are also fixed (like DeprecationWarning filters that
weren't specifying the full import part, etc.).  Also did a general
code cleanup to remove all "from test.test_support import *"'s.  Other
from...import *'s weren't changed.
2002-07-30 23:27:12 +00:00
Guido van Rossum 16b93b3d0e Fix for SF bug 532646. This is a little simpler than what Neal
suggested there, based upon a better analysis (__getattr__ is a red
herring).  Will backport to 2.2.
2002-06-13 21:32:51 +00:00
Tim Peters 017052152b Fiddle test_class so it passes with -Qnew. 2001-12-11 19:28:47 +00:00
Barry Warsaw 07d8d6415f Committing and closing SF patch #403671 by Finn Bock to help Jython
pass these tests.
2001-08-20 20:29:07 +00:00
Guido van Rossum f317a18a4a Finn Bock (SF patch #103345): Avoid outdated exec form in
test_class.py.
2001-01-22 14:51:41 +00:00
Guido van Rossum 2312024eb7 Add test that ensures hash() of objects defining __cmp__ or __eq__ but
not __hash__ raises TypeError.
2001-01-18 23:47:15 +00:00
Fred Drake 004d5e6880 Make reindent.py happy (convert everything to 4-space indents!). 2000-10-23 17:22:08 +00:00
Trent Mick d68d0a6f5a Fix for test_class.py on Win64. id(self), which on Win64 returns a
PyLong, was used for the return value of a class __hash__ method, which
*must* return a PyInt. Solution: hash() the id(self) value.
2000-10-04 17:50:59 +00:00
Thomas Wouters 1d75a79c00 Apply SF patch #101029: call __getitem__ with a proper slice object if there
is no __getslice__ available. Also does the same for C extension types.
Includes rudimentary documentation (it could use a cross reference to the
section on slice objects, I couldn't figure out how to do that) and a test
suite for all Python __hooks__ I could think of, including the new
behaviour.
2000-08-17 22:37:32 +00:00