Commit Graph

1186 Commits

Author SHA1 Message Date
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 4dfe8a1131 Here is a bytes type. It's very minimal but it's a start. 2006-04-22 23:28:04 +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 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
Neal Norwitz bcc0db82dc Get rid of remnants of integer division 2006-03-24 08:14:36 +00:00
Neal Norwitz 57c179c5b9 Remove staticforward and statichere 2006-03-22 07:18:02 +00:00
Neal Norwitz a10f52e3b2 Remove PyArg_NoArgs() and PyArg_GetInt() 2006-03-17 09:00:00 +00:00
Neal Norwitz e7086d409e INPLACE_DIVIDE is no longer necessary (INPLACE_TRUE_DIVIDE is used). 2006-03-17 08:59:09 +00:00
Neal Norwitz 712ce45415 _Py_QnewFlag and INPLACE_DIVIDE are not necessary any longer 2006-03-17 08:57:43 +00:00
Neal Norwitz ade612be2f This gets at least test_cmd_line working again and a few more modules built. 2006-03-17 08:27:50 +00:00
Neal Norwitz b2eaa44646 Remove some old types for int based functions (Py_ssize_t is da thing now.) 2006-03-17 08:09:39 +00:00
Neal Norwitz fe55464f39 Whitespace changes. Also remove apply from a few comments 2006-03-17 06:58:45 +00:00
Neal Norwitz c6d210ca76 Get rid of last vestiges of BINARY_DIVIDE. 2006-03-16 06:02:10 +00:00
Guido van Rossum 45aecf451a Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done)
- int/int -> float
- all exceptions must derive from BaseException
- absolute import
- 'as' and 'with' are keywords
2006-03-15 04:58:47 +00:00
Martin v. Löwis 5bd7c02298 Avoid forward-declaring the methods array.
Rename unicodedata.db* to unicodedata.ucd*
2006-03-10 11:20:04 +00:00
Martin v. Löwis 480f1bb67b Update Unicode database to Unicode 4.1. 2006-03-09 23:38:20 +00:00
Guido van Rossum 38fff8c4e4 Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
2006-03-07 18:50:55 +00:00
Neal Norwitz 7b216c52e4 Make PyGC_Collect() use Py_ssize_t. 2006-03-04 20:01:53 +00:00
Neal Norwitz 4281cef205 Use Py_ssize_t for _Py_RefTotal.
I tried to handle Win64 properly, but please review.
2006-03-04 19:58:13 +00:00
Neal Norwitz 1fc4b776d4 Change some sequnce APIs to use Py_ssize_t. 2006-03-04 18:49:58 +00:00
Neal Norwitz 8c49c82889 Use Py_ssize_t for PySet_Size() like all the other Py*_Size() functions. 2006-03-04 18:41:19 +00:00
Tim Peters 6fd92dc44f Added words about what PyArena_Malloc() does. 2006-03-02 21:14:45 +00:00
Tim Peters cb9426b5f4 Beefed up description of what this does; new XXX. 2006-03-02 21:04:08 +00:00
Tim Peters 5f4390fb09 New XXX pointing out errors in the description of
PyArena_New(); unsure what the intent is.
2006-03-02 20:48:25 +00:00
Tim Peters 8cfaa0e729 Trimmed trailing whitespace. 2006-03-02 20:37:32 +00:00
Martin v. Löwis 49c5da1d88 Patch #1440601: Add col_offset attribute to AST nodes. 2006-03-01 22:49:05 +00:00
Martin v. Löwis 6db0e00d57 Change GC refcount to Py_ssize_t. 2006-03-01 16:56:25 +00:00
Martin v. Löwis 056a69cba6 Reconst parameters that lost their const in the AST merge. 2006-03-01 16:55:42 +00:00
Brett Cannon bf36409e2a PEP 352 implementation. Creates a new base class, BaseException, which has an
added message attribute compared to the previous version of Exception.  It is
also a new-style class, making all exceptions now new-style.  KeyboardInterrupt
and SystemExit inherit from BaseException directly.  String exceptions now
raise DeprecationWarning.

