- 14 Sep, 2001 16 commits
-
-
Jeremy Hylton authored
bound. When a Yield() node is visited, assign to the generator attribute of the scope, not the visitor.
-
Jeremy Hylton authored
-
Jeremy Hylton authored
-
Tim Peters authored
ideas about sizeof(long).
-
Jeremy Hylton authored
The chief effects are to make dir() do something useful and supply them with an __class__.
-
Guido van Rossum authored
Allow staticbase != type, as long as their tp_new slots are the same.
-
Guido van Rossum authored
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).
-
Fred Drake authored
-
Guido van Rossum authored
- 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.)
-
Guido van Rossum authored
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.
-
Guido van Rossum authored
-
Andrew M. Kuchling authored
-
Guido van Rossum authored
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.
-
Guido van Rossum authored
most frequently interesting information IMO. Also tidy up the output.
-
Tim Peters authored
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).
-
Tim Peters authored
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.
-
- 13 Sep, 2001 11 commits
-
-
Tim Peters authored
builtin function); Guido pointed out that it could be just another name in the __builtin__ dict for the file constructor now.
-
Tim Peters authored
-
Tim Peters authored
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).
-
Tim Peters authored
-
Tim Peters authored
-
Tim Peters authored
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.
-
Skip Montanaro authored
OverflowError message seems reasonable.
-
Fred Drake authored
and trace functions; this now declares that None will be passed for the "call" event. This closes SF bug/suggestion #460315.
-
Greg Ward authored
-
Tim Peters authored
Preliminary support. What's here works, but needs fine-tuning.
-
Guido van Rossum authored
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.
-
- 12 Sep, 2001 10 commits
-
-
Tim Peters authored
-
Tim Peters authored
because they don't work yet.
-
Guido van Rossum authored
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?).
-
Tim Peters authored
Inhibited complex unary plus optimization when applied to a complex subtype. Added PyComplex_CheckExact macro. Some comments and minor code fiddling.
-
Guido van Rossum authored
its normally chatty nature. (This completes a side project to make "make -s" truly silent unless errors occur.)
-
Tim Peters authored
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.
-
Tim Peters authored
+ 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.
-
Tim Peters authored
-
Tim Peters authored
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.
-
Fred Drake authored
-
- 11 Sep, 2001 3 commits
-
-
Tim Peters authored
-
Tim Peters authored
-
Tim Peters authored
-