| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Made cls.__module__ writable.
- Ensure that obj.__dict__ is returned as {}, not None, even upon first
reference; it simply springs into life when you ask for it.
(*) The pickling support is provisional for the following reasons:
- It doesn't support classes with __slots__.
- It relies on additional support in copy_reg.py: the C method
__reduce__, defined in the object class, really calls calling
copy_reg._reduce(obj). Eventually the Python code in copy_reg.py
needs to be migrated to C, but I'd like to experiment with the
Python implementation first. The _reduce() code also relies on an
additional helper function, _reconstructor(), defined in
copy_reg.py; this should also be reimplemented in C.
|
|
|
|
| |
standalone.
|
|
|
|
|
|
| |
than <type 'ClassName'>. Exception: if it's a built-in type or an
extension type, continue to call it <type 'ClassName>. Call me a
wimp, but I don't want to break more user code than necessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
same. I hope the test for structural equivalence is stringent enough.
It only allows the assignment if the old and new types:
- have the same basic size
- have the same item size
- have the same dict offset
- have the same weaklist offset
- have the same GC flag bit
- have a common base that is the same except for maybe the dict and
weaklist (which may have been added separately at the same offsets
in both types)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- property() now takes 4 keyword arguments: fget, fset, fdel, doc.
Note that the real purpose of the 'f' prefix is to make fdel fit in
('del' is a keyword, so can't used as a keyword argument name).
- These map to visible readonly attributes 'fget', 'fset', 'fdel',
and '__doc__' in the property object.
- fget/fset/fdel weren't discoverable from Python before.
- __doc__ is new, and allows to associate a docstring with a property.
|
|
|
|
|
|
|
| |
declarations and weird markup that we used to accept & ignore that recent
versions raised an exception for; the original behavior has been restored
and augmented (the user can decide what to do if they care; the default is
to ignore it as done in early versions).
|
| |
|
|
|
|
| |
to one with a static metatype raised an obscure error.
|
|
|
|
| |
and the information provided to the profiler. This stuff is a mess!
|
|
|
|
|
| |
function returns NotImplemented when comparing objects whose
tp_richcompare slot is not itself.
|
|
|
|
| |
input to .write() too.
|
|
|
|
|
| |
arguments are subclasses of str, as long as they don't override rich
comparison.
|
|
|
|
|
| |
looks like <X object at ...>, sometimes it says <X instance at ...>.
Make this uniformly say <X object at ...>.
|
| |
|
|
|
|
| |
suite. Note that other tests can put input data in this directory.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
point out, pydoc doesn't tell you where class attributes were defined,
gets several new 2.2 features wrong, and isn't aware of some new features
checked in on Thursday <wink>. pydoc is hampered in part because
inspect.py has the same limitations. Alas, I can't think of a way to
fix this within the current architecture of inspect/pydoc: it's simply
not possible in 2.2 to figure out everything needed just from examining
the object you get back from class.attr. You also need the class
context, and the method resolution order, and tests against various things
that simply didn't exist before. OTOH, knowledge of how to do that is
getting quite complex, so doesn't belong in pydoc.
classify_class_attrs takes a different approach, analyzing all
the class attrs "at once", and returning the most interesting stuff for
each, all in one gulp. pydoc needs to be reworked to use this for
classes (instead of the current "filter dir(class) umpteen times against
assorted predicates" approach).
|
|
|
|
|
|
| |
easy for 2.2 new-style classes, but trickier for classic classes, and
different approaches are needed "depending". The function will allow
later code to treat all flavors of classes uniformly.
|
|
|
|
|
|
|
| |
somewhere inside a line, use ndiff so that intraline difference marking
can point out what changed within a line. I don't remember diff-style
abbreviations either (haven't used it since '94, except to produce
patches), so say the rest in English too.
|
|
|
|
|
|
|
| |
Lib/test/output/test_StringIO is no longer necessary.
Also, added a test of the iterator protocol that's just been added to
StringIO's and cStringIO's.
|
|
|
|
| |
interpreter is reporting what we expect to see.
|
|
|
|
|
|
|
| |
- if __getattribute__ exists, it is called first;
if it doesn't exists, PyObject_GenericGetAttr is called first.
- if the above raises AttributeError, and __getattr__ exists,
it is called.
|
|
|
|
| |
XXX This should really be a unified diff, but I can't be bothered.
|
|
|
|
|
| |
output *and* doctest stuff. Assuming the doctest stuff comes after the
expected output, this fixes that.
|
|
|
|
|
|
|
|
|
|
| |
the first difference, let the test run till completion, then gather
all the output and compare it to the expected output using difflib.
XXX Still to do: produce diff output that only shows the sections that
differ; currently it produces ndiff-style output because that's the
easiest to produce with difflib, but this becomes a liability when the
output is voluminous and there are only a few differences.
|
|
|
|
|
|
|
|
| |
classes to __getattribute__, to make it crystal-clear that it doesn't
have the same semantics as overriding __getattr__ on classic classes.
This is a halfway checkin -- I'll proceed to add a __getattr__ hook
that works the way it works in classic classes.
|
| |
|
| |
|
|
|
|
| |
please let me know and we'll figure out how to fix the test.)
|
|
|
|
| |
docstrings (using file.closed and file.name as examples).
|
| |
|
|
|
|
|
| |
allows using the tests with unittest.py as a script. The tests will
still run when run as a script themselves.
|
|
|
|
|
|
|
|
|
|
| |
elements which are not Unicode objects or strings. (This matches
the string.join() behaviour.)
Fix a memory leak in the .join() method which occurs in case
the Unicode resize fails.
Restore the test_unicode output.
|
| |
|
|
|
|
|
| |
works just like str(obj) in that it tries __str__/tp_str on the object
in case it finds that the object is not a string or buffer.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
their own test suite from a multitude of classes (like test_email.py
will be doing).
run_unittest(): Call run_suite() after making a suite from the
testclass.
|
|
|
|
| |
float (compare the recent checkin to complex). Added tests for these.
|
|
|
|
|
|
|
|
|
| |
instance.
Split a string comparison test in two halves, replacing "a==b==a" with
separate tests for a==b and b==a. (Reason: while experimenting, this
test failed, and I wanted to know if it was the first or the second ==
operator that failed.)
|
|
|
|
| |
with subsclasses of complex and string.
|
| |
|
|
|
|
|
|
| |
\g<x> group reference followed by a character escape
(also restructured a few things on the way to fixing #449000)
|
|
|
|
|
|
|
|
| |
hack, and it's even more disgusting than a PyInstance_Check() call.
If the tp_compare slot is the slot used for overrides in Python,
it's always called.
Add some tests that show what should work too.
|
|
|
|
| |
skipped test -- the print command already supplies a space.
|
| |
|
|
|
|
|
|
|
| |
#462270: sub-tle difference between pre.sub and sre.sub. PRE ignored
an empty match at the previous location, SRE didn't.
also synced with Secret Labs "sreopen" codebase.
|
|
|
|
| |
(AttributeError, TypeError) -- the leniency wasn't needed everywhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to raise TypeError. In practice, a disallowed attribute assignment
can raise either TypeError or AttributeError (and it's unclear which
is better). So allow either. (Yes, this is in anticipation of a
code change that switches the exception raised. :-)
- Add a utility function, cantset(), which verifies that setting a
particular attribute to a given value is disallowed, and also that
deleting that same attribute is disallowed. Use this in the
test_func_*() tests.
- Add a new set of tests that test conformance of various instance
method attributes. (Also in anticipation of code that changes their
implementation.)
|
| |
|