summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Various sundry changes for 2.2 compatibilityJeremy Hylton2001-09-144-274/+188
| | | | | | | | | | | | | | | 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.
* The object-being sliced in an assignment to a slice is referenced, notJeremy Hylton2001-09-142-4/+4
| | | | | | | bound. When a Yield() node is visited, assign to the generator attribute of the scope, not the visitor.
* the new new doesn't define CO_xxx as the old new didJeremy Hylton2001-09-142-2/+18
|
* the names attribute of Global is not a nodeJeremy Hylton2001-09-144-4/+4
|
* Update the warning about transporting marshals across boxes with differentTim Peters2001-09-141-13/+8
| | | | ideas about sizeof(long).
* Supply code objects a new-style tp_members slot and tp_getattr impl.Jeremy Hylton2001-09-141-16/+34
| | | | | The chief effects are to make dir() do something useful and supply them with an __class__.
* tp_new_wrapper(): A subtle change in the check for safe use.Guido van Rossum2001-09-141-1/+1
| | | | Allow staticbase != type, as long as their tp_new slots are the same.
* Add call_maybe(): a variant of call_method() that returnsGuido van Rossum2001-09-141-10/+67
| | | | | | 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).
* Markup adjustments for consistency.Fred Drake2001-09-141-5/+6
|
* call_method():Guido van Rossum2001-09-141-36/+27
| | | | | | | | | | | | | | | | | | | | | | | - 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.)
* PyObject_CallObject(): this may as well call PyEval_CallObject()Guido van Rossum2001-09-141-16/+1
| | | | | | | | | | | | | | | 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.
* Mention SMTP additions and hmac module.Guido van Rossum2001-09-141-0/+6
|
* Add support for SMTP TLSAndrew M. Kuchling2001-09-141-0/+5
|
* SF patch #461413 (Gerhard Häring): Add STARTTLS feature to smtplibGuido van Rossum2001-09-142-2/+62
| | | | | | | | | | | This patch adds the features from RFC 2487 (Secure SMTP over TLS) to the smtplib module: - A starttls() function - Wrapper classes that simulate enough of sockets and files for smtplib, but really wrap a SSLObject - reset the list of known SMTP extensions at each call of ehlo(). This should have been the case anyway.
* _PyObject_Dump(): print the type of the object. This is by far theGuido van Rossum2001-09-141-2/+8
| | | | most frequently interesting information IMO. Also tidy up the output.
* The end of [#460467] file objects should be subclassable.Tim Peters2001-09-141-30/+63
| | | | | | | | A surprising number of changes to split tp_new into tp_new and tp_init. Turned out the older PyFile_FromFile() didn't initialize the memory it allocated in all (error) cases, which caused new sanity asserts elsewhere to fail left & right (and could have, e.g., caused file_dealloc to try decrefing random addresses).
* Changed the dict implementation to take "string shortcuts" only whenTim Peters2001-09-142-15/+52
| | | | | | | | | | | | | | | | keys are true strings -- no subclasses need apply. This may be debatable. The problem is that a str subclass may very well want to override __eq__ and/or __hash__ (see the new example of case-insensitive strings in test_descr), but go-fast shortcuts for strings are ubiquitous in our dicts (and subclass overrides aren't even looked for then). Another go-fast reason for the change is that PyCheck_StringExact() is a quicker test than PyCheck_String(), and we make such a test on virtually every access to every dict. OTOH, a str subclass may also be perfectly happy using the base str eq and hash, and this change slows them a lot. But those cases are still hypothetical, while Python's own reliance on true-string dicts is not.
* Get rid of builtin_open() entirely (the C code and docstring, not theTim Peters2001-09-132-22/+5
| | | | | builtin function); Guido pointed out that it could be just another name in the __builtin__ dict for the file constructor now.
* _PyBuiltin_Init(): For clarity, macroize this purely repetitive code.Tim Peters2001-09-131-49/+25
|
* Now that file objects are subclassable, you can get at the file constructorTim Peters2001-09-133-2/+52
| | | | | | just by doing type(f) where f is any file object. This left a hole in restricted execution mode that rexec.py can't plug by itself (although it can plug part of it; the rest is plugged in fileobject.c now).
* Use the keyword form of file() instead of open() to create TESTFN.Tim Peters2001-09-131-2/+2
|
* Added simple tests of keyword arguments in the basic type constructors.Tim Peters2001-09-131-0/+24
|
* type_call(): Change in policy. The keyword args (if any) are now passedTim Peters2001-09-132-3/+14
| | | | | | on to the tp_new slot (if non-NULL), as well as to the tp_init slot (if any). A sane type implementing both tp_new and tp_init should probably pay attention to the arguments in only one of them.
* based upon a suggestion in c.l.py, this slight expansion of theSkip Montanaro2001-09-131-1/+1
| | | | OverflowError message seems reasonable.
* Admit that we'll never add the args for a "call" event to the profileFred Drake2001-09-132-11/+9
| | | | | | and trace functions; this now declares that None will be passed for the "call" event. This closes SF bug/suggestion #460315.
* Comment tweak: point to Robin Dunn's pybsddb project on SourceForge.Greg Ward2001-09-131-2/+2
|
* SF bug [#460467] file objects should be subclassable.Tim Peters2001-09-137-53/+170
| | | | Preliminary support. What's here works, but needs fine-tuning.
* SF bug #461073: mailbox __iter__ bug, by Andrew Dalke.Guido van Rossum2001-09-131-3/+3
| | | | | | | Andrew quite correctly notices that the next() method isn't quite what we need, since it returns None upon end instead of raising StopIteration. His fix is easy enough, using iter(self.next, None) instead.
* Added items about significant subclass bugfixes.Tim Peters2001-09-121-0/+10
|
* Added subclass equality tests. Almost all of these are commented out now,Tim Peters2001-09-121-0/+11
| | | | because they don't work yet.
* build_class(): one more (hopefully the last) step on the way toGuido van Rossum2001-09-121-14/+21
| | | | | | | | | backwards compatibility. When using the class of the first base as the metaclass, use its __class__ attribute in preference over its ob_type slot. This ensures that we can still use classic classes as metaclasse, as shown in the original "Metaclasses" essay. This also makes all the examples in Demo/metaclasses/ work again (maybe these should be turned into a test suite?).
* Again perhaps the end of [#460020] bug or feature: unicode() and subclasses.Tim Peters2001-09-124-12/+45
| | | | | Inhibited complex unary plus optimization when applied to a complex subtype. Added PyComplex_CheckExact macro. Some comments and minor code fiddling.
* When MAKEFLAGS contains '-s', invoke setup.py with '-q', to silenceGuido van Rossum2001-09-121-1/+4
| | | | | | | its normally chatty nature. (This completes a side project to make "make -s" truly silent unless errors occur.)
* If interning an instance of a string subclass, intern a real string objectTim Peters2001-09-122-4/+34
| | | | | | with the same value instead. This ensures that a string (or string subclass) object's ob_sinterned pointer is always a str (or NULL), and that the dict of interned strings only has strs as keys.
* str_subtype_new, unicode_subtype_new:Tim Peters2001-09-123-15/+36
| | | | | | | | + These were leaving the hash fields at 0, which all string and unicode routines believe is a legitimate hash code. As a result, hash() applied to str and unicode subclass instances always returned 0, which in turn confused dict operations, etc. + Changed local names "new"; no point to antagonizing C++ compilers.
* More on bug 460020: disable many optimizations of unicode subclasses.Tim Peters2001-09-122-12/+66
|
* More bug 460020: lots of string optimizations inhibited for stringTim Peters2001-09-122-81/+71
| | | | | | | | | subclasses, all "the usual" ones (slicing etc), plus replace, translate, ljust, rjust, center and strip. I don't know how to be sure they've all been caught. Question: Should we complain if someone tries to intern an instance of a string subclass? I hate to slow any code on those paths.
* Add missing "}".Fred Drake2001-09-121-1/+1
|
* long_invert(): tiny speed and space optimization.Tim Peters2001-09-111-2/+1
|
* Add info about Windows filesystem limits.Tim Peters2001-09-111-1/+5
|
* More bug 460020. Disable a number of long optimizations for long subclasses.Tim Peters2001-09-112-18/+39
|
* More bug 460020: when F is a subclass of float, disable the unary plusTim Peters2001-09-112-2/+7
| | | | optimization (+F(whatever)).
* More bug 460020. When I is a subclass of int, disable the +I(whatever),Tim Peters2001-09-112-10/+15
| | | | | I(0) << whatever, I(0) >> whatever, I(whatever) << 0 and I(whatever) >> 0 optimizations.
* These modules now live under the Carbon package.Jack Jansen2001-09-111-42/+76
| | | | | | Added a few new toolbox modules. Noted machine dependencies for some modules. Moved waste to undoc.tex.
* Added applesingle, macresource, Nav and videoreader.Jack Jansen2001-09-111-9/+67
| | | | | Moved icopen to its alphabetical place. Moved waste here (from toolbox).
* Added a note that these are not available under Carbon (orJack Jansen2001-09-112-3/+8
| | | | OSX MachO Python).
* Another documentation contributor.Fred Drake2001-09-111-0/+1
|
* Document clearly that the only way to retrieve the return code from theFred Drake2001-09-112-0/+13
| | | | | child processes is to use the Popen3 and Popen4 classes. This fixes SF bug #460512.
* The endless 460020 bug.Tim Peters2001-09-112-6/+18
| | | | Disable t[:], t*0, t*1 optimizations when t is of a tuple subclass type.
* Added Donovan Preston.Jack Jansen2001-09-111-0/+1
|