Commit Graph

33575 Commits

Author SHA1 Message Date
Guido van Rossum 65810fee5e SF patch 1495675: Remove types.InstanceType and new.instance
(Collin Winter)
2006-05-26 19:12:38 +00:00
Guido van Rossum 2018831b2b Adding bytes.join() -- a class methods that concatenates an iterable of bytes.
The name and API are questionable, but the functionality isn't.
2006-05-05 15:15:40 +00:00
Guido van Rossum a0867f79bb Optimizations for bytes reallocation.
This uses up to 12.5% overallocation, not entirely unlike list_resize().
Could probably use more tweaks for odd allocation patterns, TBD.

Also add __alloc__() method which returns the actually allocated size.

PS. I'm now convinced that we need something like "".join(); later.
2006-05-05 04:34:18 +00:00
Neal Norwitz 5584245f58 Some of the test cases were failing due to the busted (relative) import.
This fixes some of the failures, but there are still more.
2006-04-30 02:32:45 +00:00
Neal Norwitz cab1097798 __coerce__ is gone, there's nothing to test.
This test now passes after removing refs to __coerce__.
2006-04-30 02:31:56 +00:00
Guido van Rossum 13e57219d3 Implement bytes += bytes, bytes *= int, int in bytes, bytes in bytes. 2006-04-27 22:54:26 +00:00
Brett Cannon 1b283c5bcc Change C code to use 4-space indents.
Highlighting tab indents is off at the moment since that would be rather noisy,
but should be turned on in the future when conversion to the new indentation
style has been done.
2006-04-24 20:01:24 +00:00
Guido van Rossum d624f18a21 Added much functionality to the bytes type.
Change file.readinto() to require binary mode.
2006-04-24 13:47:05 +00:00
Guido van Rossum e06b6b8ff5 Fix a leak and a buglet discovered by Thomas.
Get rid of silly lambdas in the unit test suite.
Add a TODO list to the unit test suite (TDD style).
2006-04-23 07:43:54 +00:00
Thomas Wouters 5f6f27de4d Fix test_main function so test_bytes can be run by regrtest.py. 2006-04-23 00:19:58 +00:00
Guido van Rossum 4dfe8a1131 Here is a bytes type. It's very minimal but it's a start. 2006-04-22 23:28:04 +00:00
Guido van Rossum d603f645d9 Delete test_coercion.py. Coercion is dead, so this test is useless.
(Plus, it fails. :-)
2006-04-22 17:37:27 +00:00
Thomas Wouters d4ec0c3e2c Merge with trunk up to revision 45620. 2006-04-21 16:44:05 +00:00
Hye-Shik Chang 13247bfc8b Add empty __init__ methods for stateful multibytecodec instances.
This resolves a problem found by Thomas Wouters:
http://mail.python.org/pipermail/python-dev/2006-April/064051.html
2006-04-21 16:21:44 +00:00
Guido van Rossum 6da48561cb Fix test_scriptpackage with pure will power.
I really don't know why I bother; these are all generated files.
But I don't recall how to regenerate them nor how to fix the generator.

The hardest part was fixing two mutual recursive imports;
somehow changing "import foo" into "from . import foo" where
foo and bar import each other AND both are imported from __init__.py
caused things to break.  Bah.
2006-04-21 15:44:20 +00:00
Thomas Wouters c350d1a110 Commit regenerated Python-ast.c. 2006-04-21 14:02:59 +00:00
Guido van Rossum 7ec155f5be Fix relative import. This fixes test_sax.py. 2006-04-21 13:52:56 +00:00
Guido van Rossum e4dea98e5a Fix the unit tests by adding dispatch tables for DateTime and Binary.
I'm not convinced this is the right thing to do...  InstanceType makes no sense any longer.
2006-04-21 13:45:00 +00:00
Thomas Wouters d8073285ff Fix newly merged test for p3ykness. 2006-04-21 11:36:13 +00:00
Thomas Wouters dcc6d32ee4 Fix merge glitch. 2006-04-21 11:30:52 +00:00
Thomas Wouters 3fc2ca3884 Merge trunk up to 45598. 2006-04-21 11:28:17 +00:00
Thomas Wouters 49fd7fa443 Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html

Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:

test_codecencodings_cn
test_codecencodings_hk
test_codecencodings_jp
test_codecencodings_kr
test_codecencodings_tw
test_codecs
test_multibytecodec

This merge fixes an actual test failure (test_weakref) in this branch,
though, so I believe merging is the right thing to do anyway.
2006-04-21 10:40:58 +00:00
Thomas Wouters 9ada3d6e29 Merge trunk up to 43069, putting re.py back and hopefully making the branch
usable again.
2006-04-21 09:47:09 +00:00
Thomas Wouters 725ccd1810 Merge trunk's 43068, deleting re.py. This leaves the branch in a broken
state (unless you happen to have a re.pyc lying around), but it'll be fixed
in the next merge.
2006-04-21 09:46:12 +00:00
Thomas Wouters a977329b6f Merge part of the trunk changes into the p3yk branch. This merges from 43030
(branch-creation time) up to 43067. 43068 and 43069 contain a little
swapping action between re.py and sre.py, and this mightily confuses svn
merge, so later changes are going in separately.

This merge should break no additional tests.

