Commit Graph

19190 Commits

Author SHA1 Message Date
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
Tim Peters 6af5bbb565 PyString_FromFormatV: Massage platform %p output to match what gcc does,
at least in the first two characters.  %p is ill-defined, and people will
forever commit bad tests otherwise ("bad" in the sense that they fall
over (at least on Windows) for lack of a leading '0x'; 5 of the 7 tests
in test_repr.py failed on Windows for that reason this time around).
2001-08-25 03:02:28 +00:00
Guido van Rossum ea46fa8494 Undo previous checkin -- Barry fixed it better. 2001-08-24 19:46:21 +00:00
Guido van Rossum d320ad08bf Update test output to match new (more informative) error message about
calling unbound method with wrong first argument.
2001-08-24 19:31:43 +00:00
Barry Warsaw 191487351a Quick and dirty fix for test_extcall failures trigged by Guido's
recent classobject.c change.  When calling an unbound method with no
instances as first argument, the error message has changed.  The
message now contains the class name, but the output text being
compared to is too generic, so skip printing it.
2001-08-24 19:11:57 +00:00
Guido van Rossum 70d4491540 Remove the local 'getset' class -- this is now a built-in type with
the same signature.
2001-08-24 18:52:50 +00:00
Guido van Rossum 239abf7e23 getset_init(): the function name in the PyArg_ParseTuple() format
should just be "getset", not "getset.__init__".
2001-08-24 18:49:10 +00:00
Guido van Rossum a15dece519 Improve the error message issued when an unbound method is called with
an inappropriate first argument.  Now that there are more ways for
this to fail, make sure to report the name of the class of the
expected instance and of the actual instance.
2001-08-24 18:48:27 +00:00
Barry Warsaw 1e2775f370 Rip the import repr truncation test out of here and put it in test_repr.py 2001-08-24 18:38:02 +00:00
Barry Warsaw 0bcf6d8d54 Added lots of tests for reprs of "simple" objects, such as file,
lambda (anonymous functions?), function, xrange, buffer, cell (need to
fill in), and (some) descriptor types.

Also added a new test case for testing repr truncation fixes.
2001-08-24 18:37:32 +00:00
Barry Warsaw 876c8cb597 PyErr_Format(): Factor out most of this code into
PyString_FromFormat() since it's much more generally useful than
    just for exceptions.
2001-08-24 18:35:23 +00:00
Barry Warsaw 7ce3694a52 repr's converted to using PyString_FromFormat() instead of sprintf'ing
into a hardcoded char* buffer.

Closes patch #454743.
2001-08-24 18:34:26 +00:00
Barry Warsaw dadace004b PyString_FromFormat() and PyString_FromFormatV(): Largely ripped from
PyErr_Format() these new C API methods can be used instead of
    sprintf()'s into hardcoded char* buffers.  This allows us to fix
    many situation where long package, module, or class names get
    truncated in reprs.

    PyString_FromFormat() is the varargs variety.
    PyString_FromFormatV() is the va_list variety

    Original PyErr_Format() code was modified to allow %p and %ld
    expansions.

    Many reprs were converted to this, checkins coming soo.  Not
    changed: complex_repr(), float_repr(), float_print(), float_str(),
    int_repr().  There may be other candidates not yet converted.

    Closes patch #454743.
2001-08-24 18:32:06 +00:00
Tim Peters 16c018d2d2 Repair repr of future-features (wasn't updated to include the new
compiler-flag argument).
2001-08-24 17:13:54 +00:00
Guido van Rossum 9881fc124e supers(): typo -- "if verify" should be "if verbose". 2001-08-24 17:07:20 +00:00
Guido van Rossum c4a1880de4 Add test suite for super(). 2001-08-24 16:55:27 +00:00
Guido van Rossum f5cb357468 Add 'super' builtin type. 2001-08-24 16:52:18 +00:00
Guido van Rossum 609c7c8e87 Add decl of PySuper_Type; fixup comments for the two other types. 2001-08-24 16:51:42 +00:00
Guido van Rossum 705f0f5a91 Add 'super', another new object type with magical properties.
super(type) -> unbound super object
super(type, obj) -> bound super object; requires isinstance(obj, type)

Typical use to call a cooperative superclass method:

class C(B):
    def meth(self, arg):
        super(C, self).meth(arg);
2001-08-24 16:47:00 +00:00
Guido van Rossum 76f0cb85c2 Add a test for the new getset type. 2001-08-24 15:24:24 +00:00
Guido van Rossum 271410ad18 Change the getset type to take an optional third function argument:
the delete function.  (Question: should the attribute name also be
recorded in the getset object?  That makes the protocol more work, but
may give us better error messages.)
2001-08-24 15:23:20 +00:00
Guido van Rossum 833a8d8641 SF patch #454553 by Walter Dörwald: add content-type to FTP URLs, like
for urllib.
2001-08-24 13:10:13 +00:00
Guido van Rossum 845fc48bf7 getset_descr_set(): guard against deletion (indicated by a set call
with a NULL value), in a somewhat lame way: call the set() function
with one argument.  Should I add a 3rd function, 'del', instead?
2001-08-24 10:17:36 +00:00
Guido van Rossum 2c25239215 slot_tp_descr_get(): guard against NULL obj or type (bug reported by
Thomas Hellor on python-dev).

