Commit Graph

625 Commits

Author SHA1 Message Date
Guido van Rossum 5f284ce68e Introduction to rich comparisons:
- Removed the nb_add slot from the PyNumberMethods struct.

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.

- Added typedef richcmpfunc.

- Added tp_richcompare slot to PyTypeObject (replacing spare tp_xxx7).

- Added APIs PyObject_RichCompare() and PyObject_RichCompareBool().

- Added rich comparison operators Py_LT through Py_GE.
2001-01-17 15:20:39 +00:00
Guido van Rossum 31c69431e6 Bump version to 2.1a1. (To be released Friday.) 2001-01-17 14:12:33 +00:00
Barry Warsaw d6a9e84c81 Committing PEP 232, function attribute feature, approved by Guido.
Closes SF patch #103123.

funcobject.h:

    PyFunctionObject: add the func_dict slot.

funcobject.c:

    PyFunction_New(): Initialize the func_dict slot to NULL.

    func_getattr(): Rename to func_getattro() and change the
    signature.  It's more efficient to use attro methods and dig the C
    string out than it is to re-convert a C string to a PyString.

    Also, add support for getting the __dict__ (a.k.a. func_dict)
    attribute, and for getting an arbitrary function attribute.

    func_setattr(): Rename to func_setattro() and change the signature
    for the same reason.  Also add support for setting __dict__
    (a.k.a. func_dict) and any arbitrary function attribute.

    func_dealloc(): Be sure to DECREF the func_dict slot.

    func_traverse(): Be sure to traverse func_dict too.

    PyFunction_Type: make the necessary func_?etattro() changes.

classobject.c:

    instancemethod_memberlist: Add __dict__

    instancemethod_setattro(): New method to set arbitrary attributes
    on methods (really the underlying im_func).  Raise TypeError when
    the instance is bound or when you're trying to set one of the
    reserved im_* attributes.

    instancemethod_getattr(): Renamed to instancemethod_getattro()
    since that's what it really is.  Also, added support fo getting
    arbitrary attributes through the im_func.

    PyMethod_Type: Do the ?etattr{,o} dance.
2001-01-15 20:40:19 +00:00
Andrew M. Kuchling 234fb632a3 Change LONG_BIT error warning to mention glibc, too, since this is really
a glibc, not a gcc, problem.
2001-01-12 15:06:28 +00:00
Neil Schemenauer a7ed694542 - Add nb_cmp slot for new style nubmers.
- Define type flag for new style numbers.
- Add Py_NotImplemented.
2001-01-04 01:31:50 +00:00
Neil Schemenauer dd038db2c2 Remove PyInstance_*BinOp functions. 2001-01-04 01:30:34 +00:00
Andrew M. Kuchling 0c7a0bdf4a Added header file for C API exported by _cursesmodule.c 2000-12-22 21:51:10 +00:00
Guido van Rossum 429b41e5ae Add declarations for PySys_ResetWarnOptions() and
PySys_AddWarnOption().
2000-12-15 22:01:39 +00:00
Guido van Rossum 3fc30372c7 Add declarations for standard warning category classes (PyExc_Warning
etc.) and the PyErr_Warn() function.
2000-12-15 21:57:34 +00:00
Thomas Wouters 2cffc7d420 Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.
2000-11-03 08:18:37 +00:00
Jeremy Hylton 20da14c56d getting close 2000-10-13 23:05:44 +00:00
Trent Mick 0a7af4058f Use suggested workaround for PyOS_CheckStack causing failure of test_[s]re.py
on Win64.

This closes bug http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=116516
2000-10-11 17:18:11 +00:00
Jeremy Hylton 1e75e816e0 bump patchlevel to 2.0c1 2000-10-09 15:13:47 +00:00
Marc-André Lemburg 77317ca7dc Added Py_FPROTO macro which was available in Python 1.5.x and below.
This should not be used for new code, but will probably make porting
old extensions to 2.0 a lot easier.

Also see Bug #116011.
2000-10-05 17:25:45 +00:00
Tim Peters d57731f74b Move LONG_BIT from intobject.c to pyport.h. #error if it's already been
#define'd to an unreasonable value (several recent gcc systems have
misdefined it, causing bogus overflows in integer multiplication).  Nuke
CHAR_BIT entirely.
2000-10-05 01:42:25 +00:00
Fred Drake d5fadf75e4 Rationalize use of limits.h, moving the inclusion to Python.h.
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.

