]> granicus.if.org Git - python/log
python
23 years agoFix Unicode .join() method to raise a TypeError for sequence
Marc-André Lemburg [Thu, 20 Sep 2001 17:22:58 +0000 (17:22 +0000)]
Fix Unicode .join() method to raise a TypeError for sequence
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.

23 years agoUpdate test output after the unicode() change.
Marc-André Lemburg [Thu, 20 Sep 2001 16:37:23 +0000 (16:37 +0000)]
Update test output after the unicode() change.

23 years agoUpdate description of Tools/compiler
Jeremy Hylton [Thu, 20 Sep 2001 15:27:30 +0000 (15:27 +0000)]
Update description of Tools/compiler

23 years agoRemove setup.py, unnecessary since compiler package is the std
Jeremy Hylton [Thu, 20 Sep 2001 15:02:27 +0000 (15:02 +0000)]
Remove setup.py, unnecessary since compiler package is the std
library.

Update README.

23 years agoMoved to Tools/compiler along with astgen.py
Jeremy Hylton [Thu, 20 Sep 2001 14:59:00 +0000 (14:59 +0000)]
Moved to Tools/compiler along with astgen.py

23 years ago_PyObject_GetDictPtr(): when the offset is negative, always align --
Guido van Rossum [Thu, 20 Sep 2001 13:38:22 +0000 (13:38 +0000)]
_PyObject_GetDictPtr(): when the offset is negative, always align --
we can't trust that tp_basicsize is aligned.  Fixes SF bug #462848.

23 years agoNote about enhancements to unicode().
Marc-André Lemburg [Thu, 20 Sep 2001 12:59:37 +0000 (12:59 +0000)]
Note about enhancements to unicode().

23 years agoPython part of the UTF-7 codec by Brian Quinlan.
Marc-André Lemburg [Thu, 20 Sep 2001 12:56:14 +0000 (12:56 +0000)]
Python part of the UTF-7 codec by Brian Quinlan.

23 years agoImplement the changes proposed in patch #413333. unicode(obj) now
Marc-André Lemburg [Thu, 20 Sep 2001 12:53:16 +0000 (12:53 +0000)]
Implement the changes proposed in patch #413333. unicode(obj) now
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.

23 years agoPatch #435971: UTF-7 codec by Brian Quinlan.
Marc-André Lemburg [Thu, 20 Sep 2001 10:35:46 +0000 (10:35 +0000)]
Patch #435971: UTF-7 codec by Brian Quinlan.

23 years agoPatch #462635 by Andrew Kuchling correcting bugs in the new
Marc-André Lemburg [Thu, 20 Sep 2001 10:33:38 +0000 (10:33 +0000)]
Patch #462635 by Andrew Kuchling correcting bugs in the new
codecs -- the self argument does matter for Python functions (it
does not for C functions which most other codecs use).