Applies patch 1104669, and closes bugs 1012952 and 518846.
2006-03-01 04:25:17 +00:00
Martin v. Löwis 762467475d Use Py_ssize_t for PyArg_UnpackTuple arguments. 2006-03-01 04:06:10 +00:00
Martin v. Löwis e36dce69dd Make ob_refcnt and tp_maxalloc (and friends) Py_ssize_t. 2006-03-01 04:02:43 +00:00
Thomas Wouters ca82a8b760 Move #include to outside "extern C {}", before Tim figures out it'll break
VC++.
2006-02-28 23:09:08 +00:00
Thomas Wouters e4d3a72ab8 Include code.h more sanely. 2006-02-28 22:40:55 +00:00
Neal Norwitz 090b3dde06 No need to export PySTEntry_New, it is only used in symtable.c 2006-02-28 22:36:46 +00:00
Neal Norwitz e42e405e08 Martin owns PEP 353 and did most of the work 2006-02-28 20:03:28 +00:00
Thomas Wouters 34aa7ba114 from __future__ import with_statement addon for 'with', mostly written by
Neal.
2006-02-28 19:02:24 +00:00
Jeremy Hylton a829313d7b Remove asdl_seq_APPEND() and simplify asdl seq implementation.
Clarify intended use of set_context() and check errors at all call sites.
2006-02-28 17:58:27 +00:00
Jeremy Hylton 77f1bb2778 Real arena implementation
Replace the toy arena implementation with a real one,
based on allocating 8K chunks of memory by default.
2006-02-28 17:53:04 +00:00
Thomas Wouters f7f438ba3b SF patch #1438387, PEP 328: relative and absolute imports.
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
   the import. Only passed to __import__ when it's not -1.

 - __import__() takes an optional 5th argument for the same thing; it
   __defaults to -1 (old semantics: try relative, then absolute)

 - 'from . import name' imports name (be it module or regular attribute)
   from the current module's *package*. Likewise, 'from .module import name'
   will import name from a sibling to the current module.

 - Importing from outside a package is not allowed; 'from . import sys' in a
   toplevel module will not work, nor will 'from .. import sys' in a
   (single-level) package.

 - 'from __future__ import absolute_import' will turn on the new semantics
   for import and from-import: imports will be absolute, except for
   from-import with dots.

Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
2006-02-28 16:09:29 +00:00
Guido van Rossum c2e20744b2 PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).

This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.

There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
2006-02-27 22:32:47 +00:00
Martin v. Löwis 15e62742fa Revert backwards-incompatible const changes. 2006-02-27 16:46:16 +00:00
Thomas Wouters dca3b9c797 PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as
two new grammar rules for backward compatibility. If no one else fixes
parsermodule, I guess I'll go ahead and fix it later this week.

The TeX code was checked with texcheck.py, but not rendered. There is
actually a slight incompatibility:

>>> (x for x in lambda:0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iteration over non-sequence

changes into

>>> (x for x in lambda: 0)
  File "<stdin>", line 1
    (x for x in lambda: 0)
                     ^
SyntaxError: invalid syntax

Since there's no way the former version can be useful, it's probably a
bugfix ;)
2006-02-27 00:24:13 +00:00
Martin v. Löwis bd260da900 Generate code to recursively copy an AST into
a tree of Python objects. Expose this through compile().
2006-02-26 19:42:26 +00:00
Neal Norwitz ab51f5f24d Per discussion on python-dev, remove CO_GENERATOR_ALLOWED. Leave comment about not removing yet. 2006-02-25 15:43:10 +00:00
Georg Brandl c255c7bef7 Bug #1086854: Rename PyHeapType members adding ht_ prefix. 2006-02-20 22:27:28 +00:00
Neal Norwitz 0090a4c10d Generators have been permanent for a while. This comment is no longer applicable. 2006-02-19 18:49:30 +00:00
Martin v. Löwis 2d65b5542b Fix intptr_t fallback for Py_ssize_t. 2006-02-18 18:26:55 +00:00
Martin v. Löwis 41290685f9 Change _PyObject_GC_Resize to expect Py_ssize_t. 2006-02-16 14:56:14 +00:00
Martin v. Löwis 97c65a8068 Use Py_ssize_t for field sizes and offsets. 2006-02-16 14:24:38 +00:00
Martin v. Löwis 44e379d573 Allow for ssize_t field offsets. 2006-02-16 14:23:19 +00:00