This closes SourceForge patch #101659 and bug #115323.
2000-09-26 05:46:01 +00:00
Guido van Rossum 39d59b47b7 It's.....
Python 2.0b2!

(Note: Jeremy will finish the release on Sept. 26; I have to go on an
unexpected business trip.)
2000-09-26 00:36:03 +00:00
Fred Drake 9e2851566c Andrew Kuchling <akuchlin@mems-exchange.org>:
Add three new convenience functions to the PyModule_*() family:
PyModule_AddObject(), PyModule_AddIntConstant(), PyModule_AddStringConstant().

This closes SourceForge patch #101233.
2000-09-23 03:24:27 +00:00
Tim Peters 38fd5b6413 Derived from Martin's SF patch 110609: support unbounded ints in %d,i,u,x,X,o formats.
Note a curious extension to the std C rules:  x, X and o formatting can never produce
a sign character in C, so the '+' and ' ' flags are meaningless for them.  But
unbounded ints *can* produce a sign character under these conversions (no fixed-
width bitstring is wide enough to hold all negative values in 2's-comp form).  So
these flags become meaningful in Python when formatting a Python long which is too
big to fit in a C long.  This required shuffling around existing code, which hacked
x and X conversions to death when both the '#' and '0' flags were specified:  the
hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or
'+' flags too, since signs were always meaningless before for x and X conversions.
Isomorphic shuffling was required in unicodeobject.c.
Also added dozens of non-trivial new unbounded-int test cases to test_format.py.
2000-09-21 05:43:11 +00:00
Marc-André Lemburg d1ba443206 This patch adds a new Python C API called PyString_AsStringAndSize()
which implements the automatic conversion from Unicode to a string
object using the default encoding.

The new API is then put to use to have eval() and exec accept
Unicode objects as code parameter. This closes bugs #110924
and #113890.

As side-effect, the traditional C APIs PyString_Size() and
PyString_AsString() will also accept Unicode objects as
parameters.
2000-09-19 21:04:18 +00:00
Guido van Rossum 9e8181b809 Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy.
I've tested that it doesn't broeak a non-Pth build on Linux.

Changes include:

- There's a --with-pth configure option.

- Instead of _GNU_PTH, we test for HAVE_PTH.

- Better signal handling.

- (The config.h.in file is regenerated in a slightly different order.)
2000-09-19 00:46:46 +00:00
Guido van Rossum c7247ce269 Add typedef PyOS_sighandler_t and prototypes for PyOS_getsig() and
PyOS_setsig().
2000-09-16 16:31:31 +00:00
Skip Montanaro 682c25a495 RET_SAVE references should be Py_BLOCK_THREADS references 2000-09-15 18:19:27 +00:00
Tim Peters 4826a894c5 Close SF bug 110826: a complaint about the way Python #define'd NULL.
It's hard to sort out what the bug was, exactly.  So, Big Hammer:

1. Python shouldn't be in the business of #define'ing NULL, period.
2. Users of the Python C API shouldn't be in the business of not including
   Python.h, period.

Hence:

1. Removed all #define's of NULL in Python source code (pyport.h and
   object.h).
2. Since we're *relying* on stdio.h defining NULL, put an #error in
   Python.h after its #include of stdio.h if NULL isn't defined then.
2000-09-10 01:02:41 +00:00
Tim Peters 1a2eefdc4f A #define didn't start in column 1. Closes SF bug 113888. 2000-09-08 15:45:34 +00:00
Vladimir Marangozov e2bf7e63d6 Add missing Py_PROTO macro for backward compatibility with old extensions
(sources) which may still use it and now fail to compile.
Reported by M-A Lemburg.  Closes [ Bug #113576 ].
2000-09-08 12:55:35 +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
Jeremy Hylton b709df3810 refactor __del__ exception handler into PyErr_WriteUnraisable
add sanity check to gc: if an exception occurs during GC, call
PyErr_WriteUnraisable and then call Py_FatalEror.
2000-09-01 02:47:25 +00:00
Tim Peters 51de6906be Supply missing prototypes for new Py_{Get,Set}RecursionLimit; fixes compiler wngs;
un-analize Get's definition ("void" is needed only in declarations, not defns, &
is generally considered bad style in the latter).
2000-09-01 00:01:58 +00:00
Fred Drake 926f1d673a Added prototype for PyToken_ThreeChars(), to remove compiler warning
in Parser/grammar.c.
2000-08-31 05:09:57 +00:00
Tim Peters 8ebe84dff5 The new PyEval_ReInitThreads wasn't declared in ceval.h; compiler wngs. 2000-08-27 20:00:35 +00:00
Guido van Rossum 0df002c45b Add three new APIs: PyRun_AnyFileEx(), PyRun_SimpleFileEx(),
PyRun_FileEx().  These are the same as their non-Ex counterparts but
have an extra argument, a flag telling them to close the file when
done.

