Commit Graph

19239 Commits

Author SHA1 Message Date
Guido van Rossum a5be8eda37 Fix one test to reflect the change in method lookup policy. 2001-08-28 17:58:55 +00:00
Guido van Rossum 607187325f Change in policy: when a slot_tp_xxx function looks for the __xxx__ method,
don't use getattr, but only look in the dict of the type and base types.
This prevents picking up all sorts of weird stuff, including things defined
by the metaclass when the object is a class (type).

For this purpose, a helper function lookup_method() was added.  One or two
other places also use this.
2001-08-28 17:47:51 +00:00
Jeremy Hylton 2ac9c3eec5 Make sure the JUMP_ABSOLUTE and POP_BLOCK at the end of a for loop are
contiguous.
2001-08-28 17:28:33 +00:00
Guido van Rossum cbfc855f57 The "O!" format code should implement an isinstance() test
rather than a type equality test.
2001-08-28 16:37:51 +00:00
Jeremy Hylton 63db7b9ca1 XXX_NAME ops should affect varnames
varnames should list all the local variables (with arguments first).
The XXX_NAME ops typically occur at the module level and assignment
ops should create locals.
2001-08-28 16:36:12 +00:00
Jeremy Hylton f354575328 Generate FOR_ITER-based loops instead of old FOR_LOOP-based loops 2001-08-28 16:35:18 +00:00
Jeremy Hylton 318e167e98 FOR_ITER is a jrel_op() not a plain old def_op() 2001-08-28 15:32:48 +00:00
Fred Drake d800cff80d Added explanation that [...] * n generates shallow copies of [...], so
the contents will be shared by multiple references.

This closes SF bug #455694.
2001-08-28 14:56:05 +00:00
Jack Jansen 49a806edbb Added list of tests expected to be skipped on the mac. 2001-08-28 14:49:00 +00:00
Fred Drake 5cb29a49c8 Fix a number of minor markup errors, and improve the consistency a bit. 2001-08-28 14:25:03 +00:00
Eric S. Raymond 46ccd1dae5 Plant a mention in the description of backreferences of the fact that
while \0 doesn't do what one might expect, \g<0> does.
2001-08-28 12:50:03 +00:00
Barry Warsaw 8c64a54f75 Refcount info for PyString_FromFormat() and PyString_FromFormatV().
Closes SF patch #455666.
2001-08-28 02:32:04 +00:00
Barry Warsaw c86aa57f58 Documentation for PyString_FromFormat() and PyString_FromFormatV().
Closes SF patch #455666.
2001-08-28 02:31:28 +00:00
Jack Jansen 3070ee6b37 Experimental feature: allow \n as well as \r as newline for text files, by breaking in to the lowlevel I/O system. Can be disabled by defining WITHOUT_UNIX_NEWLINES. 2001-08-27 23:16:34 +00:00
Jeremy Hylton c59e220000 Handle private names
(Hard to believe these were never handled before)

Add misc.mangle() that mangles based on the rules in compile.c.
XXX Need to test the corner cases

Update CodeGenerator with a class_name attribute bound to None.  If a
particular instance is created within a class scope, the instance's
class_name is bound to that class's name.

Add mangle() method to CodeGenerator that mangles if the class_name
has a class_name in it.

Modify the FunctionCodeGenerator family to handle an extra argument--
the class_name.

Wrap all name ops and attrnames in calls to self.mangle()
2001-08-27 22:56:16 +00:00
Jack Jansen e7d8322630 exceptions was missing from the module list. Added. 2001-08-27 22:50:41 +00:00
Jack Jansen 535c524508 A quick hack to make the test pass on the Mac (similar to the quick hack
to make it pass on Windows:-).
2001-08-27 22:31:58 +00:00
Jeremy Hylton 80ea40d858 emit SET_LINENO for augmented assignments 2001-08-27 21:58:09 +00:00
Jeremy Hylton 2afff324ea Many changes -- bug fixes and sundry improvements
Make nested scopes enabled by default

Add is_constant_false() helper so that compiled code and symbols are
consistent with builtin compiler's handling of "if 0:"

Fix doc string handling to be consistent with recent change that
eliminates the doc string from the Module's node attribute.

Add fix to print handling from Evan & Shane.

Track change to visitor api by making "verbose" explicit.