slot_tp_descr_set(): if value is NULL, call __del__ instead of
__set__.
2001-08-24 10:13:31 +00:00
Guido van Rossum 91c0d8a922 getset_init(): make the arguments optional.
getset_doc: add docstring.
2001-08-24 09:55:51 +00:00
Jack Jansen 75a2f85593 Last renamed module that wasn't removed yet. 2001-08-24 09:17:15 +00:00
Tim Peters 89675078cb Back out trying to use the C values for CO_xxx.
__future__.py reverted to 1.9.
newmodule.c reverted to 2.32.
2001-08-24 06:29:12 +00:00
Tim Peters 4e2fbce71c Looks like someone forgot the change the expected output file. 2001-08-24 04:33:10 +00:00
Tim Peters a365309528 Add a test for the new // operator too. 2001-08-23 23:02:57 +00:00
Tim Peters 26c7fa355a SF bug [#454456] int overflow code needs tests.
Added tests for boundary cases in magical PEP 237 int->long auto-overflow,
but nothing here addresses the rest of the bug report so left it open.
2001-08-23 22:56:21 +00:00
Tim Peters 96685bfbf0 float_pow: Put *all* of the burden on the libm pow in normal
cases.
powu:  Deleted.

This started with a nonsensical error msg:

>>> x = -1.
>>> import sys
>>> x**(-sys.maxint-1L)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: negative number cannot be raised to a fractional power
>>>

The special-casing in float_pow was simply wrong in this case (there's
not even anything peculiar about these inputs), and I don't see any point
to it in *any* case:  a decent libm pow should have worst-case error under
1 ULP, so in particular should deliver the exact result whenever the exact
result is representable (else its error is at least 1 ULP).  Thus our
special fiddling for integral values "shouldn't" buy anything in accuracy,
and, to the contrary, repeated multiplication is less accurate than a
decent pow when the true result isn't exactly representable.  So just
letting pow() do its job here (we may not be able to trust libm x-platform
in exceptional cases, but these are normal cases).
2001-08-23 22:31:37 +00:00
Guido van Rossum 29a62dd6eb Add new built-in type 'getset' (PyGetSet_Type).
This implements the 'getset' class from test_binop.py.
2001-08-23 21:40:38 +00:00
Guido van Rossum 0b13116a62 err_ovf(): only raise OverflowError when OverflowWarning was raised. 2001-08-23 21:32:40 +00:00
Tim Peters 31960db5a5 int_pow(): Repair typo when passing on to float pow (the 2nd argument was
being passed as both the 2nd and 3rd args).  Regression test will follow.
2001-08-23 21:28:33 +00:00
Greg Ward f17efb93d9 Patch #449054 to implement PEP 250. The standard install directory for
modules and extensions on Windows is now $PREFIX/Lib/site-packages.
Includes backwards compatibility code for pre-2.2 Pythons.  Contributed
by Paul Moore.
2001-08-23 20:53:27 +00:00
Tim Peters 971e0690c4 Remove test_long's expected-output file. 2001-08-23 20:34:01 +00:00
Fredrik Lundh c266bb0594 untabification 2001-08-23 20:13:08 +00:00
Fredrik Lundh 78eedce3ff updated to current PythonWare version (1.0b3). fixed type checks in
DateTime constructor.  use ServerProxy instead of Server in sample
code.
2001-08-23 20:04:33 +00:00
Finn Bock 84cc9bf722 Committing and closing SF patch #441348 to help Jython to pass this test. 2001-08-23 18:57:01 +00:00
Barry Warsaw e98e462dab Bump to version 1.3. Also document the new behavior of the chip widgets. 2001-08-23 16:15:21 +00:00
Barry Warsaw 924ea05e45 Bump to version 1.3 2001-08-23 16:15:02 +00:00
Barry Warsaw e47e97792a Implement some suggestions by Laura Creighton.
ChipWidget.__init__(): Added a message area just below the color
    name.  Both the message and name widgets are now FLAT, DISABLED
    Entry widgets instead of Labels.  This allows users to
    copy-n-paste the color names or color specs.  Also, the contents
    of both widgets are now driven by StringVars.

set_color(): This only sets the chip color; it does not set the name
    widgets.

set_name(): New method which only sets the name widget contents.

set_message(): New method which only sets the message widget contents.

ChipViewer.update_yourself(): Set the color, name, and message for
    each chip as follows: the first line always contains the color
    spec in #rrggbb format.  The second line will contain the color
    name, but slightly differently for each widget.  For the Selected
    widget, if the color exactly matches the Nearest color, the name
    is shown, otherwise the message field will be empty.  The name
    field of the Nearest widget will always contain the color name.
2001-08-23 16:14:45 +00:00
Jack Jansen cf144b0e9e Wrapper modules underound the toolbox modules, which now have an _ prepended. 2001-08-23 14:13:06 +00:00
Jack Jansen 25a5bd7708 Renamed. 2001-08-23 14:11:10 +00:00
Jack Jansen 50ecb0ad83 Renamed the Mac toolbox modules to have an initial _ in their name. 2001-08-23 14:02:09 +00:00
Jack Jansen 3cbf6d9d6e Mac toolbox modules have gotten an _ prepended to their name. 2001-08-23 13:53:34 +00:00
Jack Jansen 77105a960b The MacOS toolbox modules have acquired an _ in front of their name. Normal usage is through a wrapper module (without underscore) which lives in the Carbon package. 2001-08-23 13:51:46 +00:00
Guido van Rossum 88e0b5bee0 SF patch #454553 by Walter Dörwald: auto-guess content-type header for
ftp urls.
2001-08-23 13:38:15 +00:00
Jack Jansen be92af0e2a Don't make even the _slightest_ modification between test and checkin,
or you will break something:-)
2001-08-23 13:25:59 +00:00
Jack Jansen 0eb936b47d The MacOS module may be available on Mac OS X, but it doesn't have a SchedParams() method, and there's no need to call it anyway. 2001-08-23 13:18:10 +00:00