Then this is used by Py_Main() and execfile() to close the file after
it is parsed but before it is executed.

Adding APIs seems strange given the feature freeze but it's the only
way I see to close the bug report without incompatible changes.

[ Bug #110616 ] source file stays open after parsing is done (PR#209)
2000-08-27 19:21:52 +00:00
Fredrik Lundh 2f15b25da2 implements PyOS_CheckStack for Windows and MSVC. this fixes a
couple of potential stack overflows, including bug #110615.

closes patch #101238
2000-08-27 19:15:31 +00:00
Fred Drake 6d63adfbb7 Improve the exceptions raised by PyErr_BadInternalCall(); adding the
filename and line number of the call site to allow esier debugging.

This closes SourceForge patch #101214.
2000-08-24 22:38:39 +00:00
Thomas Wouters dd8dbdb717 The real suport for augmented assignment: new opcodes, new PyNumber and
PySequence methods and functions, new tokens.
2000-08-24 20:09:45 +00:00
Fred Drake ef8ace3a6f Charles G. Waldman <cgw@fnal.gov>:
Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit
arguments to opcodes instead of being forced to stick to the 16-bit
limit.  This is especially useful for machine-generated code, which
can be too long for the SET_LINENO parameter to fit into 16 bits.

This closes the implementation portion of SourceForge patch #100893.
2000-08-24 00:32:09 +00:00
Barry Warsaw 35fd665981 PEP 214, Extended print Statement, has been accepted by the BDFL.
This adds the two new opcodes to support this feature: PRINT_ITEM_TO,
PRINT_NEWLINE_TO.
2000-08-21 15:36:27 +00:00
Barry Warsaw 5eae2c160f Moved LONG_LONG #define from here to pyport.h. 2000-08-18 04:48:56 +00:00
Barry Warsaw fd847b23e6 Moved LONG_LONG #define from longobject.h to here, since it's needed
by the following.

typedef in a portable way the Python name for the C9X uintptr_t type.
This latter is the most portable way to spell an integral type to
which a void* can be cast to and back again without losing
information.  Parallel checkin hacks configure to check if the
platform/compiler supports the C9X name.
2000-08-18 04:48:18 +00:00
Thomas Wouters 5215225ea1 Apply SF patch #101135, adding 'import module as m' and 'from module import
name as n'. By doing some twists and turns, "as" is not a reserved word.

There is a slight change in semantics for 'from module import name' (it will
now honour the 'global' keyword) but only in cases that are explicitly
undocumented.
2000-08-17 22:55:00 +00:00
Andrew M. Kuchling 1582a3ab98 Updated comment 2000-08-16 12:27:23 +00:00
Andrew M. Kuchling 080bb2a424 Deleted now-unused include files 2000-08-16 12:22:25 +00:00
Tim Peters 39dce29365 Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.
This was a misleading bug -- the true "bug" was that hash(x) gave an error
return when x is an infinity.  Fixed that.  Added new Py_IS_INFINITY macro to
pyport.h.  Rearranged code to reduce growing duplication in hashing of float and
complex numbers, pushing Trent's earlier stab at that to a logical conclusion.
Fixed exceedingly rare bug where hashing of floats could return -1 even if there
wasn't an error (didn't waste time trying to construct a test case, it was simply
obvious from the code that it *could* happen).  Improved complex hash so that
hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
2000-08-15 03:34:48 +00:00
Vladimir Marangozov dcb45c34f5 Fix a typo in the PyMem_Resize macro, found by Andrew Kuchling 2000-08-13 11:59:08 +00:00
Skip Montanaro 803d6e5451 list comprehensions. see
http://sourceforge.net/patch/?func=detailpatch&patch_id=100654&group_id=5470