Comment out setting CO_NESTED flag (it's unnecessary in 2.2).
2001-08-27 21:51:52 +00:00
Tim Peters 9f448150c8 Fix another test still expecting overflow on big int literals. 2001-08-27 21:50:42 +00:00
Tim Peters c15a82813a Change test_overflow to test_no_overflow; looks like big int literals
are auto-coerced to longs now, but this test still expected OverflowError.
I can't imagine this test failure was unique to Windows.
2001-08-27 21:45:32 +00:00
Jack Jansen 3c06b9a7d4 Use the new macresource module to open the accompanying resource file (if needed). 2001-08-27 21:41:23 +00:00
Jack Jansen a5d7da528b need() now returns the refno of the resource file opened, or None if the
specified resource was already available and no file was opened.
2001-08-27 21:37:45 +00:00
Jack Jansen de3226f7f9 Module to help other modules locate their resources. It currently knows about
resources in applets and separate OS9 style resource files, but it will
eventually also be thought the hoops to jump through on OSX/MachO.
2001-08-27 21:21:07 +00:00
Jack Jansen 8f2b13efce These have long outlived there usefulness, in my opinion. Moved to Unsupported. 2001-08-27 21:17:44 +00:00
Jeremy Hylton cd8a127e1a Fix for sibling nodes that define the same free variable
Evan Simpson's fix.  And his explanation:

    If you defined two nested functions in a row that refer to the
    same non-global variable, the second one will be generated as
    though the variable were global.
2001-08-27 21:06:35 +00:00
Jeremy Hylton 7e30c9bb5a Add lookup_name() to optimize use of stack frames
The use of com_node() introduces a lot of extra stack frames, enough
to cause a stack overflow compiling test.test_parser with the standard
interpreter recursionlimit.  The com_node() is a convenience function
that hides the dispatch details, but comes at a very high cost.  It is
more efficient to dispatch directly in the callers.  In these cases,
use lookup_node() and call the dispatched node directly.

Also handle yield_stmt in a way that will work with Python 2.1
(suggested by Shane Hathaway)
2001-08-27 21:02:51 +00:00
Jeremy Hylton 058a5adad0 Two changes to visitor API:
Remove _preorder as alias for dispatch and call dispatch directly.
    Add an extra optional argument to walk()

XXX Also comment out some code that does debugging prints.
2001-08-27 20:47:08 +00:00
Jeremy Hylton cccc478577 Why didn't I think of Fred off the top of my head? 2001-08-27 20:44:20 +00:00
Jeremy Hylton 627673396a Add everyone I can think of off the top of my head 2001-08-27 20:43:16 +00:00
Jeremy Hylton 2a8ec79353 Revise regrtest to compile entire standard library.
The tests are run from a copy of the library directory, where
everything has been compiled by the compiler package.

Add a raw_input() call at the end of the script, so that I can check
the output before the temp directory with the compiled code is
removed.
2001-08-27 20:40:43 +00:00
Jeremy Hylton 33c2a627f1 Add -c option to continue if one file has a SyntaxError 2001-08-27 20:39:21 +00:00
Jeremy Hylton 6d8c1aabff Add content-type header to ftp URLs (SF patch #454553)
Modify rfc822.formatdate() to always generate English names,
regardless of locale.  This is required by RFC 1123.

In open_local_file() of urllib and urllib2, use new formatdate() from
rfc822.
2001-08-27 20:16:53 +00:00
Michael W. Hudson 53da317801 Docs for the PEP 264 changes. 2001-08-27 20:02:17 +00:00
Jeremy Hylton 71b6af91d3 If an integer constant can't be generated from an integer literal
because of overflow, generate a long instead.
2001-08-27 19:45:25 +00:00
Tim Peters 9aa70d93aa SF bug [#455775] float parsing discrepancy.
PyTokenizer_Get:  error if exponent contains no digits (3e, 2.0e+, ...).
2001-08-27 19:19:28 +00:00
Jack Jansen de1d4957c0 Added Dean Draayer to the thank you list. 2001-08-27 15:30:48 +00:00
Jack Jansen 911e87de6f Patch by Dean Draayer: support for indeterminate progress bars. You
get these by specifying maxval=0, which is now also the default.

Untested.
2001-08-27 15:24:07 +00:00
Jack Jansen e259e5980c Patch by Bill Noon: added 'dylib' as a library type along with
'static' and 'shared'. This fixes extension building for dynamic
Pythons on MacOSX.
2001-08-27 15:08:16 +00:00
Jack Jansen 9403591014 Fixes by Thomas Heller:
- make the selftests work again (they were apparently not used since
  very early in bgen's development), with some minor cleanup by me
- make emacs python mode happier
2001-08-27 14:30:55 +00:00
Jack Jansen 06bd3234cb Refer to the toolbox modules by their official name (Carbon.AE), not the internal name (_AE). This can slow things down (once) but it's the only way I can get things to work on OSX, OS9 dynamically loaded and OS9 frozen. 2001-08-27 14:01:05 +00:00
Jack Jansen 206bd57355 When we're freezing to sourcecode and one of the modules is a dynamic module that is in a package we freeze that module at toplevel (outside any package). Not optimal, but there is little more we can do as config.c has no way to specify a builtin module has to be dumped into a package. 2001-08-27 13:59:35 +00:00
Jack Jansen 60aa4ccdc0 Updated to the current state of affairs. 2001-08-27 13:58:21 +00:00
Jack Jansen 1c2a2b71e1 Added targets for building the Carbon and Classic interpreter if you don't want to go through fullbuild.py. 2001-08-27 13:57:43 +00:00
Jack Jansen dc4d925be9 - A forgotten "from Carbon".
- Made the "killed unknown window" code dependent on a global var,
  so you can easily turn the behaviour off for IDE debugging.
2001-08-27 10:55:41 +00:00
Jack Jansen 4d3052acb0 A few forgotten "from Carbon"s. 2001-08-27 10:54:55 +00:00
Tim Peters 402d5985d8 SF patch [ #455137 ] Makes popen work with COMMAND.COM on WNT, from
Brian Quinlan.
2001-08-27 06:37:48 +00:00
Barry Warsaw 7c47beb860 Two improvements suggested by Greg Stein:
PyString_FromFormatV(): In the final resize at the end, we can use
    PyString_AS_STRING() since we know the object is a string and can
    avoid the typechecking.

PyString_FromFormat(): GS sez: "For safety/propriety, you should call
    va_end() on the vargs variable."
2001-08-27 03:11:09 +00:00
Jack Jansen 5a6fdcd371 Import the MacOS toolbox modules from the Carbon package. 2001-08-25 12:15:04 +00:00
Jack Jansen 6dba6bc0a2 Step 2 in putting the MacOS toolbox modules in a package: issue a DepracationWarning in the compatibility modules. 2001-08-25 11:53:43 +00:00