Commit Graph

19208 Commits

Author SHA1 Message Date
Guido van Rossum 61cf780b6d The message accompanying the TypeError exception on a readonly
attribute changed again.
2001-08-10 21:25:24 +00:00
Guido van Rossum 13d52f0b32 - Big changes to fix SF bug #442833 (a nasty multiple inheritance
problem).  inherit_slots() is split in two parts: inherit_special()
  which inherits the flags and a few very special members from the
  dominant base; inherit_slots() which inherits only regular slots,
  and is now called for each base in the MRO in turn.  These are now
  both void functions since they don't have error returns.

- Added object.__setitem__() back -- for the same reason as
  object.__new__(): a subclass of object should be able to call
  object.__new__().

- add_wrappers() was moved around to be closer to where it is used (it
  was defined together with add_methods() etc., but has nothing to do
  with these).
2001-08-10 21:24:08 +00:00
Martin v. Löwis f24b2f3285 Autotest for netpacket/packet.h, as it is not available on all Linux versions.
Depend AF_PACKET on HAVE_NETPACKET_PACKET_H.
2001-08-10 20:29:40 +00:00
Martin v. Löwis 1ba3fd5d51 Autotest for netpacket/packet.h, as it is not available on all Linux versions.
Depend AF_PACKET on HAVE_NETPACKET_PACKET_H. Fixes #449157
2001-08-10 20:29:40 +00:00
Guido van Rossum 05ac6de2d5 Add PyDict_Merge(a, b, override):
PyDict_Merge(a, b, 1) is the same as PyDict_Update(a, b).
PyDict_Merge(a, b, 0) does something similar but leaves existing items
unchanged.
2001-08-10 20:28:28 +00:00
Andrew M. Kuchling f4aa684132 [Bug #414032] Make the 'sdist' command work when the distribution contains
libraries.  This is done by adding a .get_source_files() method,
    contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker
2001-08-10 20:24:33 +00:00
Martin v. Löwis ab0cad520d Pass the Makefile's value of CC and LDSHARED to the environment of setup.py.
This fixes the problem reported in bug report #438786.
2001-08-10 20:18:26 +00:00
Fred Drake 1cb560a653 Do more to be compatible with Windows/CygWin. Make error messages more
informative when a child process dies with an error.

This is a variation of parts of SF patch #429611.
2001-08-10 20:17:09 +00:00
Fred Drake 9443dc31c1 Remove the use of the "cat" program. This improves portability to non-Unix
platforms.

This is part the response to SF patch #429611.
2001-08-10 20:12:09 +00:00
Fred Drake 8a7b59e7b4 Added this LaTeX style file to the package since not all LaTeX installations
have it, especially on non-Unix platforms.  (MikTeX in particular does not
have it.)

This is part of the response to SF patch #429611.
2001-08-10 19:47:41 +00:00
Guido van Rossum 6d94627f1e Allow AttributeError as well as TypeError for attribute-less objects. 2001-08-10 19:42:38 +00:00
Martin v. Löwis c4416d5a2c _DATE_FMT does not always accompany CODESET. 2001-08-10 19:41:45 +00:00
Andrew M. Kuchling 13f4ea25d4 Remove unused variable 2001-08-10 19:00:41 +00:00
Andrew M. Kuchling 5079fe07fe Fix typo caught by PyChecker 2001-08-10 19:00:15 +00:00
Andrew M. Kuchling 665f248806 Add forgotten import 2001-08-10 18:59:59 +00:00
Fred Drake 981a1787b7 Wrap a comment to fit in 80 columns.
Use construction-syntax for an exception to make the argument easier
to read.
2001-08-10 18:59:30 +00:00
Andrew M. Kuchling db988b1ed3 Use .get_license() 2001-08-10 18:50:11 +00:00
Andrew M. Kuchling fa7dc57d6c [Bug #412271, bug #449009] Use 'license' as the attribute name,
though 'licence' is still supported for backward-compatibility
   (Should I add a warning to get_licence(), or not bother?)

Also fixes an UnboundLocalError noticed by PyChecker
2001-08-10 18:49:23 +00:00
Guido van Rossum d614f97733 Change PyType_Ready() to use the READY and READYING flags. This makes
it possible to detect recursive calls early (as opposed to when the
stack overflows :-).
2001-08-10 17:39:49 +00:00
Fred Drake d635e3c468 Added a warning about reference cycles and memory consumption to the
section on functions which return stack frames.

This closes SF bug #449258.
2001-08-10 17:37:33 +00:00
Guido van Rossum 9b9c972abe Add new flags for PyType_Ready(): READY to explicitly indicate the
type is ready, and READYING to indicate that it is busy with the type.

A recursive call is a fatal error.
2001-08-10 17:37:02 +00:00
Fred Drake 6d8d72b0cb Usage fix, problem reported by Keith Briggs. 2001-08-10 16:15:08 +00:00
Fred Drake e89659c02d Added documentation for the new rich comparison support.
This closes SF patch #428320.

Added documentation for the new floordiv() and truediv() functions.
This is part of SF bug #449093.

Re-organized the listing of functions to get better logical grouping.
2001-08-10 15:55:09 +00:00
Andrew M. Kuchling fcfc8d5c0e Patch #441091 from Finn Bock: the more advanced flush options are not
available in java, so only use the advanced flush options if they
  are defined in the zlib module.
2001-08-10 15:50:11 +00:00
Guido van Rossum 315cd29ecf Disable the sub() optimization until Fredrik has time to look into SF
bug #449000, "re.sub(r'\n', ...) broke".  This was Fredrik's
suggestion -- he's on vacation and said he wouldn't be able to work on
this until next week.
2001-08-10 14:56:54 +00:00
Guido van Rossum e056e4d15c Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke. 2001-08-10 14:52:48 +00:00
Neil Schemenauer 17e7be60b4 Remove "referents" structure (it's not needed). Check return value
of PyList_Append.
2001-08-10 14:46:47 +00:00
Jeremy Hylton a8b5f7d178 Remove hard-coded NT constants that are already defined in errno on NT.
Wrap some long lines.
Remove unnecessary tuple unpack.
2001-08-10 14:30:35 +00:00
Fred Drake 024ef6f493 Remove the bogus flags parameter from the PyFile_WriteString() signature;
it has no such parameter.

This closes SF bug #449761.
2001-08-10 14:27:38 +00:00
Martin v. Löwis 9b75dca192 Expose nl_langinfo through locale where available. 2001-08-10 13:58:50 +00:00
Jack Jansen 09379da7de Regenerated. 2001-08-10 12:17:04 +00:00
Jack Jansen 0cdba05815 Changed reference to config.h to pyconfig.h. 2001-08-10 10:01:05 +00:00
Martin v. Löwis 3e4b0e800b Get OPT from the environment to build the CCSHARED command.
Fixes the problem reported in bug #438786.
2001-08-10 08:56:17 +00:00
Tim Peters 772747b3f1 SF patch #438013 Remove 2-byte Py_UCS2 assumptions
Removed all instances of Py_UCS2 from the codebase, and so also (I hope)
the last remaining reliance on the platform having an integral type
with exactly 16 bits.
PyUnicode_DecodeUTF16() and PyUnicode_EncodeUTF16() now read and write
one byte at a time.
2001-08-09 22:21:55 +00:00
Tim Peters ab9ba27dc0 Whitespace normalization. 2001-08-09 21:40:30 +00:00
Tim Peters c7ca3ffba3 Skip test_mhlib on Windows -- too many Unix assumptions. 2001-08-09 21:34:54 +00:00
Guido van Rossum e4deb959cc Fix two bugs detected by PyChecker: there's no need for redundant
"import MacOS", and there *is* a need for "import operator".
2001-08-09 21:22:15 +00:00
Andrew M. Kuchling 6386a4c846 Import UnknownFileError 2001-08-09 21:02:34 +00:00
Andrew M. Kuchling 106ffdb672 Import the errno module 2001-08-09 20:59:53 +00:00
Andrew M. Kuchling affadeb9fd Use correct variable name 2001-08-09 20:57:46 +00:00
Guido van Rossum 42a8c2b221 Add resolution of __new__ story sequel. 2001-08-09 20:25:58 +00:00
Fred Drake eaa77e2ca1 Added tests for operator.floordiv() and operator.truediv(). 2001-08-09 20:23:08 +00:00
Fred Drake 428e75fc3e Add wrappers around the rich-comparison operations.
This closes SF patch #428320.

Add wrappers to expose "floor" and "true" division.
This closes SF feature request #449093.
2001-08-09 20:14:34 +00:00
Guido van Rossum 3720261729 Restore the test for 'object' that I removed when object was
uninstantiable.  All is well now.
2001-08-09 19:45:21 +00:00
Guido van Rossum 29687cd211 Sigh. Strengthen the resriction of the previous checkin: tp_new is
inherited unless *both*: (a) the base type is 'object', and (b) the
subtype is not a "heap" type.
2001-08-09 19:43:37 +00:00
Guido van Rossum c11e192d41 Thinking back to the 2.22 revision, I didn't like what I did there one
bit.  For one, this class:

    class C(object):
        def __new__(myclass, ...): ...

would have no way to call the __new__ method of its base class, and
the workaround (to create an intermediate base class whose __new__ you
can call) is ugly.

So, I've come up with a better solution that restores object.__new__,
but still solves the original problem, which is that built-in and
extension types shouldn't inherit object.__new__.  The solution is
simple: only "heap types" inherit tp_new.  Simpler, less code,
perfect!
2001-08-09 19:38:15 +00:00
Guido van Rossum a995c91243 Use type(x).__name__ to get the name of the type instead of parsing
repr(type(x)).
2001-08-09 18:56:27 +00:00
Guido van Rossum 0263c80b90 Unittests for mhlib, by Nick Mathewson. 2001-08-09 18:18:08 +00:00
Guido van Rossum 29206bc8a3 Apply anonymous SF patch #441229.
Previously, f.read() and f.readlines() checked for
  errors on their file object and possibly raised an
  IOError, but f.readline() didn't. This patch makes
  f.readline() behave like the others.

Note that I've added a call to clearerr() since the other calls to
ferror() include that too.

I have no way to test this code. :-)
2001-08-09 18:14:59 +00:00
Tim Peters 55c12d4d5b SF patch #403640: incomplete proxy handling in URLLIB
Look specific to Windows.  Don't know whether it works.
2001-08-09 18:04:14 +00:00