for details.
2000-08-12 18:09:51 +00:00
Thomas Wouters 0be5aab04d Merge UNPACK_LIST and UNPACK_TUPLE into a single UNPACK_SEQUENCE, since they
did the same anyway.

I'm not sure what to do with Tools/compiler/compiler/* -- that isn't part of
distutils, is it ? Should it try to be compatible with old bytecode version ?
2000-08-11 22:15:52 +00:00
Vladimir Marangozov 2c57e076fe #include reordering so that extern "C" does not interfere with
standard C++ specific includes.

Closes patch 101061.
2000-08-11 11:48:33 +00:00
Marc-André Lemburg 1a731c60a3 Added #fndef's to avoid compiler errors. 2000-08-11 11:43:10 +00:00
Peter Schneider-Kamp 10e1bf2f64 remove all occurence of math.rint() from the sources
(and yes, "Currintly" also counts <0.5 wink>)
2000-08-10 04:23:30 +00:00
Jack Jansen 275abb3f1b Added a prototype for PyOS_CheckStack (within #ifdef USE_STACKCHECK). 2000-08-07 21:00:42 +00:00
Marc-André Lemburg bff879cabb This patch finalizes the move from UTF-8 to a default encoding in
the Python Unicode implementation.

The internal buffer used for implementing the buffer protocol
is renamed to defenc to make this change visible. It now holds the
default encoded version of the Unicode object and is calculated
on demand (NULL otherwise).

Since the default encoding defaults to ASCII, this will mean that
Unicode objects which hold non-ASCII characters will no longer
work on C APIs using the "s" or "t" parser markers. C APIs must now
explicitly provide Unicode support via the "u", "U" or "es"/"es#"
parser markers in order to work with non-ASCII Unicode strings.

(Note: this patch will also have to be applied to the 1.6 branch
 of the CVS tree.)
2000-08-03 18:46:08 +00:00
Guido van Rossum c4a19e7fe9 Remobe beopen/cnri/cwi copyrights, according to CNRI instructions.
This doesn't change the copyright status for these files -- just the
markings!  Doing it on the main branch for these three files for which
the HEAD revision was pushed back into 1.6.
2000-08-03 16:42:14 +00:00
Guido van Rossum 16b1ad9c7d Changing the CNRI copyright notice according to CNRI's instructions.
This is a notice without a date, which apparently is not a claim to
copyright but only advice to the reader.  IANAL. :-)
2000-08-03 16:24:25 +00:00
Andrew M. Kuchling 767bf49b6b Added #define for oldest version of argument calling 2000-08-03 02:28:54 +00:00
Guido van Rossum 367e46a943 Of course, you meant "#if 0" and not "#ifdef 0". :) 2000-08-01 18:28:44 +00:00
Peter Schneider-Kamp 1c2b178ceb Guido said this is food for the beta-testers<wink> 2000-08-01 16:53:44 +00:00
Peter Schneider-Kamp 25f68944c2 patch from Vladimir (move Py_Mem* interface to Include/pymem.h) 2000-07-31 22:19:30 +00:00
Peter Schneider-Kamp 7e01890986 merge Include/my*.h into Include/pyport.h
marked my*.h as obsolete
2000-07-31 15:28:04 +00:00
Sjoerd Mullender 0765fe3a05 Make mode_t available for the declaration of _getpty(). 2000-07-26 15:46:29 +00:00
Thomas Wouters 334fb8985b Use 'void' directly instead of the ANY #define, now that all code is ANSI C.
Leave the actual #define in for API compatibility.
2000-07-25 12:56:38 +00:00
Thomas Wouters 1e0c2f4bee Create a new section of pyport.h to hold all external function declarations
for systems that are missing those declarations from system include files.
Start by moving a pointy-haired ones from their previous locations to the
new section.

(The gethostname() one, for instance, breaks on several systems, because
some define it as (char *, size_t) and some as (char *, int).)