The last-merged revision is going in a 'last_merge' property on '.' (the
branch directory.) Arbitrarily chosen, really; if there's a BCP for this, I
couldn't find it, but we can easily change it afterwards ;)
2006-04-21 09:43:23 +00:00
Guido van Rossum d858f70617 Fix the problems in this test. Boy this is a painful thing to debug --
it's fundamentally unmaintainable.  Should we throw away pyclbr, or rewrite
it using the AST?
2006-04-21 09:17:15 +00:00
Thomas Wouters 303de6a25b Fix (and add test for) missing check for BaseException subclasses in the C
API.
2006-04-20 22:42:37 +00:00
Thomas Wouters 4f564bd68a Fix typical truedivision problem (using the result of division as an index.) 2006-04-20 22:36:57 +00:00
Guido van Rossum a48a3b42dd Fix test failures for repr.py.
But shouldn't we kill this module?  How many pprint clones do we need?
2006-04-20 16:07:39 +00:00
Thomas Wouters 08a1a9fac7 Use explicit relative import for an, ehm, relative import. 2006-04-18 21:41:36 +00:00
Guido van Rossum 7ea7d90dbe Fix the expected output file; new classes just behave differently...
(There are some other problems with test_class.py that aren't as
easily fixed. :-( )
2006-04-17 23:38:13 +00:00
Guido van Rossum 69e8084ad6 Fix two errors that prevented "make libinstall" from working:
- a line indented with tabs;
- a function named 'as'.
2006-04-17 23:13:00 +00:00
Thomas Wouters 07519f8712 Fix xrange tests now that xrange() (like many other places) no longer
silently converts floats to integers when expecting integer values.
2006-04-17 13:16:50 +00:00
Brett Cannon ba617af298 Mention how __coerce__ has been removed. 2006-04-15 09:35:38 +00:00
Thomas Wouters 4cdada9af6 Make test_class work (but still fail) even though class.__dict__ is now a
'dictproxy' (which is a read-only non-dict mapping type that can't be passed
to exec.)

The failures the test finds are behavioural differences between old- and
new-style classes that may or may not be intended.
2006-04-15 09:19:16 +00:00
Thomas Wouters 1034dadf1f Adjust test_enumerate to accomodate for iter() blowing up sooner than
expected, when dealing with new-style broken-iterators.
2006-04-15 09:16:16 +00:00
Thomas Wouters c947123350 Fix tests for PyArg_Parse*; The PyArg_Parse functions no longer (noisily)
convert float arguments to integer-taking format characters, so fix the test
to expect the failure.
2006-04-15 09:15:11 +00:00
Thomas Wouters 725af87d0a - Remove tests for classic class behaviour
- Expect a new-style class tree in the getclasstree test.
2006-04-15 09:13:19 +00:00
Thomas Wouters 1ae9afa829 Fix test_bisect in the same way as test_itertools: iter() blows up a lot
sooner for new-style broken-iterators, expect it to.
2006-04-15 09:12:14 +00:00
Thomas Wouters 34729030a7 Fix the superficial augmented-assignment tests to deal with true division.
Add (equally superficial) >>=/<<= test in the process. Relies on floats that
should be extremely close to the int '6' printing as '6.0', but I believe
that's a valid assumption ;P
2006-04-15 09:10:43 +00:00
Thomas Wouters 8690c4ed3f Fix tests that were trying to make iteration blow up, on broken iterators.
Since the broken iterators are now new-style classes, iter() was able to do
the valid-iterator check sooner (on instantiation instead of on first call),
making the tests blow up sooner than expected.
2006-04-15 09:07:20 +00:00
Thomas Wouters 0725cf2127 Remove tests for classic-class and mixed-classic-class/new-style behaviour.
(New-style class behaviour was already thoroughly tested)
2006-04-15 09:04:57 +00:00
Thomas Wouters 28bc768977 - Fix doctest results to account for classes being new-style, and thus
printing differently.
 - Fix doctest for classic-class behaviour, make it test new-style behaviour
   on an implicitly-new-style class instead.
2006-04-15 09:03:16 +00:00
Thomas Wouters 6caa07b23d Make 'python -tt' the default, meaning Python won't allow mixing tabs and
spaces for indentation. Adds a '-ttt' option to turn the errors back into
warnings; I'm not yet sure whether that's desireable for Py3K.

Also remove the magic for setting the size of tabs based on emacs/vim-style
comments. Python now always considers tabstops to be every-8-spaces.
2006-04-14 11:33:28 +00:00
Guido van Rossum 0c4eb62565 Fix the version number to be 3.0. 2006-03-30 16:19:24 +00:00
Neal Norwitz c6fe059512 Use absolute import. (Should this go into 2.5?) 2006-03-24 08:57:54 +00:00
Neal Norwitz bcc0db82dc Get rid of remnants of integer division 2006-03-24 08:14:36 +00:00
Neal Norwitz ed483ba63b String exceptions are gone and so are classic classes. 2006-03-24 08:08:49 +00:00
Neal Norwitz 28c31982eb Use *absolute* imports now that they are required. (Should this go into 2.5?) 2006-03-24 08:04:47 +00:00
Neal Norwitz 1e32b6927f Must inherit from Exception now. 2006-03-24 08:02:35 +00:00