Commit Graph

68 Commits

Author SHA1 Message Date
Guido van Rossum 146483964e Patch supplied by Burton Radons for his own SF bug #487390: Modifying
type.__module__ behavior.

This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this).  Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right.  Apologies if they're
not.  This also touches the weakref docs, which contains a sample type
object initializer.  It also touches the mmap test output, because the
mmap type's repr is included in that output.  It touches object.h to
put the correct description in a comment.
2001-12-08 18:02:58 +00:00
Fred Drake 8b55b2d9aa Fix memory leak in the parser module: There were two leaks in
parser_tuple2st() and a failure to propogate an error in
build_node_children() (masking yet another leak, of course!).
This closes SF bug #485133 (confirmed by Insure++).
2001-12-05 22:10:44 +00:00
Guido van Rossum 1c917072ca Very subtle syntax change: in a list comprehension, the testlist in
"for <var> in <testlist> may no longer be a single test followed by
a comma.  This solves SF bug #431886.  Note that if the testlist
contains more than one test, a trailing comma is still allowed, for
maximum backward compatibility; but this example is not:

    [(x, y) for x in range(10), for y in range(10)]
                              ^

The fix involved creating a new nonterminal 'testlist_safe' whose
definition doesn't allow the trailing comma if there's only one test:

    testlist_safe: test [(',' test)+ [',']]
2001-10-15 15:44:05 +00:00
Fred Drake 13130bc5b1 Use the abstract object interfaces when digging around in module objects
instead of directly manipulating the underlying dictionary.
2001-08-15 16:44:56 +00:00
Fred Drake 78bdb9bc46 Elaborate a comment. 2001-07-19 20:17:15 +00:00
Fred Drake c2683ddb29 The syntax trees handled by this module are not "abstract," so take the
"A" out of the internal abbreviations.  For published functions with
"ast" in their names, make alternate offerings using just "st".
2001-07-17 19:32:05 +00:00
Fred Drake 02126f20b6 Add support for yield statements.
(Should be merged with descr branch.)
2001-07-17 02:59:15 +00:00
Martin v. Löwis b28f6e7c7b Properly use &&. Closes bug #434989. 2001-06-23 19:55:38 +00:00
Fred Drake 711370831a Fix problems with validation of import statement parse trees.
This closes SF bug #127271.
2001-01-07 05:59:59 +00:00
Fred Drake b6429a2020 validate_varargslist(): Fix two bugs in this function, one that affected
it when *args and/or **kw are used, and one when
                         they are not.

This closes bug #125375: "parser.tuple2ast() failure on valid parse tree".
2000-12-11 22:08:27 +00:00
Fred Drake 661ea26b3d Ka-Ping Yee <ping@lfw.org>:
Changes to error messages to increase consistency & clarity.

This (mostly) closes SourceForge patch #101839.
2000-10-24 19:57:45 +00:00
Fred Drake 0ac9b07963 Simplify some of the code. Use PyErr_Format() instead of sprintf(), etc.
Reduces lines of code and compiled object size.
2000-09-12 21:58:06 +00:00
Guido van Rossum 8586991099 REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
2000-09-01 23:29:29 +00:00
Barry Warsaw 9bfd2bf5ed Do the absolute minimal amount of modifications to eradicate
Py_FatalError() from module initialization functions.  The importing
mechanism already checks for PyErr_Occurred() after module importation
and it Does The Right Thing.

Unfortunately, the following either were not compiled or tested by the
regression suite, due to issues with my development platform:

	almodule.c
	cdmodule.c
	mpzmodule.c
	puremodule.c
	timingmodule.c
2000-09-01 09:01:32 +00:00
Tim Peters 6d7c442e03 Try to supply a prototype for the module init function but avoid
Windows "inconsistent linkage" warnings at the same time.  I agree
with Mark Hammond that the whole DL_IMPORT/DL_EXPORT macro system
needs an overhaul; this is just an expedient hack until then.
2000-08-26 07:38:06 +00:00
Fred Drake 28f739aad4 Update the parser module to support augmented assignment.
Add some test cases.
2000-08-25 22:42:40 +00:00
Fred Drake 85bf3bb44a validate_listmaker(): Revise to match Skip's latest changes to the
Grammar file.  This makes the test suite pass once again.
2000-08-23 15:35:26 +00:00
Tim Peters 72b93ec1c3 Nuked unused variable. 2000-08-22 01:44:16 +00:00
Fred Drake cff283c7b3 Update to reflect recent grammar changes (list comprehensions, extended
print statement), and fix up the extended call syntax support.

