Commit Graph

19410 Commits

Author SHA1 Message Date
Jack Jansen d157b3795b Don't use a default "int" return type, gcc gives a warning about it. 2001-09-04 22:16:33 +00:00
Jack Jansen f9114239e7 Added pythonpath.r to the developer distribution. It's
useful to people extending Python. Suggested by
Alexandre Parenteau.
2001-09-04 22:15:05 +00:00
Tim Peters 7eea37e831 At Guido's suggestion, here's a new C API function, PyObject_Dir(), like
__builtin__.dir().  Moved the guts from bltinmodule.c to object.c.
2001-09-04 22:08:56 +00:00
Jack Jansen 2f760c35e2 On MacOSX built the toolbox extension modules iff we're building with
--enable-framework.
Some modules that are also useful outside a fullblown application are
always built.
2001-09-04 21:33:12 +00:00
Jack Jansen f6af601dd4 Template for an OSX PythonInterpreter application. 2001-09-04 21:28:03 +00:00
Andrew M. Kuchling 33a3b63e21 Correction: the Borland C port isn't fully operational yet 2001-09-04 21:25:58 +00:00
Jack Jansen d043ab6503 Photoshop sources for icon files. Not pretty, but hey! I'm not an
artist (and a certain artist didn't jump in, yet).
2001-09-04 21:25:36 +00:00
Andrew M. Kuchling 4d335b3b9b [Bug #444589] Record empty directories in the install_data command
Slightly modified version of patch from Jon Nelson (jnelson).
2001-09-04 20:42:08 +00:00
Andrew M. Kuchling a8ea5ba8a9 [Bug #436732] install.py does not record a created *.pth file in the
INSTALLED_FILES output.  Modified version of a patch from
   Jon Nelson (jnelson)
2001-09-04 20:06:43 +00:00
Tim Peters 0dad0f763c Revert one of the "division fixes" in test_long. It intends to try both
"/" and "//", and doesn't really care what they *mean*, just that both
are tried (and that, whatever they mean, they act similarly for int and
long arguments).
2001-09-04 19:48:01 +00:00
Fred Drake 1ef106c94d Make pprint more locale-friendly; patch contributed by Denis S. Otkidach.
This closes SF patch #451538.
2001-09-04 19:43:26 +00:00
Andrew M. Kuchling 4a596e3bee [Bug #457654] bkgd() used a hard-coded A_NORMAL attribute, when it should
have used the attribute argument provided as a parameter
2001-09-04 19:34:32 +00:00
Fred Drake 9f5b822fb3 Convert docstring to "raw" string. 2001-09-04 19:20:06 +00:00
Guido van Rossum 54e54c6877 The first batch of changes recommended by the fixdiv tool. These are
mostly changes of / operators into //.  Once or twice I did more or
less than recommended.
2001-09-04 19:14:14 +00:00
Fred Drake b8f2274985 Added docstrings by Neal Norwitz. This closes SF bug #450980. 2001-09-04 19:10:20 +00:00
Neil Schemenauer 6c0f20088f Move call_trace(..., PyTrace_CALL, ...) call to top of eval_frame. That
way it's called each time a generator is resumed.  The tracing of normal
functions should be unaffected by this change.
2001-09-04 19:03:35 +00:00
Fred Drake 1b41079fd9 Added docstring by Neal Norwitz. This closes SF bug #450981. 2001-09-04 18:55:03 +00:00
Fred Drake 05857df41b Added docstring by Neal Norwitz. This closes SF bug #450979. 2001-09-04 18:39:45 +00:00
Fred Drake 757f7809e1 Add more detail to the descriptions of the shutil functions.
This closes SF bug #458223.
2001-09-04 18:26:27 +00:00
Fred Drake c05fc7dd9d Added documentation for sys.maxunicode and sys.warnoptions.
Fixed a markup error which caused an em dash to be presented as a minus sign.
This closes SF bug #458350.
2001-09-04 18:18:36 +00:00
Fred Drake 7cf613dc77 HTMLParser is allowed to be more strict than sgmllib, so let's not
change their basic behavior:  When parsing something that cannot possibly
be valid in either HTML or XHTML, raise an exception.
2001-09-04 16:26:03 +00:00
Guido van Rossum a0ca3d611e - Reverse the meaning of the -m option: warnings about multiple /
operators per line or statement are now on by default, and -m turns
  these warnings off.

- Change the way multiple / operators are reported; a regular
  recommendation is always emitted after the warning.

- Report ambiguous warnings (both int|long and float|complex used for
  the same operator).

- Update the doc string again to clarify all this and describe the
  possible messages more precisely.
2001-09-04 16:22:01 +00:00
Guido van Rossum 61b850110f Suppressing all DeprecationWarning messages was a bit of a problem for
the -Qwarnall option, so I've changed this to only filter out the one
warning that's a problem in practice.
2001-09-04 15:22:02 +00:00
Guido van Rossum 81fc7783ed Suppress the warning about regex here. 2001-09-04 15:18:54 +00:00
Fred Drake c20a698932 Enhanced the test for DOCTYPE declarations, added a test for dealing with
broken declaration-like things.
2001-09-04 15:13:04 +00:00
Fred Drake 68eac2b574 Added reasonable parsing of the DOCTYPE declaration, fixed edge cases
regarding bare ampersands in content.
2001-09-04 15:10:16 +00:00
Jack Jansen 212a2e1f9f On the mac some library paths returned were outdated, some were outright funny.
Fixed.
2001-09-04 12:01:49 +00:00
Jack Jansen 4ca5f38f46 Disabled _curses modules on MacOSX. The curses version is a 1994 BSD
curses, far too old for _cursesmodule.c.
2001-09-04 09:05:11 +00:00
Tim Peters 83e7ccc9fd Whitespace normalization. 2001-09-04 06:37:28 +00:00
Tim Peters bc1c7a0854 Fixed a typo and added more tests. 2001-09-04 06:33:00 +00:00
Tim Peters e2a600099d Change long/long true division to return as many good bits as it can;
e.g., (1L << 40000)/(1L << 40001) returns 0.5, not Inf or NaN or whatever.
2001-09-04 06:17:36 +00:00
Tim Peters 9c1d7fd5f2 Move int_true_divide next to the other division routines. 2001-09-04 05:52:47 +00:00
Tim Peters 20dab9f168 Move long_true_divide next to the other division routines (for clarity!). 2001-09-04 05:31:47 +00:00
Tim Peters 9fffa3eea3 Raise OverflowError when appropriate on long->float conversion. Most of
the fiddling is simply due to that no caller of PyLong_AsDouble ever
checked for failure (so that's fixing old bugs).  PyLong_AsDouble is much
faster for big inputs now too, but that's more of a happy consequence
than a design goal.
2001-09-04 05:14:19 +00:00
Guido van Rossum 1832de4bc0 PEP 238 documented -Qwarn as warning only for classic int or long
division, and this makes sense.  Add -Qwarnall to warn for all
classic divisions, as required by the fixdiv.py tool.
2001-09-04 03:51:09 +00:00
Guido van Rossum 61c345fa37 Rename the -D option to -Q, to avoid a Jython option name conflict. 2001-09-04 03:26:15 +00:00
Tim Peters a1c1b0f468 Introduce new private API function _PyLong_AsScaledDouble. Not used yet,
but will be the foundation for Good Things:
+ Speed PyLong_AsDouble.
+ Give PyLong_AsDouble the ability to detect overflow.
+ Make true division of long/long nearly as accurate as possible (no
  spurious infinities or NaNs).
+ Return non-insane results from math.log and math.log10 when passing a
  long that can't be approximated by a double better than HUGE_VAL.
2001-09-04 02:50:49 +00:00
Tim Peters 37a309db70 builtin_dir(): Treat classic classes like types. Use PyDict_Keys instead
of PyMapping_Keys because we know we have a real dict.  Tolerate that
objects may have an attr named "__dict__" that's not a dict (Py_None
popped up during testing).

test_descr.py, test_dir():  Test the new classic-class behavior; beef up
the new-style class test similarly.

test_pyclbr.py, checkModule():  dir(C) is no longer a synonym for
C.__dict__.keys() when C is a classic class (looks like the same thing
that burned distutils! -- should it be *made* a synoym again?  Then it
would be inconsistent with new-style class behavior.).
2001-09-04 01:20:04 +00:00
Neil Schemenauer a8aefe535c Don't use dir() to find instance attribute names. 2001-09-03 15:47:21 +00:00
Neil Schemenauer 49417e76d5 Fix the names of _PyObject_GC_TRACK and _PyObject_GC_UNTRACK when the GC is
disabled.  Obviously everyone enables the GC. :-)
2001-09-03 15:44:48 +00:00
Tim Peters 0628a66c75 Restore a line deleted by mistake. 2001-09-03 08:44:02 +00:00
Tim Peters 32f453eaa4 New restriction on pow(x, y, z): If z is not None, x and y must be of
integer types, and y must be >= 0.  See discussion at
http://sf.net/tracker/index.php?func=detail&aid=457066&group_id=5470&atid=105470
2001-09-03 08:35:41 +00:00
Tim Peters 5d2b77cf31 Make dir() wordier (see the new docstring). The new behavior is a mixed
bag.  It's clearly wrong for classic classes, at heart because a classic
class doesn't have a __class__ attribute, and I'm unclear on whether
that's feature or bug.  I'll repair this once I find out (in the
meantime, dir() applied to classic classes won't find the base classes,
while dir() applied to a classic-class instance *will* find the base
classes but not *their* base classes).

Please give the new dir() a try and see whether you love it or hate it.
The new dir([]) behavior is something I could come to love.  Here's
something to hate:

>>> class C:
...     pass
...
>>> c = C()
>>> dir(c)
['__doc__', '__module__']
>>>

The idea that an instance has a __doc__ attribute is jarring (of course
it's really c.__class__.__doc__ == C.__doc__; likewise for __module__).

OTOH, the code already has too many special cases, and dir(x) doesn't
have a compelling or clear purpose when x isn't a module.
2001-09-03 05:47:38 +00:00
Tim Peters 95c99e57b3 Made a doctest out of the examples in Guido's type/class tutorial. 2001-09-03 01:24:30 +00:00
Tim Peters b7da09099a Clarify the Borland situation, based on email from Stephen. 2001-09-02 23:01:43 +00:00
Tim Peters b95ec09a44 Repair typo in comment. 2001-09-02 18:35:54 +00:00
Jack Jansen 13b54a9da3 Added the last few missing files, and put everything in the right packages.
Tested, too:-)
2001-09-02 14:48:32 +00:00
Guido van Rossum e7a95983b0 Implement what the docstring said: multiple slashes per line are
treated the same as single ones by default.  Added -m option to issue
a warning for this case instead.
2001-09-02 14:11:30 +00:00
Guido van Rossum aaf80c8c87 Add news about dictionary() constructor. 2001-09-02 13:44:35 +00:00
Tim Peters 25786c0851 Make dictionary() a real constructor. Accepts at most one argument, "a
mapping object", in the same sense dict.update(x) requires of x (that x
has a keys() method and a getitem).
Questionable:  The other type constructors accept a keyword argument, so I
did that here too (e.g., dictionary(mapping={1:2}) works).  But type_call
doesn't pass the keyword args to the tp_new slot (it passes NULL), it only
passes them to the tp_init slot, so getting at them required adding a
tp_init slot to dicts.  Looks like that makes the normal case (i.e., no
args at all) a little slower (the time it takes to call dict.tp_init and
have it figure out there's nothing to do).
2001-09-02 08:22:48 +00:00