I purposely decided not to include the summary of used #defines like Tim did
in the first section of pyport.h. In my opinion, the number of #defines
likedly to be used by this section would make such an overview unwieldy. I
would suggest documenting the non-obvious ones, though.
2000-07-24 16:06:23 +00:00
Thomas Wouters 94d8fea62e Remove function-less prototype (old function that was removed ?) that
happens to be a C++ reserved word, too.
2000-07-24 10:58:31 +00:00
Tim Peters 4f1b2081e9 Removed all instances of RETSIGTYPE from the source code: signal
handlers "return void", according to ANSI C.
Removed the new Py_RETURN_FROM_SIGNAL_HANDLER macro.
Left RETSIGTYPE in the config stuff, because it's not clear to
me that others aren't relying on it (e.g., extension modules).
2000-07-23 21:18:09 +00:00
Tim Peters 8315ea5790 Included assert.h in Python.h -- it's absurd that this basic tool of
good C practice hasn't been available to everything all along.
Added Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) macro to pyport.h; this
just casts VALUE from type WIDE to type NARROW, but assert-fails if
Py_DEBUG is defined and info is lost due to casting.
Replaced a line in Fredrik's fix to marshal.c to use the new macro.
2000-07-23 19:28:35 +00:00
Tim Peters 1be46844d9 Recent ANSIfication introduced a couple instances of
#if RETSIGTYPE != void
That isn't C, and MSVC properly refuses to compile it.
Introduced new Py_RETURN_FROM_SIGNAL_HANDLER macro in pyport.h
to expand to the correct thing based on RETSIGTYPE.  However,
only void is ANSI!  Do we still have platforms that return int?
The Unix config mess appears to #define RETSIGTYPE by magic
without being asked to, so I assume it's "a problem" across
Unices still.
2000-07-23 18:10:18 +00:00
Thomas Wouters 5f37591a16 ANSIfications: fix empty arglists, and remove the checks for
'HAVE_STDARG_PROTOTYPES' (consider it true, remove false branch)
2000-07-22 23:30:03 +00:00
Thomas Wouters 7889010731 Miscelaneous ANSIfications. I'm assuming here 'main' should take (int,
char**) and return an int even on PC platforms. If not, please fix
PC/utils/makesrc.c ;-P
2000-07-22 19:25:51 +00:00
Marc-André Lemburg cf5f358784 Restore PyXXX_Length() APIs for binary compatibility.
New code will see the macros and therefore use the PyXXX_Size()
APIs instead.
By Thomas Wouters.
2000-07-17 09:22: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
Andrew M. Kuchling 06051edc0d Added PyObject_AsFileDescriptor, which checks for integer, long integer,
or .fileno() method
2000-07-13 23:56:54 +00:00
Jeremy Hylton fa521f1b2a fix PyXXX_Length macros as suggested by Fred 2000-07-13 19:39:15 +00:00
Skip Montanaro 794b483d0d deleted obsolete SYMANTEC__CFM68K__ tests 2000-07-12 17:26:09 +00:00
Skip Montanaro 6980dff3db delete obsolete SYMANTEC__CFM68K__ #ifdefs 2000-07-12 17:21:42 +00:00
Jeremy Hylton 6253f83b0a change abstract size functions PySequence_Size &c.
add macros for backwards compatibility with C source
2000-07-12 12:56:19 +00:00
Fred Drake 4d4daed7cd Fix incomplete merge of Ping's SyntaxError enhancement patch (my fault).
Comment change only.
2000-07-11 19:49:15 +00:00
Fred Drake 85f363990c Create two new exceptions: IndentationError and TabError. These are
used for indentation related errors.  This patch includes Ping's
improvements for indentation-related error messages.