Minor stylistic cleanups.
2000-08-21 22:24:43 +00:00
Thomas Wouters 5c669860e6 ANSIfy a bit more. 2000-07-24 15:49:08 +00:00
Thomas Wouters bd4bc4e9e9 Even more ANSIfication: fix as many function pointers and declarations as
possible.
2000-07-22 23:57:55 +00:00
Thomas Wouters 7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Jeremy Hylton 03657cfdb0 replace PyXXX_Length calls with PyXXX_Size calls 2000-07-12 13:05:33 +00:00
Peter Schneider-Kamp 286da3b46a ANSI-fying
added excplicit node * parameter to termvalid argument in
validate_two_chain_ops of parsermodule.c (as proposed by fred)
2000-07-10 12:43:58 +00:00
Fred Drake 3cd2ee4037 Remove use of HAVE_OLD_CPP to support non-ANSI preprocessors. 2000-07-09 14:36:13 +00:00
Fred Drake 7797d3692b Remove warning about local variable possibly being using uninitialized;
noted by Marc-Andre Lemburg <mal@lemburg.com>.
2000-07-04 18:48:46 +00:00
Fred Drake 22269b5976 Andrew Kuchling <akuchlin@mems-exchange.org>:
Typo in string literal: execpt --> except
2000-07-03 18:07:43 +00:00
Guido van Rossum ffcc3813d8 Change copyright notice - 2nd try. 2000-06-30 23:58:06 +00:00
Guido van Rossum fd71b9e9d4 Change copyright notice. 2000-06-30 23:50:40 +00:00
Guido van Rossum b18618dab7 Vladimir Marangozov's long-awaited malloc restructuring.
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.

(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode.  I'm also holding back on his
change to main.c, which seems unnecessary to me.)
2000-05-03 23:44:39 +00:00
Fred Drake e7ab64e070 validate_arglist(): Re-written to reflect extended call syntax.
validate_numnodes():  Added comment to explain the sometimes idiomatic
        usage pattern.
2000-04-25 04:14:46 +00:00
Fred Drake ff9ea480eb ANSI-fy & de-tabify the source.
(4-space indents already used.)
2000-04-19 13:54:15 +00:00
Fred Drake 0dd7507e51 What used to be tp_xxx4 is now tp_flags; set it to Py_TPFLAGS_DEFAULT. 2000-02-21 18:19:06 +00:00
Fred Drake 2a6875e172 parser__pickler(): Don't drop the third argument to
parser_ast2tuple().  Create an temporary empty dictionary to
        use.  Bug reported by Mark Favas <m.favas@per.dem.csiro.au>.

Fix a couple of comments.
1999-09-20 22:32:18 +00:00
Fred Drake 7a15ba595a Added keyword parameter support to all public interfaces; keyword
names match the documentation.

Removed broken code that supports the __methods__ attribute on ast
objects; the right magic was added to Py_FindMethod() since this was
originally written.  <ast-object>.__methods__ now works, so dir() and
rlcompleter are happy.
1999-09-09 14:21:52 +00:00
Fred Drake 1a566ff2e8 When the parameter to PyInt_AsLong() has already been checked with
PyInt_Check(), use PyInt_AS_LONG() instead (two places).
1999-02-17 17:35:53 +00:00
Guido van Rossum 3886bb6997 Add DL_EXPORT() to all modules that could possibly be used
on BeOS or Windows.
1998-12-04 18:50:17 +00:00
Fred Drake 7f875ef749 parser__pickler(): Use Py_DECREF() when reference is known to be non-NULL. 1998-08-04 15:58:10 +00:00
Guido van Rossum 3c8c5981b1 Sorry, the initializer for ob_type must really be NULL,
else the damn thing won't compile on Windows :-(
1998-05-29 02:58:20 +00:00
Fred Drake ed3da23e44 parser_compare_nodes(): Corrected a minor type error; eliminate one GCC
warning (at least under Linux).
1998-05-11 03:31:16 +00:00
Fred Drake 268397f513 Made lint a bit happier.
Fixed a memory leak in an error handler.
1998-04-29 14:16:32 +00:00
Guido van Rossum 19efc5fb80 Add a declaration for strdup() for the Mac.
(Jack)
1998-04-28 16:10:19 +00:00
Fred Drake 301b5bea3f In method & function tables, added a cast for the function pointers to keep
compilers happy.

initparser():  Remove unused variable.

gcc -Wall is now happy.
1998-04-21 22:31:45 +00:00
Fred Drake 503d8d66cc The documentation threatened it would happen -- the functions that should
have been methods now are!  Still available as functions for compatibility.
1998-04-13 18:45:18 +00:00
Fred Drake 43f8f9b894 Added support for pickling ast objects. 1998-04-13 16:25:46 +00:00
Guido van Rossum 730806d3d9 Make new gcc -Wall happy 1998-04-10 22:27:42 +00:00
Fred Drake c542bc79c8 Support raise with no parameters. 1998-04-10 04:43:28 +00:00
Fred Drake d49266eeed Remove requirement for strdup() since it causes so many troubles for too many
platforms.  Argh!
1997-10-09 16:29:31 +00:00
Guido van Rossum 1f14ccf6d1 Put back the extern declaration for strdup(), between #ifndef MS_WINDOWS.
This should make everybody happy, especially since we don't say what
the argument type is (there is disagreement on that, too :-( ).
1997-10-08 15:45:53 +00:00
Fred Drake 0225a38907 initparser(): Use PyErr_NewException() to create the exception. 1997-10-07 19:32:00 +00:00