23 years agoSF bug [#463093] File methods need doc strings.
Tim Peters [Thu, 20 Sep 2001 07:55:22 +0000 (07:55 +0000)]
SF bug [#463093] File methods need doc strings.
Now they don't.

23 years agorun_suite(): Oops, update a docstring.
Barry Warsaw [Thu, 20 Sep 2001 06:31:22 +0000 (06:31 +0000)]
run_suite(): Oops, update a docstring.

23 years agorun_suite(): Factor this out of run_unittest() for tests that build
Barry Warsaw [Thu, 20 Sep 2001 06:30:41 +0000 (06:30 +0000)]
run_suite(): Factor this out of run_unittest() for tests that build
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.

23 years agoSince inspect.isfunction(obj) is a precondition for calling
Tim Peters [Thu, 20 Sep 2001 06:08:24 +0000 (06:08 +0000)]
Since inspect.isfunction(obj) is a precondition for calling
inspect.getargspec(obj), test isfunction() directly in pydoc.py instead
of trying to indirectly deduce isfunction() in pydoc by virtue of
failing a combination of other tests.  This shouldn't have any visible
effect, except perhaps to squash a TypeError death if there was some path
thru this code that was inferring isfunction() by mistake.

23 years agoEnsure that isfunction(obj) and (the new) ismethoddescriptor(obj) never
Tim Peters [Thu, 20 Sep 2001 05:47:55 +0000 (05:47 +0000)]
Ensure that isfunction(obj) and (the new) ismethoddescriptor(obj) never
both return true.  This restores pydoc's ability to deduce argument lists
for functions and methods coded in Python.

23 years agoNews about compiler and pydoc.
Guido van Rossum [Thu, 20 Sep 2001 05:30:24 +0000 (05:30 +0000)]
News about compiler and pydoc.

23 years agoAFAICT pydoc/inspect do the right thing again.
Guido van Rossum [Thu, 20 Sep 2001 05:27:24 +0000 (05:27 +0000)]
AFAICT pydoc/inspect do the right thing again.

23 years agoAfter much thrashing, I believe this is a truly minimal patch to teach
Tim Peters [Thu, 20 Sep 2001 05:13:38 +0000 (05:13 +0000)]
After much thrashing, I believe this is a truly minimal patch to teach
pydoc how to do something sensible with 2.2 descriptors.  To see the
difference, browse __builtin__ via pydoc before and after the patch.

23 years agoInstall the compiler package under Lib.
Tim Peters [Thu, 20 Sep 2001 04:09:39 +0000 (04:09 +0000)]
Install the compiler package under Lib.

23 years agoThe compiler package is now part of the standard library.
Jeremy Hylton [Thu, 20 Sep 2001 01:27:40 +0000 (01:27 +0000)]
The compiler package is now part of the standard library.

Remove all these files.  All except astgen.py are moved to Lib/compiler.

23 years agoPatch #461321: Support None as a timeout in poll2 and poll3.
Martin v. Löwis [Wed, 19 Sep 2001 17:31:47 +0000 (17:31 +0000)]
Patch #461321: Support None as a timeout in poll2 and poll3.

23 years agoPatch #462849: Pass Unicode objects to file's .write method.
Martin v. Löwis [Wed, 19 Sep 2001 13:47:32 +0000 (13:47 +0000)]
Patch #462849: Pass Unicode objects to file's .write method.

23 years agoKeep tabnanny happy.
Guido van Rossum [Wed, 19 Sep 2001 13:28:25 +0000 (13:28 +0000)]
Keep tabnanny happy.

23 years agoFixed search function error reporting in the encodings package
Marc-André Lemburg [Wed, 19 Sep 2001 11:52:07 +0000 (11:52 +0000)]
Fixed search function error reporting in the encodings package
__init__.py module to raise errors which can be catched as LookupErrors
as well as SystemErrors.

Modified the error messages to include more information about the
failing module.

23 years agoDocs and News item for the codecs.py additions.
Marc-André Lemburg [Wed, 19 Sep 2001 11:33:31 +0000 (11:33 +0000)]
Docs and News item for the codecs.py additions.

23 years agoAdded new helpers for easy access to codecs. Docs will follow.
Marc-André Lemburg [Wed, 19 Sep 2001 11:24:48 +0000 (11:24 +0000)]
Added new helpers for easy access to codecs. Docs will follow.

23 years agoFix for bug #462737.
Marc-André Lemburg [Wed, 19 Sep 2001 11:21:03 +0000 (11:21 +0000)]
Fix for bug #462737.

23 years agoInclude ctype.h after Python.h.
Martin v. Löwis [Wed, 19 Sep 2001 10:37:50 +0000 (10:37 +0000)]
Include ctype.h after Python.h.

23 years agoPatch to bug #461753: Allow None in ExternalEntityParserCreate.
Martin v. Löwis [Wed, 19 Sep 2001 09:55:09 +0000 (09:55 +0000)]
Patch to bug #461753: Allow None in ExternalEntityParserCreate.

23 years agoPatch to bug #461754: CDATA should not undergo entity subst.
Martin v. Löwis [Wed, 19 Sep 2001 09:08:19 +0000 (09:08 +0000)]
Patch to bug #461754: CDATA should not undergo entity subst.

23 years agoAdd additional coercion support for "self subtypes" to int, long,
Guido van Rossum [Wed, 19 Sep 2001 01:25:16 +0000 (01:25 +0000)]
Add additional coercion support for "self subtypes" to int, long,
float (compare the recent checkin to complex).  Added tests for these.

23 years agoEnable two checks for comparing a complex to a complex subtype
Guido van Rossum [Wed, 19 Sep 2001 01:16:16 +0000 (01:16 +0000)]
Enable two checks for comparing a complex to a complex subtype
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.)

23 years agocomplex_coerce(): add explicit PyComplex_Check() test. Previously,
Guido van Rossum [Wed, 19 Sep 2001 01:13:10 +0000 (01:13 +0000)]
complex_coerce(): add explicit PyComplex_Check() test.  Previously,
complex_coerce() would never be called with a complex argument,
because PyNumber_Coerce[Ex] doesn't bother calling the type's coercion
method if the values already have the same type.  But now, of course,
it's possible to pass an instance of a complex *subtype*, and those
must be accepted.

23 years agoEnable some comparison tests that failed before. Still having problems
Tim Peters [Tue, 18 Sep 2001 21:24:18 +0000 (21:24 +0000)]
Enable some comparison tests that failed before.  Still having problems
with subsclasses of complex and string.

23 years agoAdd a similar test for rich comparisons.
Guido van Rossum [Tue, 18 Sep 2001 21:06:04 +0000 (21:06 +0000)]
Add a similar test for rich comparisons.

23 years agofixed #449964: sre.sub raises an exception if the template contains a
Fredrik Lundh [Tue, 18 Sep 2001 20:55:24 +0000 (20:55 +0000)]
fixed #449964: sre.sub raises an exception if the template contains a
\g<x> group reference followed by a character escape

(also restructured a few things on the way to fixing #449000)

23 years agoHopefully fix 3-way comparisons. This unfortunately adds yet another
Guido van Rossum [Tue, 18 Sep 2001 20:38:53 +0000 (20:38 +0000)]
Hopefully fix 3-way comparisons.  This unfortunately adds yet another
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.

23 years agoGet rid of a superfluous space after "--" in the message printed for a
Guido van Rossum [Tue, 18 Sep 2001 20:34:19 +0000 (20:34 +0000)]
Get rid of a superfluous space after "--" in the message printed for a
skipped test -- the print command already supplies a space.

23 years ago[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
Andrew M. Kuchling [Tue, 18 Sep 2001 20:32:13 +0000 (20:32 +0000)]
[Patch #462258] On Cygwin, don't build Tkinter unless the X header files
    can be found.

23 years agoFix typo in comment
Andrew M. Kuchling [Tue, 18 Sep 2001 20:29:48 +0000 (20:29 +0000)]
Fix typo in comment

23 years agoProperly repr classes without module names.
Martin v. Löwis [Tue, 18 Sep 2001 20:23:28 +0000 (20:23 +0000)]
Properly repr classes without module names.

23 years agoTest for the safety check in wrap_cmpfunc().
Guido van Rossum [Tue, 18 Sep 2001 20:04:26 +0000 (20:04 +0000)]
Test for the safety check in wrap_cmpfunc().

23 years agowrap_cmpfunc(): added a safety check for the __cmp__ wrapper. We can
Guido van Rossum [Tue, 18 Sep 2001 20:03:57 +0000 (20:03 +0000)]
wrap_cmpfunc(): added a safety check for the __cmp__ wrapper.  We can
only safely call a type's tp_compare slot if the second argument is
also an instance of the same type.  I hate to think what
e.g. int_compare() would do with a second argument that's a float!

23 years agoan SRE bugfix a day keeps Guido away...
Fredrik Lundh [Tue, 18 Sep 2001 18:47:09 +0000 (18:47 +0000)]
an SRE bugfix a day keeps Guido away...

#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.

23 years agoFix minor usage and consistency nits.
Fred Drake [Tue, 18 Sep 2001 17:58:20 +0000 (17:58 +0000)]
Fix minor usage and consistency nits.

23 years agoAll the news that fits, we print.
Guido van Rossum [Tue, 18 Sep 2001 15:21:04 +0000 (15:21 +0000)]
All the news that fits, we print.

(Went through the logs looking for nuggets.  This is what I found.)

23 years agoSF bug #417176 (Martijn Pieters): MultiFile.read() includes CRLF
Guido van Rossum [Tue, 18 Sep 2001 14:34:06 +0000 (14:34 +0000)]
SF bug #417176 (Martijn Pieters): MultiFile.read() includes CRLF
boundary.

Fixed by keeping a readahead buffer containing the next line.

XXX We have no test suite for this.  Maybe the new email package will
help?

23 years agosoftspace(): be prepared to catch AttributeError as well as TypeError
Guido van Rossum [Tue, 18 Sep 2001 13:33:01 +0000 (13:33 +0000)]
softspace(): be prepared to catch AttributeError as well as TypeError
upon attempted attribute assignment.  Caught by MWH, SF bug #462522.

23 years agoThis module didn't work at all anymore -- blew up with AttributeError
Tim Peters [Tue, 18 Sep 2001 05:40:24 +0000 (05:40 +0000)]
This module didn't work at all anymore -- blew up with AttributeError
on file.__methods__.  Since the docs say "This module will become obsolete
in a future release", this is just a quick hack to stop it from blowing
up.  If you care about this module, test it!  It doesn't make much sense
on Windows.

23 years agoUndo some (but not all) of the more lenient acceptance of
Guido van Rossum [Tue, 18 Sep 2001 03:55:22 +0000 (03:55 +0000)]
Undo some (but not all) of the more lenient acceptance of
(AttributeError, TypeError) -- the leniency wasn't needed everywhere.

23 years agoRedo the PyMethod attributes using a dir()-friendly approach, creating
Guido van Rossum [Tue, 18 Sep 2001 03:53:24 +0000 (03:53 +0000)]
Redo the PyMethod attributes using a dir()-friendly approach, creating
descriptors for each attribute.  The getattr() implementation is
similar to PyObject_GenericGetAttr(), but delegates to im_self instead
of looking in __dict__; I couldn't do this as a wrapper around
PyObject_GenericGetAttr().

XXX A problem here is that this is a case of *delegation*.  dir()
doesn't see exactly the same attributes that are actually defined;
e.g. if the delegate is a Python function object, it supports
attributes like func_code etc., but these are not visible to dir(); on
the other hand, dynamic function attributes (stored in the function's
__dict__) *are* visible to dir().  Maybe we need a mechanism to tell
dir() about the delegation mechanism?  I vaguely recall seeing a
request in the newsgroup for a more formal definition of attribute
delegation too.  Sigh, time for a new PEP.

23 years ago- Some tests that check that assignments are not allowed expect this
Guido van Rossum [Tue, 18 Sep 2001 03:28:54 +0000 (03:28 +0000)]
- Some tests that check that assignments are not allowed expect this
  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.)

23 years agoSort the headers in PYTHON_HEADERS alphabetically. Add
Guido van Rossum [Tue, 18 Sep 2001 02:40:21 +0000 (02:40 +0000)]
Sort the headers in PYTHON_HEADERS alphabetically.  Add
structmember.h, which was missing (and caused me a snide comment by
Tim when he fixed something I missed because of the missed dependency
:-).

23 years agoWhitespace normalization.
Tim Peters [Tue, 18 Sep 2001 02:26:39 +0000 (02:26 +0000)]
Whitespace normalization.

23 years agoMake test_socketserver require the network resource.
Tim Peters [Tue, 18 Sep 2001 02:18:57 +0000 (02:18 +0000)]
Make test_socketserver require the network resource.
Add it back to the list of tests we expect to skip on Windows.

23 years agoI don't expect test_socketserver to get skipped on Windows anymore.
Tim Peters [Tue, 18 Sep 2001 00:24:10 +0000 (00:24 +0000)]
I don't expect test_socketserver to get skipped on Windows anymore.

23 years agotype_new(): Didn't compile anymore, due to change in struct memberlist
Tim Peters [Tue, 18 Sep 2001 00:23:33 +0000 (00:23 +0000)]
type_new():  Didn't compile anymore, due to change in struct memberlist
definition.  Guido, what else did you forget to check in <wink>?

23 years agoRework akin to test_threaded_import, so that this can run under regrtest.
Tim Peters [Mon, 17 Sep 2001 23:56:20 +0000 (23:56 +0000)]
Rework akin to test_threaded_import, so that this can run under regrtest.
Also raise TestSkipped (intead of appearing to fail) if the import lock
is held.

23 years agoRewrite function attributes to use the generic routines properly.
Guido van Rossum [Mon, 17 Sep 2001 23:46:56 +0000 (23:46 +0000)]
Rewrite function attributes to use the generic routines properly.
This uses the new "restricted" feature of structmember, and getset
descriptors for some of the type checks.

23 years agoTrack changes to compiler API
Jeremy Hylton [Mon, 17 Sep 2001 21:31:35 +0000 (21:31 +0000)]
Track changes to compiler API

23 years agoAPI change:
Jeremy Hylton [Mon, 17 Sep 2001 21:02:51 +0000 (21:02 +0000)]
API change:
compile() becomes replacement for builtin compile()
compileFile() generates a .pyc from a .py
both are exported in __init__

compiler.parse() gets optional second argument to specify compilation
mode, e.g. single, eval, exec

Add AbstractCompileMode as parent class and Module, Expression, and
Interactive as concrete subclasses.  Each corresponds to a compilation
mode.

THe AbstractCompileMode instances in turn delegate to CodeGeneration
subclasses specialized for their particular functions --
ModuleCodeGenerator, ExpressionCodeGeneration,
InteractiveCodeGenerator.

23 years agoRe-created after change to astgen to calculate hardest_arg correctly
Jeremy Hylton [Mon, 17 Sep 2001 20:17:02 +0000 (20:17 +0000)]
Re-created after change to astgen to calculate hardest_arg correctly

23 years agoFix calculation of hardest_arg.
Jeremy Hylton [Mon, 17 Sep 2001 20:16:30 +0000 (20:16 +0000)]
Fix calculation of hardest_arg.

The argument properties are ordered from easiest to hardest.  The
harder the arg, the more complicated that code that must be generated
to return it from getChildren() and/or getChildNodes().  The old
calculation routine was bogus, because it always set hardest_arg to
the hardness of the last argument.  Now use max() to always set it to
the hardness of the hardest argument.

23 years agoLast set of change to get regression tests to pass
Jeremy Hylton [Mon, 17 Sep 2001 19:33:48 +0000 (19:33 +0000)]
Last set of change to get regression tests to pass

Remove the only test in the syntax module.  It ends up that the
transformer must handle this error case.

In the transformer, check for a list compression in com_assign_list()
by looking for a list_for node where a comma is expected.

In pycodegen.compile() re-raise the SyntaxError rather than catching
it and exiting

23 years agoAdd support for restricting access based on restricted execution mode.
Guido van Rossum [Mon, 17 Sep 2001 19:28:08 +0000 (19:28 +0000)]
Add support for restricting access based on restricted execution mode.
Renamed the 'readonly' field to 'flags' and defined some new flag
bits: READ_RESTRICTED and WRITE_RESTRICTED, as well as a shortcut
RESTRICTED that means both.

23 years agoAdd -p option to invoke Python profiler
Jeremy Hylton [Mon, 17 Sep 2001 18:08:40 +0000 (18:08 +0000)]
Add -p option to invoke Python profiler

23 years agoOnly print attributes that start with co_.
Jeremy Hylton [Mon, 17 Sep 2001 18:08:20 +0000 (18:08 +0000)]
Only print attributes that start with co_.
If passed a .py file as an argument, try to find its accompanying
.pyc.

23 years agoHandle more syntax errors.
Jeremy Hylton [Mon, 17 Sep 2001 18:03:55 +0000 (18:03 +0000)]
Handle more syntax errors.

Invoke compiler.syntax.check() after building AST.  If a SyntaxError
occurs, print the error and exit without generating a .pyc file.

Refactor code to use compiler.misc.set_filename() rather than passing
filename argument around to each CodeGenerator instance.

23 years agoAdd utility to set filename attribute on all nodes
Jeremy Hylton [Mon, 17 Sep 2001 18:02:21 +0000 (18:02 +0000)]
Add utility to set filename attribute on all nodes

23 years agoBrian Quinlan's XML-RPC server framework.
Fredrik Lundh [Mon, 17 Sep 2001 17:35:21 +0000 (17:35 +0000)]
Brian Quinlan's XML-RPC server framework.

23 years agosupport true division
Jeremy Hylton [Mon, 17 Sep 2001 16:41:02 +0000 (16:41 +0000)]
support true division

23 years ago[Patch #462255, from Jason Tishler] Re-enables building the resouce
Andrew M. Kuchling [Mon, 17 Sep 2001 16:19:16 +0000 (16:19 +0000)]
[Patch #462255, from Jason Tishler] Re-enables building the resouce
    module on the Cygwin platform.

23 years agoSF patch #461781 by Chris Lawrence: os.path.realpath - Resolve symlinks:
Guido van Rossum [Mon, 17 Sep 2001 15:16:09 +0000 (15:16 +0000)]
SF patch #461781 by Chris Lawrence: os.path.realpath - Resolve symlinks:

   Once upon a time, I put together a little function
   that tries to find the canonical filename for a given
   pathname on POSIX. I've finally gotten around to
   turning it into a proper patch with documentation.
   On non-POSIX, I made it an alias for 'abspath', as
   that's the behavior on POSIX when no symlinks are
   encountered in the path.

   Example:
   >>> os.path.realpath('/usr/bin/X11/X')
   '/usr/X11R6/bin/X'

23 years agoAdd cross-compilation defaults to most AC_TRY_RUN values. The
Guido van Rossum [Mon, 17 Sep 2001 04:03:14 +0000 (04:03 +0000)]
Add cross-compilation defaults to most AC_TRY_RUN values.  The
supplied values are the most "normal" or "common" values found for
recent 32 bit machines.  This now seems to work to build Python 2.2
for the ARM processor used on the iPAQ.

23 years agoPyObject_Dir(): Merge in __members__ and __methods__ too (if they exist,
Tim Peters [Mon, 17 Sep 2001 02:38:46 +0000 (02:38 +0000)]
PyObject_Dir():  Merge in __members__ and __methods__ too (if they exist,
and are lists, and then just the string elements (if any)).

There are good and bad reasons for this.  The good reason is to support
dir() "like before" on objects of extension types that haven't migrated
to the class introspection API yet.  The bad reason is that Python's own
method objects are such a type, and this is the quickest way to get their
im_self etc attrs to "show up" via dir().  It looks much messier to move
them to the new scheme, as their current getattr implementation presents
a view of their attrs that's a untion of their own attrs plus their
im_func's attrs.  In particular, methodobject.__dict__ actually returns
methodobject.im_func.__dict__, and if that's important to preserve it
doesn't seem to fit the class introspection model at all.

23 years agomerge_class_dict(): Clear the error if __bases__ doesn't exist.
Tim Peters [Sun, 16 Sep 2001 20:33:22 +0000 (20:33 +0000)]
merge_class_dict():  Clear the error if __bases__ doesn't exist.

23 years agoIn a world with a growing number of subclassable types, replace
Tim Peters [Sun, 16 Sep 2001 08:40:16 +0000 (08:40 +0000)]
In a world with a growing number of subclassable types, replace
    type(x) is T
tests with
    isinstance(x, T)
Also got rid of a future-generators import, left over from code that
wasn't intended to get checked in.

23 years agoImprove handling of docstrings. I had feared this was a case of
Tim Peters [Sun, 16 Sep 2001 02:19:49 +0000 (02:19 +0000)]
Improve handling of docstrings.  I had feared this was a case of
introspection incompatibility, but in fact it's just that calltips
always gave up on a docstring that started with a newline (but
didn't realize they were giving up <wink>).

23 years agoFixed typo in new 'p' description.
Tim Peters [Sat, 15 Sep 2001 18:16:27 +0000 (18:16 +0000)]
Fixed typo in new 'p' description.

23 years agoSF bug [#461674] struct 'p' format doesn't work (maybe)
Tim Peters [Sat, 15 Sep 2001 18:09:22 +0000 (18:09 +0000)]
SF bug [#461674] struct 'p' format doesn't work (maybe)
Rewrote the 'p' description.

23 years agoSince we had a bug with multiplication of dynamic long subclasses, add a
Tim Peters [Sat, 15 Sep 2001 06:35:55 +0000 (06:35 +0000)]
Since we had a bug with multiplication of dynamic long subclasses, add a
little test to make sure it doesn't come back.

23 years agoA fix for SF bug #461546 (bug in long_mul).
Guido van Rossum [Sat, 15 Sep 2001 03:14:32 +0000 (03:14 +0000)]
A fix for SF bug #461546 (bug in long_mul).

Both int and long multiplication are changed to be more careful in
their assumptions about when one of the arguments is a sequence: the
assumption that at least one of the arguments must be an int (or long,
respectively) is still held, but the assumption that these don't smell
like sequences is no longer true: a subtype of int or long may well
have a sequence-repeat thingie!

23 years agoThe 'p' (Pascal string) pack code acts unreasonably when the string size
Tim Peters [Sat, 15 Sep 2001 02:35:15 +0000 (02:35 +0000)]
The 'p' (Pascal string) pack code acts unreasonably when the string size
and count exceed 255.  Changed to preserve as much of the string as
possible (instead of count%256 characters).

23 years agoAdd code generator for yield stmt
Jeremy Hylton [Fri, 14 Sep 2001 23:17:55 +0000 (23:17 +0000)]
Add code generator for yield stmt

23 years agolimit prefix test for lambda
Jeremy Hylton [Fri, 14 Sep 2001 23:01:49 +0000 (23:01 +0000)]
limit prefix test for lambda

the compiler package generates a module-unique trailing suffix for
each lambda

23 years agodel no longer necessary now that new module is gone
Jeremy Hylton [Fri, 14 Sep 2001 22:54:48 +0000 (22:54 +0000)]
del no longer necessary now that new module is gone

23 years agoVarious sundry changes for 2.2 compatibility
Jeremy Hylton [Fri, 14 Sep 2001 22:49:08 +0000 (22:49 +0000)]
Various sundry changes for 2.2 compatibility

Remove the option to have nested scopes or old LGB scopes.  This has a
large impact on the code base, by removing the need for two variants
of each CodeGenerator.

Add a get_module() method to CodeGenerator objects, used to get the
future features for the current module.

Set CO_GENERATOR, CO_GENERATOR_ALLOWED, and CO_FUTURE_DIVISION flags
as appropriate.

Attempt to fix the value of nlocals in newCodeObject(), assuming that
nlocals is 0 if CO_NEWLOCALS is not defined.

23 years agoThe object-being sliced in an assignment to a slice is referenced, not
Jeremy Hylton [Fri, 14 Sep 2001 22:45:57 +0000 (22:45 +0000)]
The object-being sliced in an assignment to a slice is referenced, not
bound.

When a Yield() node is visited, assign to the generator attribute of
the scope, not the visitor.

23 years agothe new new doesn't define CO_xxx as the old new did
Jeremy Hylton [Fri, 14 Sep 2001 22:44:35 +0000 (22:44 +0000)]
the new new doesn't define CO_xxx as the old new did

23 years agothe names attribute of Global is not a node
Jeremy Hylton [Fri, 14 Sep 2001 22:40:36 +0000 (22:40 +0000)]
the names attribute of Global is not a node

23 years agoUpdate the warning about transporting marshals across boxes with different
Tim Peters [Fri, 14 Sep 2001 20:40:13 +0000 (20:40 +0000)]
Update the warning about transporting marshals across boxes with different
ideas about sizeof(long).

23 years agoSupply code objects a new-style tp_members slot and tp_getattr impl.
Jeremy Hylton [Fri, 14 Sep 2001 20:08:07 +0000 (20:08 +0000)]
Supply code objects a new-style tp_members slot and tp_getattr impl.

The chief effects are to make dir() do something useful and supply
them with an __class__.

23 years agotp_new_wrapper(): A subtle change in the check for safe use.
Guido van Rossum [Fri, 14 Sep 2001 19:43:36 +0000 (19:43 +0000)]
tp_new_wrapper(): A subtle change in the check for safe use.
Allow staticbase != type, as long as their tp_new slots are the same.

23 years agoAdd call_maybe(): a variant of call_method() that returns
Guido van Rossum [Fri, 14 Sep 2001 17:51:50 +0000 (17:51 +0000)]
Add call_maybe(): a variant of call_method() that returns
NotImplemented when the lookup fails, and use this for binary
operators.  Also lookup_maybe() which doesn't raise an exception when
the lookup fails (still returning NULL).

23 years agoMarkup adjustments for consistency.
Fred Drake [Fri, 14 Sep 2001 17:48:41 +0000 (17:48 +0000)]
Markup adjustments for consistency.

23 years agocall_method():
Guido van Rossum [Fri, 14 Sep 2001 16:58:08 +0000 (16:58 +0000)]
call_method():

- Don't turn a non-tuple argument into a one-tuple.  Rather, the
  caller must pass a format that causes Py_VaBuildValue() to return a
  tuple.

- Speed things up by calling PyObject_Call (which is fairly low-level
  and straightforward) rather than PyObject_CallObject (which calls
  PyEval_CallObjectWithKeywords which calls PyObject_Call, and nothing
  is really done in the mean time except some tests for NULL args and
  valid types, which are already guaranteed).

- Cosmetics.

Other places:

- Make sure that the format argument to call_method() is surrounded by
  parentheses, so it will cause a tuple to be created.

- Replace a few calls to PyEval_CallObject() with a surefire tuple for
  args to calls to PyObject_Call().  (A few calls to
  PyEval_CallObject() remain that have NULL for args.)

23 years agoPyObject_CallObject(): this may as well call PyEval_CallObject()
Guido van Rossum [Fri, 14 Sep 2001 16:47:50 +0000 (16:47 +0000)]
PyObject_CallObject(): this may as well call PyEval_CallObject()
directly, as the only thing done here (replace NULL args with an empty
tuple) is also done there.

XXX Maybe we should take one step further and equate the two at the
macro level?  That's harder though because PyEval_Call* is declared in
a header that's not included standard.  But it is silly that
PyObject_CallObject calls PyEval_CallObject which calls back to
PyObject_Call.  Maybe PyEval_CallObject should be moved into this file
instead?  All I know is that there are too many call APIs!  The
differences between PyObject_Call and PyEval_CallObjectWithKeywords is
that the latter allows args to be NULL, and does explicit type checks
for args and kwds.

23 years agoMention SMTP additions and hmac module.
Guido van Rossum [Fri, 14 Sep 2001 16:35:16 +0000 (16:35 +0000)]
Mention SMTP additions and hmac module.

23 years agoAdd support for SMTP TLS
Andrew M. Kuchling [Fri, 14 Sep 2001 16:19:27 +0000 (16:19 +0000)]
Add support for SMTP TLS