Closes SourceForge patches #100734 and #100856.
2000-07-11 17:53:00 +00:00
Vladimir Marangozov 14a4d88a2e Remove the "1" that Tim sticked to the preprocessor symbol for unknown reasons
(cf. the rest of the headers in the distribution)
2000-07-10 04:59:49 +00:00
Vladimir Marangozov d8a933248e A small comment fix just to make sure I got my cvs/ssh setup right. 2000-07-10 04:30:56 +00:00
Fred Drake bd03bfce45 Remove legacy use of __SC__; no longer needed now that ANSI source is
the standard for Python implementation.
2000-07-09 14:22:08 +00:00
Tim Peters dbd9ba6a6c Nuke all remaining occurrences of Py_PROTO and Py_FPROTO. 2000-07-09 03:09:57 +00:00
Fred Drake 3cf4d2b3ea ANSI-fication and Py_PROTO extermination. 2000-07-09 00:55:06 +00:00
Fred Drake ea9cb5aebf ANSI-fication and Py_PROTO extermination. 2000-07-09 00:20:36 +00:00
Fred Drake 5eb6d4e3bf ANSI-fication and Py_PROTO extermination. 2000-07-08 23:37:28 +00:00
Fred Drake d5c84ede06 ANSI-fication of the sources -- remove Py_PROTO! 2000-07-08 17:25:55 +00:00
Tim Peters 7d3a511a40 Cray J90 fixes for long ints.
This was a convenient excuse to create the pyport.h file recently
discussed!
Please use new Py_ARITHMETIC_RIGHT_SHIFT when right-shifting a
signed int and you *need* sign-extension.  This is #define'd in
pyport.h, keying off new config symbol SIGNED_RIGHT_SHIFT_ZERO_FILLS.
If you're running on a platform that needs that symbol #define'd,
the std tests never would have worked for you (in particular,
at least test_long would have failed).
The autoconfig stuff got added to Python after my Unix days, so
I don't know how that works.  Would someone please look into doing
& testing an auto-config of the SIGNED_RIGHT_SHIFT_ZERO_FILLS
symbol?  It needs to be defined if & only if, e.g., (-1) >> 3 is
not -1.
2000-07-08 04:17:21 +00:00
Greg Stein a90b23c571 One of the new prototypes was missing the "void" args. 2000-07-08 00:46:19 +00:00
Tim Peters 9ace6bc7ef Got RID of redundant coercions in longobject.c (as spotted by Greg
Stein -- thanks!).  Incidentally removed all the Py_PROTO macros
from object.h, as they prevented my editor from magically finding
the definitions of the "coercion", "cmpfunc" and "reprfunc"
typedefs that were being redundantly applied in longobject.c.
2000-07-08 00:32:04 +00:00
Marc-André Lemburg fa1309fd72 Fix to use Py_UCS4 2000-07-07 17:45:37 +00:00
Tim Peters 9f688bf9d2 Some cleanup of longs in prepartion for Cray J90 fixes: got
rid of Py_PROTO, switched to ANSI function decls, and did some
minor fiddling.
2000-07-07 15:53:28 +00:00
Marc-André Lemburg 5a5c81a0e9 Added new API PyUnicode_FromEncodedObject() which supports decoding
objects including instance objects.

The old API PyUnicode_FromObject() is still available as shortcut.
2000-07-07 13:46:42 +00:00
Marc-André Lemburg 295b1bbca1 Defunct the _XOPEN_SOURCE define for now. Suggested by Fredrik
Lundh as response to bug reports on True64 and IRIX.
2000-07-07 11:24:49 +00:00
Marc-André Lemburg 43279100f4 Bill Tutt: Added Py_UCS4 typedef to hold UCS4 values (these need
at least 32 bits as opposed to Py_UNICODE which rely on having
16 bits).
2000-07-07 09:01:41 +00:00
Marc-André Lemburg 3d1a1d7f0c Added prototypes for the new codec APIs for strings. These APIs
match the ones in the Unicode implementation, but were extended
to be able to reuse the existing Unicode codecs for string
purposes too.

Conversion from string to Unicode and back are done using the
default encoding.
2000-07-06 11:25:40 +00:00
Marc-André Lemburg f03e74126e Modified the ISALPHA and ISALNUM macros to use the new lookup APIs
from unicodectype.c
2000-07-05 09:45:59 +00:00
Marc-André Lemburg 82249c8389 Added #defines to enable SUSv2 compatibility where available and
to switch on support for BSD and SysV on platforms which use glibc
such as Linux.

These #defines are documented in e.g. the file /usr/include/features.h
on Linux platforms and the SUSv2 docs.
2000-07-05 08:53:18 +00:00
Tim Peters 1f5871e834 Removed Py_PROTO and switched to ANSI C declarations in the dict
implementation.  This was really to test whether my new CVS+SSH
setup is more usable than the old one -- and turns out it is (for
whatever reason, it was impossible to do a commit before that
involved more than one directory).
2000-07-04 17:44:48 +00:00
Marc-André Lemburg a9c103bc09 Added new Py_UNICODE_ISALPHA() and Py_UNICODE_ISALNUM() macros
which are true for alphabetic and alphanumeric characters resp.

The macros are currently implemented using the existing is* tables
but will have to be updated to meet the Unicode standard definitions
(add tables for non-cased letters and letter modifiers).
2000-07-03 10:52:13 +00:00
Guido van Rossum 4cc6ac7b87 Neil Schemenauer: small fixes for GC 2000-07-01 01:00:38 +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