From Jarrett at meetingalove.com Thu Apr 1 12:01:50 2004 From: Jarrett at meetingalove.com (Concepcion Garcia) Date: Wed Mar 31 23:08:03 2004 Subject: [Python-checkins] opportunity Message-ID: Diplomas from prestigious non-accredited universities NO required tests, classes, books, or interviews. Bachelors, Masters, MBA, and Doctorate (PhD) diplomas available in the field of your choice - that's right, you can become a Doctor and receive all the benefits and admiration that comes with it! No one is turned down. CALL TODAY ------->> 1 - 270-573-8493 (24 hours) <<----------- "I finally got my dream job that I knew I deserved. Thank you very much... " Fred Thompson, Kansas City, MO. "This got me a great job, that I never could have have without this program. Thank you. " Sharra Minnett , Chicago, IL From fdrake at users.sourceforge.net Thu Apr 1 02:38:52 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 1 02:50:46 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_optparse.py, 1.2.8.1, 1.2.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12994/Lib/test Modified Files: Tag: release23-maint test_optparse.py Log Message: Fix support for the "prog" keyword to the OptionParser constructor, as well as directly setting the .prog attribute (which should be supported based on the class docstring). Closes SF bug #850964. Index: test_optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_optparse.py,v retrieving revision 1.2.8.1 retrieving revision 1.2.8.2 diff -C2 -d -r1.2.8.1 -r1.2.8.2 *** test_optparse.py 4 Aug 2003 22:49:42 -0000 1.2.8.1 --- test_optparse.py 1 Apr 2004 07:38:49 -0000 1.2.8.2 *************** *** 613,616 **** --- 613,632 ---- sys.argv[0] = oldargv + def test_version_with_prog_keyword(self): + oldargv = sys.argv[0] + sys.argv[0] = "./foo/bar" + self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1", + prog="splat") + self.assertStdoutEquals(["--version"], "splat 0.1\n") + sys.argv[0] = oldargv + + def test_version_with_prog_attribute(self): + oldargv = sys.argv[0] + sys.argv[0] = "./foo/bar" + self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1") + self.parser.prog = "splat" + self.assertStdoutEquals(["--version"], "splat 0.1\n") + sys.argv[0] = oldargv + def test_no_version(self): self.parser = OptionParser(usage=SUPPRESS_USAGE) From fdrake at users.sourceforge.net Thu Apr 1 02:38:52 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 1 02:50:48 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.5.8.1,1.5.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12994/Lib Modified Files: Tag: release23-maint optparse.py Log Message: Fix support for the "prog" keyword to the OptionParser constructor, as well as directly setting the .prog attribute (which should be supported based on the class docstring). Closes SF bug #850964. Index: optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/optparse.py,v retrieving revision 1.5.8.1 retrieving revision 1.5.8.2 diff -C2 -d -r1.5.8.1 -r1.5.8.2 *** optparse.py 26 Jan 2004 18:40:49 -0000 1.5.8.1 --- optparse.py 1 Apr 2004 07:38:49 -0000 1.5.8.2 *************** *** 1026,1029 **** --- 1026,1034 ---- self.values = None + def _get_prog_name(self): + if self.prog: + return self.prog + else: + return get_prog_name() # -- Simple modifier methods --------------------------------------- *************** *** 1289,1298 **** """ self.print_usage(sys.stderr) ! sys.exit("%s: error: %s" % (get_prog_name(), msg)) def get_usage (self): if self.usage: return self.formatter.format_usage( ! self.usage.replace("%prog", get_prog_name())) else: return "" --- 1294,1303 ---- """ self.print_usage(sys.stderr) ! sys.exit("%s: error: %s" % (self._get_prog_name(), msg)) def get_usage (self): if self.usage: return self.formatter.format_usage( ! self.usage.replace("%prog", self._get_prog_name())) else: return "" *************** *** 1312,1316 **** def get_version (self): if self.version: ! return self.version.replace("%prog", get_prog_name()) else: return "" --- 1317,1321 ---- def get_version (self): if self.version: ! return self.version.replace("%prog", self._get_prog_name()) else: return "" From fdrake at users.sourceforge.net Thu Apr 1 02:40:37 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 1 02:52:28 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13332/Lib Modified Files: optparse.py Log Message: Fix support for the "prog" keyword to the OptionParser constructor, as well as directly setting the .prog attribute (which should be supported based on the class docstring). Closes SF bug #850964. Index: optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/optparse.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** optparse.py 21 Mar 2004 19:28:48 -0000 1.7 --- optparse.py 1 Apr 2004 07:40:35 -0000 1.8 *************** *** 1026,1029 **** --- 1026,1034 ---- self.values = None + def _get_prog_name(self): + if self.prog: + return self.prog + else: + return get_prog_name() # -- Simple modifier methods --------------------------------------- *************** *** 1289,1298 **** """ self.print_usage(sys.stderr) ! sys.exit("%s: error: %s" % (get_prog_name(), msg)) def get_usage (self): if self.usage: return self.formatter.format_usage( ! self.usage.replace("%prog", get_prog_name())) else: return "" --- 1294,1303 ---- """ self.print_usage(sys.stderr) ! sys.exit("%s: error: %s" % (self._get_prog_name(), msg)) def get_usage (self): if self.usage: return self.formatter.format_usage( ! self.usage.replace("%prog", self._get_prog_name())) else: return "" *************** *** 1312,1316 **** def get_version (self): if self.version: ! return self.version.replace("%prog", get_prog_name()) else: return "" --- 1317,1321 ---- def get_version (self): if self.version: ! return self.version.replace("%prog", self._get_prog_name()) else: return "" From fdrake at users.sourceforge.net Thu Apr 1 02:40:37 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 1 02:52:30 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_optparse.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13332/Lib/test Modified Files: test_optparse.py Log Message: Fix support for the "prog" keyword to the OptionParser constructor, as well as directly setting the .prog attribute (which should be supported based on the class docstring). Closes SF bug #850964. Index: test_optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_optparse.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_optparse.py 1 May 2003 17:45:38 -0000 1.2 --- test_optparse.py 1 Apr 2004 07:40:35 -0000 1.3 *************** *** 613,616 **** --- 613,632 ---- sys.argv[0] = oldargv + def test_version_with_prog_keyword(self): + oldargv = sys.argv[0] + sys.argv[0] = "./foo/bar" + self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1", + prog="splat") + self.assertStdoutEquals(["--version"], "splat 0.1\n") + sys.argv[0] = oldargv + + def test_version_with_prog_attribute(self): + oldargv = sys.argv[0] + sys.argv[0] = "./foo/bar" + self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1") + self.parser.prog = "splat" + self.assertStdoutEquals(["--version"], "splat 0.1\n") + sys.argv[0] = oldargv + def test_no_version(self): self.parser = OptionParser(usage=SUPPRESS_USAGE) From montanaro at users.sourceforge.net Thu Apr 1 08:44:39 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu Apr 1 08:56:32 2004 Subject: [Python-checkins] python/nondist/peps pep-0318.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16980 Modified Files: pep-0318.txt Log Message: Add Guido's proposal and patch. Index: pep-0318.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0318.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0318.txt 31 Mar 2004 18:19:22 -0000 1.9 --- pep-0318.txt 1 Apr 2004 13:44:35 -0000 1.10 *************** *** 142,146 **** =================== ! A few other syntaxes have been proposed:: def func(arg1, arg2, ...) as dec1, dec2, ...: --- 142,146 ---- =================== ! Several other syntaxes have been proposed:: def func(arg1, arg2, ...) as dec1, dec2, ...: *************** *** 192,195 **** --- 192,209 ---- it would require the introduction of a new keyword. + Guido proposed and implementated a patch to support interpretation of + a `list of decorators`_ as a prefix to function definitions :: + + [dec1, dec2, ...] + def foo(arg1, arg2, ...): + pass + + This appears to be his current favorite, but negative sentiment runs + high, mostly because that syntax, though useless except for side + effects of the list, is already legal and thus creates a special case. + + .. _list of decorators: + http://python.org/sf/926860 + Current Implementation From fdrake at users.sourceforge.net Thu Apr 1 11:38:47 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 1 11:50:42 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libsgmllib.tex, 1.22.36.1, 1.22.36.2 libxmllib.tex, 1.33.26.1, 1.33.26.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21713/lib Modified Files: Tag: release23-maint libsgmllib.tex libxmllib.tex Log Message: remove workarounds to prevent "--" in code from being improperly munged to single hyphens in the HTML output; this is no longer needed now that ../perl/python.perl makes things just work Index: libsgmllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsgmllib.tex,v retrieving revision 1.22.36.1 retrieving revision 1.22.36.2 diff -C2 -d -r1.22.36.1 -r1.22.36.2 *** libsgmllib.tex 18 Dec 2003 06:03:53 -0000 1.22.36.1 --- libsgmllib.tex 1 Apr 2004 16:38:44 -0000 1.22.36.2 *************** *** 34,40 **** \item ! SGML comments of the form \samp{}. Note that spaces, tabs, and newlines are allowed between the trailing ! \samp{>} and the immediately preceding \samp{-\code{-}}. \end{itemize} --- 34,40 ---- \item ! SGML comments of the form \samp{}. Note that spaces, tabs, and newlines are allowed between the trailing ! \samp{>} and the immediately preceding \samp{--}. \end{itemize} *************** *** 141,146 **** This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters ! themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. The default method does nothing. --- 141,146 ---- This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters ! themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. The default method does nothing. Index: libxmllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmllib.tex,v retrieving revision 1.33.26.1 retrieving revision 1.33.26.2 diff -C2 -d -r1.33.26.1 -r1.33.26.2 *** libxmllib.tex 18 Dec 2003 06:11:37 -0000 1.33.26.1 --- libxmllib.tex 1 Apr 2004 16:38:44 -0000 1.33.26.2 *************** *** 167,172 **** This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters ! themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. The default method does nothing. --- 167,172 ---- This method is called when a comment is encountered. The \var{comment} argument is a string containing the text between the ! \samp{} delimiters, but not the delimiters ! themselves. For example, the comment \samp{} will cause this method to be called with the argument \code{'text'}. The default method does nothing. From rhettinger at users.sourceforge.net Fri Apr 2 01:09:59 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Apr 2 01:22:00 2004 Subject: [Python-checkins] python/nondist/sandbox/statistics statistics.py, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/statistics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8241 Modified Files: statistics.py Log Message: Have mean() track the sum using floating point. Index: statistics.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/statistics/statistics.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** statistics.py 8 Mar 2004 18:59:43 -0000 1.11 --- statistics.py 2 Apr 2004 06:09:45 -0000 1.12 *************** *** 35,46 **** cnt = len(data) # do it the fast way if possible except TypeError: ! cum = 0 for cnt, elem in enumerate(data): cum += elem cnt += 1 # enumerate counts from zero else: ! cum = sum(data) try: ! return cum / cnt # relies on true division except ZeroDivisionError: raise ValueError('data must have at least one element') --- 35,46 ---- cnt = len(data) # do it the fast way if possible except TypeError: ! cum = 0.0 for cnt, elem in enumerate(data): cum += elem cnt += 1 # enumerate counts from zero else: ! cum = sum(data, 0.0) try: ! return cum / cnt except ZeroDivisionError: raise ValueError('data must have at least one element') From rhettinger at users.sourceforge.net Fri Apr 2 02:46:05 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Apr 2 02:58:09 2004 Subject: [Python-checkins] python/nondist/sandbox/collections pairing_heap.py, NONE, 1.1 pairing_heap_test.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21444 Added Files: pairing_heap.py pairing_heap_test.py Log Message: Add Dan Stutzbach's first pass at paired heaps (after modifying his test suite to use unittests). The pure python version is being used to work out API issues, develop thorough tests, and to tease out implementation issues. Ultimately, this will be added as collections.heap --- NEW FILE: pairing_heap.py --- #!/usr/bin/python """ Note: this implementation is not currently thread-safe. The code in this file implements a pairing heap. By default it operates as a min-heap, but it can also work as a max-heap via a flag passed to the heap's __init__ routing. The important papers on pairing heaps are these: [1] Michael L. Fredman, Robert Sedjewick, Daniel D. Sleator, and Robert E. Tarjan. The Pairing Heap: A New Form of Self-Adjusting Heap. Algorithmica 1:111-129, 1986. [2] John T. Stasko and Jeffrey Scott Vitter. Pairing heaps: experiments and analysis. Communications of the ACM, Volume 30, Issue 3, Pages 234-249, 1987. [3] Michael L. Fredman. On the efficiency of pairing heaps and related data structures. Journal of the ACM, Volume 46, Issue 4, Pages 473-501, 1999. There are actually several varieties of pairing heaps. Five are described in [1], and two more are described in [2]. This implementation is the basic pairing heaps described in [1], also known as the twopass variant. There isn't much published evidence that any of the variants are significantly better than the others. The twopass pairing heap works as follows. A pairing heap is a tree that maintains the heap property: each node has a lower value than all its children. The pairing heap tree need not be binary nor balanced. The good amortized efficiency of the pairing heap results from clever algorithms for .adjust_key() and .delete(). The basic operation in the pairing heap is the comparison-link. Two nodes are compared, and the largest is linked as a child of the smaller. To represent the tree, each node maintains a pointer to the leftmost child and to its right sibling. Each node also maintains a pointer to its parent. When a comparison-link is performed, the new child becomes the leftmost child. [1] suggests a memory optimization where only the right-most sibling stores a pointer to the parent, and each node maintains a single bit indicating if it is that rightmost sibling. This theoretically saves the size of a pointer in each node, but only if we can store a bit for free. However, storing a bit takes just as much space as storing a pointer, due to padding. So, we bite the bullet and store the pointer. Also, [3] shows that the amortized cost of .adjust_key() is at least Omega(log log n) if the parent pointer is *not* stored. The amortized cost may be better using the parent pointer. For .adjust_key(), the topmost element is removed and set aside as the return value. A left-to-right pass is made over its children, comparison-linking them pairwise. For example, if there are 6 children labeled A, B, C, D, E, and F, A and B will be comparison-linked, as will C and D, and E and F. Next, the rightmost node is repeatedly comparison-linked with its sibling until there is only one node left. This node is the new root. For .delete(), first the node is cut from its parent. This results in a tree rooted at the node being deleted. The .adjust_key() procedure is invoked on the node, then the resulting tree is comparison-linked with the original tree. See [1] for more details. It also includes figures which are helpful for understanding. """ class WrongHeap (Exception): """The user attempted to .delete() or .adjust() from the wrong heap. This can also occur if the user attempts to delete or adjust a node that has already been removed from the heap. """ def __str__(self): return 'WrongHeap' class Underflow (Exception): "The user attempted to .peek() or extract() from an empty heap." def __str__(self): return 'Underflow' class IncompatibleHeaps (Exception): "The user attempted to meld heaps that have different compare operations." def __str__(self): return 'IncompatibleHeaps' class InternalError (Exception): "This should never get raised in practice." def __str__(self): return 'InternalError' class WrongAdjustKeyDirection (Exception): "The user attempted to adjust a key in the wrong direction." def __str__(self): return 'WrongAdjustKeyDirection' class heap_node: """This class is used internally to implement the heap. Users will have be able to see references to this data structure, as this is neccessary so they can pass the reference to the .adjust_key() and .delete() methods. However, the data structure should be considered opaque. The only public methods are .value() and .values(). Users should not instantiate heap_node on their own. In the C implementation, all of this will be enforced. """ __slots__ = ('_item', '_child', '_sibling', '_parents') def __init__(self, item): self._item = item self._clean() def value(self): "Return the value associated with this node." return self._item def _clean(self): self._child = None self._sibling = None self._parent = None def _add_child(self, node): node._parent = self node._sibling = self._child self._child = node def _cut(self): "Remove this node and its children from this node's parent." n = self._parent if id(n._child) == id(self): n._child = self._sibling else: n = n._child try: while id(n._sibling) != id(self): n = n._sibling n._sibling = self._sibling except AttributeError: raise InternalError self._parent = None self._sibling = None def _extract(self, heap): "Link this node's children as a prelude to this node's removal" # Make the left-to-right pairing pass children = [] n = self._child while n and n._sibling: next = n._sibling._sibling pair = n._sibling n._parent = None n._sibling = None pair._parent = None pair._sibling = None children.append(heap._link(n, pair)) n = next if n: children.append(n) if not children: return None # Repeated comparison-link to the rightmost node root = children[-1] for i in range(len(children)-2,-1,-1): root = heap._link(root, children[i]) root._parent = None # Return the new root return root def values(self): "Return an unsorted sequence of the values of this part of the tree." rv = [self._item,] if self._child: rv += self._child.values() if self._sibling: rv += self._sibling.values() return rv class pairing_heap: "Implements a min-heap using the pairing-heap algorithm." def __init__(self, values=None, cmpfunc=None, key=None, reverse=False): self._cmpfunc = cmpfunc self._key = key self._reverse = reverse self._root = None self._len = 0 if values is not None: for i in values: self.insert(i) def empty(self): "True if there is nothing in the heap." return self._root is None def peek(self): "Return, but do not remove, the top of the heap." if self._root: return self._root._item else: raise Underflow def __len__(self): "Return the number of items in the heap." return self._len def _cmp(self, item1, item2): "Compare two items using the heap's comparison functions." if self._key: item1 = getattr(item1, self._key) item2 = getattr(item2, self._key) if self._cmpfunc: c = self._cmpfunc(item1, item2) else: c = cmp(item1, item2) if self._reverse: c = -c return c def _link(self, node1, node2): "Perform the comparison-link operation." if not node1: return node2 if not node2: return node1 c = self._cmp(node1._item, node2._item) if c > 0: node2._add_child (node1) return node2 else: node1._add_child (node2) return node1 def insert(self, item): "Insert an item into the heap." node = heap_node(item) self._root = self._link(node, self._root) self._len += 1 return node def meld(self, other): """Merge another heap into this one. other will be an empty heap after completion """ if not isinstance(other, pairing_heap): raise TypeError # Check that these heaps are compatible if self._cmpfunc != other._cmpfunc or self._reverse != other._reverse \ or self._key != other._key: raise IncompatibleHeaps self._root = self._link(other._root, self._root) self._len += other._len # Destroy other other._len = 0 other._root = None def adjust_key(self, node, item): """Adjust the value of node to item. This must be decrease for a min-heap or an increase for a max-heap. If node is not part of this heap, both heaps may become gibberish. """ self._check_heap_node (node) if self._cmp(node._item, item) < 0: raise WrongAdjustKeyDirection node._item = item if id(self._root) == id(node): return # Cut this node out of the tree node._cut() # Link it with the root self._root = self._link(node, self._root) def delete(self, node): """Delete a node from the middle of the heap. If node is not part of this heap, both heaps may become gibberish. """ self._check_heap_node (node) if id(self._root) == id(node): self.extract() return node._cut() self._root = self._link (node._extract(self), self._root) self._len -= 1 node._clean() return node._item def extract(self, n=0): "Extract the top value of the heap." if n > 0: return [self.extract() for i in xrange(n)] if not self._root: raise Underflow old_root = self._root self._root = self._root._extract(self) self._len -= 1 old_root._clean() return old_root._item def extract_all(self): "Empty the heap into a sorted list of all the values" return [self.extract() for i in xrange(self._len)] def values(self): "Return an unsorted list of all the values in the heap" return self._root.values() def _check_heap_node(self, node): """Raise an error if node will cause problems. This function is a simple check to catch certain user errors. It will raise TypeError if node isn't a heap_node object at all. It *may* raise WrongHeap if node isn't part of this heap. It will return if node is part of this heap. However, no guarantees are made about the return value if node is a heap_node, but part of a different heap. """ if not isinstance(node, heap_node): raise TypeError if self._root == node: return if not node._parent: raise WrongHeap return --- NEW FILE: pairing_heap_test.py --- #!/usr/bin/python from pairing_heap import * import random import unittest datasize = 256 class Holder: def __init__(self, item): self.xyzzy = item def check_invariant(heap, node=None): if node == None: node = heap._root if node == None: return True n2 = node._child while n2: if heap._cmp(node._item, n2._item) >= 0: return False check_invariant(heap, n2) n2 = n2._sibling return True # Uncomment to speed things up when doing code-coverage analysis ##def check_invariant(heap, node=None): ## return True class TestPairingHeap(unittest.TestCase): def setUp(self): self.data = [random.random() for i in xrange(datasize)] self.data_sorted = sorted(self.data) def test_random(self): # Push random numbers and pop them off, verifying all's OK. heap = pairing_heap() self.assert_(check_invariant(heap)) for item in self.data: heap.insert(item) self.assert_(check_invariant(heap)) results = [] while not heap.empty(): item = heap.extract() self.assert_(check_invariant(heap)) results.append(item) self.assertEqual(self.data_sorted, results) def test_naive_nbest(self): heap = pairing_heap() for item in self.data: heap.insert(item) if len(heap) > 10: heap.extract() result = heap.extract_all() self.assertEqual(result, self.data_sorted[-10:]) def test_underflow(self): heap = pairing_heap() self.assertRaises(Underflow, heap.extract) self.assertRaises(Underflow, heap.peek) def test_return_unsorted(self): heap = pairing_heap() for item in self.data: heap.insert(item) self.assertEqual(set(heap.values()), set(self.data)) def test_implicit_creation_and_peek(self): heap = pairing_heap(self.data) self.assert_(check_invariant(heap)) self.assertEqual(heap.peek(), self.data_sorted[0]) self.assert_(check_invariant(heap)) result = heap.extract_all() self.assertEqual(result, self.data_sorted) def test_extract_with_arg(self): heap = pairing_heap(self.data) low10 = heap.extract(10) self.assert_(check_invariant(heap)) self.assertEqual(low10, self.data_sorted[:10]) def test_deleting_from_the_middle(self): heap = pairing_heap() nodes = [heap.insert(item) for item in self.data] data2 = self.data[:] count = 0 for i in xrange(datasize-1,-1,-5): heap.delete(nodes[i]) del nodes[i] self.assert_(check_invariant(heap)) count += 1 self.assertEqual(datasize-count, len(heap)) del data2[i] result = heap.extract_all() data2_sorted = data2[:] data2_sorted.sort() self.assertEqual(data2_sorted, result) def test_deleting_everything_in_random_order(self): heap = pairing_heap() nodes = [heap.insert(item) for item in self.data] for i in xrange(datasize): t = random.randrange(len(heap)) heap.delete(nodes[t]) del nodes[t] self.assert_(check_invariant(heap)) self.assert_(heap.empty()) def test_adjust_key(self): heap = pairing_heap() nodes = [heap.insert(item) for item in self.data] data2 = [] for i in xrange(datasize): data2.append(min(self.data[i], random.random())) idx = range(datasize) random.shuffle(idx) for i in idx: heap.adjust_key(nodes[i], data2[i]) self.assert_(check_invariant(heap)) self.assertEqual(sorted(data2), heap.extract_all()) def test_build_tree_by_melding(self): heap = pairing_heap() i = 0 while i < datasize: j = max(random.randrange(min(datasize - i, 5)), 1) heap2 = pairing_heap(self.data[i:i+j]) i += j heap.meld(heap2) self.assert_(check_invariant(heap)) self.assertEqual(self.data_sorted, heap.extract_all()) def test_cmpfunc(self): reverse = lambda x, y: -cmp(x,y) heap = pairing_heap(self.data, cmpfunc=reverse) self.assertEqual(sorted(self.data, reverse=True), heap.extract_all()) def test_reverse(self): heap = pairing_heap(self.data, reverse=True) self.assertEqual(sorted(self.data, reverse=True), heap.extract_all()) def test_cmpfunc_with_reverse(self): reverse = lambda x, y: -cmp(x,y) heap = pairing_heap(self.data, cmpfunc=reverse, reverse=True) self.assertEqual(self.data_sorted, heap.extract_all()) def test_key(self): holders = [Holder(item) for item in self.data] heap = pairing_heap(holders, key='xyzzy') results = heap.extract_all() self.assertEqual(self.data_sorted,[item.xyzzy for item in results]) def test_extract_values_from_nodes(self): heap = pairing_heap() nodes = [heap.insert(datum) for datum in self.data] for i in xrange(len(nodes)): self.assertEqual(nodes[i].value(), self.data[i]) self.assert_(check_invariant(heap)) def test_meld_with_incompatible_heap(self): heap1 = pairing_heap() reverse = lambda x, y: -cmp(x,y) self.assertRaises(IncompatibleHeaps, heap1.meld, pairing_heap(cmpfunc = reverse)) self.assertRaises(IncompatibleHeaps, heap1.meld, pairing_heap(reverse = True)) self.assertRaises(IncompatibleHeaps, heap1.meld, pairing_heap(key = 'xyzzy')) def test_adj_key_wrong_direction(self): heap = pairing_heap () nodes = [heap.insert(datum) for datum in range(5)] self.assertRaises(WrongAdjustKeyDirection, heap.adjust_key, nodes[4], 100) def test_adjust_key_on_existing_root(self): heap = pairing_heap () data = self.data nodes = [heap.insert(datum) for datum in data] low = 0 for i in xrange(1, len(data)): if data[i] == data[low]: low_list.append (i) if data[i] < data[low]: low = i low_list = [i] for i in low_list: heap.adjust_key(nodes[i], data[i] - random.random()) def test_bogus_node_parameter(self): heap = pairing_heap () nodes = [heap.insert(datum) for datum in self.data] self.assertRaises(TypeError, heap.adjust_key, "muhahahah!", 5) self.assert_(check_invariant(heap)) self.assertRaises(TypeError, heap.delete, "muhahahah!") def test_semibogus_node_parameter(self): holders = [Holder(item) for item in self.data] heap = pairing_heap(key='xyzzy') nodes = [heap.insert(datum) for datum in holders] for i in xrange(len(holders)): holders[i].node = nodes[i] top = heap.extract () self.assertRaises(WrongHeap, heap.delete, top.node) self.assert_(check_invariant(heap)) if __name__ == '__main__': suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestPairingHeap)) unittest.TextTestRunner(verbosity=2).run(suite) From montanaro at users.sourceforge.net Fri Apr 2 09:51:16 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Apr 2 10:03:21 2004 Subject: [Python-checkins] python/dist/src/Misc gdbinit,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3355 Modified Files: gdbinit Log Message: include local variables when dumping Python stack trace Index: gdbinit =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/gdbinit,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gdbinit 1 Mar 2004 15:44:05 -0000 1.4 --- gdbinit 2 Apr 2004 14:51:13 -0000 1.5 *************** *** 27,39 **** end - # If you are in an eval_frame() function, calling pyframe with no - # arguments will print the filename, function name, and line number. - # It assumes that f is the name of the current frame. - define pyframe - x/s ((PyStringObject*)f->f_code->co_filename)->ob_sval - x/s ((PyStringObject*)f->f_code->co_name)->ob_sval - p f->f_lineno - end - # Here's a somewhat fragile way to print the entire Python stack from gdb. # It's fragile because the tests for the value of $pc depend on the layout --- 27,30 ---- *************** *** 47,50 **** --- 38,77 ---- # statement tests to see if we are in eval_frame(). + # print the local variables of the current frame + define pylocals + set $_i = 0 + while $_i < f->f_nlocals + if f->f_localsplus + $_i != 0 + set $_names = co->co_varnames + set $_name = PyString_AsString(PyTuple_GetItem($_names, $_i)) + printf "%s:\n", $_name + # side effect of calling _PyObject_Dump is to dump the object's + # info - assigning just prevents gdb from printing the + # NULL return value + set $_val = _PyObject_Dump(f->f_localsplus[$_i]) + end + set $_i = $_i + 1 + end + end + + # print the current frame + define pyframe + set $__fn = PyString_AsString(co->co_filename) + set $__n = PyString_AsString(co->co_name) + printf "%s (%d): %s\n", $__fn, f->f_lineno, $__n + pylocals + end + + # print the entire Python call stack + define pystack + while $pc < Py_Main || $pc > Py_GetArgcArgv + if $pc > eval_frame && $pc < PyEval_EvalCodeEx + pyframe + end + up-silently 1 + end + select-frame 0 + end + define pystack while $pc < Py_Main || $pc > Py_GetArgcArgv From montanaro at users.sourceforge.net Fri Apr 2 09:54:03 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Apr 2 10:06:07 2004 Subject: [Python-checkins] python/dist/src/Misc gdbinit,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3944 Modified Files: gdbinit Log Message: It would help if I deleted the old pystack! Also, move pystack comment down next to it Index: gdbinit =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/gdbinit,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gdbinit 2 Apr 2004 14:51:13 -0000 1.5 --- gdbinit 2 Apr 2004 14:53:55 -0000 1.6 *************** *** 27,41 **** end - # Here's a somewhat fragile way to print the entire Python stack from gdb. - # It's fragile because the tests for the value of $pc depend on the layout - # of specific functions in the C source code. - - # Explanation of while and if tests: We want to pop up the stack until we - # land in Py_Main (this is probably an incorrect assumption in an embedded - # interpreter, but the test can be extended by an interested party). If - # Py_Main <= $pc <= Py_GetArgcArv is true $pc is in Py_Main(), so the while - # tests succeeds as long as it's not true. In a similar fashion the if - # statement tests to see if we are in eval_frame(). - # print the local variables of the current frame define pylocals --- 27,30 ---- *************** *** 63,66 **** --- 52,66 ---- end + # Here's a somewhat fragile way to print the entire Python stack from gdb. + # It's fragile because the tests for the value of $pc depend on the layout + # of specific functions in the C source code. + + # Explanation of while and if tests: We want to pop up the stack until we + # land in Py_Main (this is probably an incorrect assumption in an embedded + # interpreter, but the test can be extended by an interested party). If + # Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while + # tests succeeds as long as it's not true. In a similar fashion the if + # statement tests to see if we are in eval_frame(). + # print the entire Python call stack define pystack *************** *** 73,86 **** select-frame 0 end - - define pystack - while $pc < Py_Main || $pc > Py_GetArgcArgv - if $pc > eval_frame && $pc < PyEval_EvalCodeEx - set $__fn = PyString_AsString(co->co_filename) - set $__n = PyString_AsString(co->co_name) - printf "%s (%d): %s\n", $__fn, f->f_lineno, $__n - end - up-silently 1 - end - select-frame 0 - end --- 73,74 ---- From goodger at users.sourceforge.net Fri Apr 2 14:20:21 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Fri Apr 2 14:32:31 2004 Subject: [Python-checkins] python/nondist/peps pep2html.py,1.50,1.51 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22283 Modified Files: pep2html.py Log Message: changes from Docutils project: reformatted docstring/help; send -h/--help output to stdout not stderr; enable exception tracebacks from Docutils; improved version checking Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** pep2html.py 13 Nov 2002 01:36:44 -0000 1.50 --- pep2html.py 2 Apr 2004 19:20:13 -0000 1.51 *************** *** 2,36 **** """Convert PEPs to (X)HTML - courtesy of /F ! Usage: %(PROGRAM)s [options] [peps] Options: ! -u/--user ! python.org username ! -b/--browse ! After generating the HTML, direct your web browser to view it ! (using the Python webbrowser module). If both -i and -b are ! given, this will browse the on-line HTML; otherwise it will ! browse the local HTML. If no pep arguments are given, this ! will browse PEP 0. ! -i/--install ! After generating the HTML, install it and the plaintext source file ! (.txt) on python.org. In that case the user's name is used in the scp ! and ssh commands, unless "-u username" is given (in which case, it is ! used instead). Without -i, -u is ignored. ! -l/--local ! Same as -i/--install, except install on the local machine. Use this ! when logged in to the python.org machine (creosote). ! -q/--quiet ! Turn off verbose messages. ! -h/--help ! Print this help message and exit. ! The optional argument `peps' is a list of either pep numbers or .txt files. """ --- 2,36 ---- """Convert PEPs to (X)HTML - courtesy of /F ! Usage: %(PROGRAM)s [options] [ ...] Options: ! -u, --user ! python.org username ! -b, --browse ! After generating the HTML, direct your web browser to view it ! (using the Python webbrowser module). If both -i and -b are ! given, this will browse the on-line HTML; otherwise it will ! browse the local HTML. If no pep arguments are given, this ! will browse PEP 0. ! -i, --install ! After generating the HTML, install it and the plaintext source file ! (.txt) on python.org. In that case the user's name is used in the scp ! and ssh commands, unless "-u username" is given (in which case, it is ! used instead). Without -i, -u is ignored. ! -l, --local ! Same as -i/--install, except install on the local machine. Use this ! when logged in to the python.org machine (creosote). ! -q, --quiet ! Turn off verbose messages. ! -h, --help ! Print this help message and exit. ! The optional arguments ``peps`` are either pep numbers or .txt files. """ *************** *** 82,88 **** def usage(code, msg=''): ! print >> sys.stderr, __doc__ % globals() if msg: ! print >> sys.stderr, msg sys.exit(code) --- 82,93 ---- def usage(code, msg=''): ! """Print usage message and exit. Uses stderr if code != 0.""" ! if code == 0: ! out = sys.stdout ! else: ! out = sys.stderr ! print >> out, __doc__ % globals() if msg: ! print >> out, msg sys.exit(code) *************** *** 303,307 **** parser_name='restructuredtext', writer_name='pep_html', ! settings=docutils_settings) outfile.write(output) --- 308,314 ---- parser_name='restructuredtext', writer_name='pep_html', ! settings=docutils_settings, ! # Allow Docutils traceback if there's an exception: ! settings_overrides={'traceback': 1}) outfile.write(output) *************** *** 424,428 **** 'See README.txt for installation.') else: ! if docutils.__version__ < REQUIRES['docutils']: PEP_TYPE_DISPATCH['text/x-rst'] = None PEP_TYPE_MESSAGES['text/x-rst'] = ( --- 431,437 ---- 'See README.txt for installation.') else: ! installed = [int(part) for part in docutils.__version__.split('.')] ! required = [int(part) for part in REQUIRES['docutils'].split('.')] ! if installed < required: PEP_TYPE_DISPATCH['text/x-rst'] = None PEP_TYPE_MESSAGES['text/x-rst'] = ( From Irwin at lookingforamate.com Fri Apr 2 18:37:04 2004 From: Irwin at lookingforamate.com (Demetrius Frey) Date: Fri Apr 2 20:41:32 2004 Subject: [Python-checkins] You have been setup on a date.. Message-ID: Interested in a blind-date that has been pre-arranged by a mutual friend? Click here to confirm: http://meetingamateonline.com/confirm/?oc=50799996 Click here if you do not wish to be invited again: http://meetingamateonline.com/remove/?oc=50799996 From facundobatista at users.sourceforge.net Fri Apr 2 21:15:24 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Fri Apr 2 21:27:36 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.15, 1.16 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1582 Modified Files: Decimal.py Log Message: Added from_float static method. Several fixes. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Decimal.py 9 Mar 2004 02:44:59 -0000 1.15 --- Decimal.py 3 Apr 2004 02:15:21 -0000 1.16 *************** *** 47,53 **** >>> print Decimal(3).sqrt() 1.73205080756887729 ! ### This example doesn't work yet ! ###>>> print Decimal(3) ** 123 ! ###4.85192780976896427E+58 >>> inf = Decimal(1) / Decimal(0) >>> print inf --- 47,52 ---- >>> print Decimal(3).sqrt() 1.73205080756887729 ! >>> print Decimal(3) ** 123 ! 4.85192780976896427E+58 >>> inf = Decimal(1) / Decimal(0) >>> print inf *************** *** 97,100 **** --- 96,101 ---- """ + # 0.7.2 2003.4.02 facundobatista: Fixed __pow__ to run the example ok. Added + # from_float method. Fixed isnan to accept empty strings. # 0.7.1 2003.3.08 facundobatista: Corrected initial examples # 0.7.0 2003.2.28 eprice: More changes. Contexts done nicely, exponent limits *************** *** 474,492 **** return ! if isinstance(value, float): ! # Another possibility would be: ! # self._convertString(_floatToString(value), context) ! # ! # This would give a more strictly accurate representation, ! # but probably isn't what is really meant (Decimal(1.1) != ! # Decimal('1.1') this way, but is instead Decimal(\ ! # '1100000000000000088817841970012523233890533447265625e-51') ! # The extra digits really aren't worth anything, since they ! # likely weren't intended. ! self._convertString(str(value), context) ! return ! raise TypeError("Can't convert " + `value`) def _isnan(self): --- 475,506 ---- return ! raise TypeError("Can't convert " + `value`) ! def from_float(cls, value, positions=None, context=None): ! """Static function that creates Decimal from float ! value must be float ! if positions is present, rounds to that quantity of decimal places ! """ ! if not isinstance(value, float): ! raise TypeError, "value must be float in Decimal.from_float(value, [positions])" ! if context is None: ! context = getcontext() ! ! # get the *very* exact string representation of the float ! string_number = _floatToString(value) ! d = cls(string_number) ! ! # round up to positions ! if positions is not None: ! if not isinstance(positions, (int,long)): ! raise TypeError, "positions must be int or long in Decimal.from_float(value, [positions])" ! if positions < 0: ! raise TypeError, "positions must be not negative in Decimal.from_float(value, [positions])" ! # d = d.fix(positions) ! d = d.round(positions, ROUND_HALF_UP) ! ! return d ! from_float = classmethod(from_float) def _isnan(self): *************** *** 1677,1680 **** --- 1691,1697 ---- context = getcontext() + if not isinstance(n, Decimal): + n = Decimal(n) + #Because the spot << doesn't work with really big exponents if n._isinfinity() or n.adjusted() > 8: *************** *** 2583,2586 **** --- 2600,2605 ---- if isinstance(num, float): num = str(num) + if len(num) == 0: + return 0 num = num.lower() From facundobatista at users.sourceforge.net Fri Apr 2 21:16:06 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Fri Apr 2 21:28:17 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal test_Decimal.py, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1741 Modified Files: test_Decimal.py Log Message: Adjusted explicit construction test cases. Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_Decimal.py 28 Mar 2004 15:39:38 -0000 1.12 --- test_Decimal.py 3 Apr 2004 02:16:03 -0000 1.13 *************** *** 15,18 **** --- 15,19 ---- """ + # 0.1.5 2003.04.02 fb: Adjusted explicit construction test cases. # 0.1.4 2003.03.28 fb: Added Use of Context and Decimal Usability test cases. # Corrected tests using try/except/else. *************** *** 504,508 **** #empty ! self.assertRaises(ValueError, Decimal, '') #int --- 505,510 ---- #empty ! d = Decimal('') ! self.assertEqual(str(d), 'NaN') #int *************** *** 519,523 **** #just not a number ! self.assertRaises(ValueError, Decimal, 'ugly') def test_from_float(self): --- 521,526 ---- #just not a number ! d = Decimal('ugly') ! self.assertEqual(str(d), 'NaN') def test_from_float(self): *************** *** 537,541 **** #empty ! self.assertRaises(ValueError, Decimal.from_float, '') #with a string --- 540,544 ---- #empty ! self.assertRaises(TypeError, Decimal.from_float) #with a string *************** *** 545,563 **** self.assertRaises(TypeError, Decimal.from_float, 5) - #exact float - d = Decimal.from_float(32.32) - self.assertEqual(str(d), '32.32') - #inexact float, without positions d = Decimal.from_float(2.2) ! self.assertEqual(str(d), '220000000000000017763568394002504646778106689453125e-50') ! #inexact float, without some positions ! d = Decimal.from_float(2.2, 16) self.assertEqual(str(d), '2.2000000000000002') ! #inexact float, without less positions d = Decimal.from_float(2.2, 5) ! self.assertEqual(str(d), '2.2') def test_from_tuples(self): --- 548,562 ---- self.assertRaises(TypeError, Decimal.from_float, 5) #inexact float, without positions d = Decimal.from_float(2.2) ! self.assertEqual(str(d), '2.20000000000000017763568394002504646778106689453125') ! #inexact float, rounded to some positions ! d = Decimal.from_float(2.2, 17) self.assertEqual(str(d), '2.2000000000000002') ! #inexact float, rounded to less positions d = Decimal.from_float(2.2, 5) ! self.assertEqual(str(d), '2.20000') def test_from_tuples(self): From goodger at users.sourceforge.net Sat Apr 3 10:02:49 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sat Apr 3 10:15:04 2004 Subject: [Python-checkins] python/nondist/peps pep-0328.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16111 Modified Files: pep-0328.txt Log Message: update from Aahz Index: pep-0328.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0328.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0328.txt 31 Jan 2004 05:19:25 -0000 1.2 --- pep-0328.txt 3 Apr 2004 15:02:46 -0000 1.3 *************** *** 3,13 **** Version: $Revision$ Last-Modified: $Date$ ! Author: Aahz ! Status: Accepted Type: Standards Track Python-Version: 2.4 Content-Type: text/x-rst Created: 21-Dec-2003 ! Post-History: 8-Mar-2004 *************** *** 40,45 **** * Write a long line with backslash continuations:: ! from Tkinter import Tk, Frame, Button, Entry, Canvas, Text \ ! LEFT, DISABLED, NORMAL, RIDGE, END * Write multiple ``import`` statements:: --- 40,45 ---- * Write a long line with backslash continuations:: ! from Tkinter import Tk, Frame, Button, Entry, Canvas, Text, \ ! LEFT, DISABLED, NORMAL, RIDGE, END * Write multiple ``import`` statements:: *************** *** 53,57 **** mechanism (parentheses) to write the ``import`` statement:: ! from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text LEFT, DISABLED, NORMAL, RIDGE, END) --- 53,57 ---- mechanism (parentheses) to write the ``import`` statement:: ! from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text, LEFT, DISABLED, NORMAL, RIDGE, END) *************** *** 102,110 **** * One from Guido:: ! from .foo import and :: ! from ...foo import These two forms have a couple of different suggested semantics. One --- 102,110 ---- * One from Guido:: ! from .foo import bar and :: ! from ...foo import bar These two forms have a couple of different suggested semantics. One *************** *** 119,122 **** --- 119,129 ---- parent gets hit".) + Some people have suggested other punctuation as the separator, such + as "-" or "^". + + Some people have suggested using "*":: + + from *.foo import bar + * The next set of options is conflated from several posters:: *************** *** 131,134 **** --- 138,161 ---- shorter option. + * One suggestion was to allow only sibling references. In other words, + you would not be able to use relative imports to refer to modules + higher in the package tree. You would then be able to do either :: + + from .spam import eggs + + or :: + + import .spam.eggs + + * Some people favor allowing indexed parents:: + + from -2.spam import eggs + + In this scenario, importing from the current directory would be a + simple :: + + from .spam import eggs + + * Finally, some people dislike the way you have to change ``import`` to ``from ... import`` when you want to dig inside a package. They *************** *** 161,170 **** ! Open Issues ! =========== ! The BDFL needs to decide which of the various options for relative ! imports works best. Additional proposals are still welcome. As ! usual, Guido prefers reasons to histrionics. --- 188,196 ---- ! Guido's Decision ! ================ ! Guido has Pronounced [1]_ that relative imports will use leading dots, ! one per level of parent. *************** *** 186,189 **** --- 212,217 ---- `__ + .. [1] http://mail.python.org/pipermail/python-dev/2004-March/043739.html + Copyright From nnorwitz at users.sourceforge.net Sat Apr 3 13:02:41 2004 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Sat Apr 3 13:15:00 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libsocket.tex,1.80,1.81 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13801 Modified Files: libsocket.tex Log Message: #928751, fix typos in socket doc Index: libsocket.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsocket.tex,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** libsocket.tex 27 Jan 2004 18:21:26 -0000 1.80 --- libsocket.tex 3 Apr 2004 18:02:37 -0000 1.81 *************** *** 448,453 **** above.) \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a ! tuple. This was never intentional and is no longer be available in ! Python 2.0.} \end{methoddesc} --- 448,453 ---- above.) \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a ! tuple. This was never intentional and is no longer available in ! Python 2.0 and later.} \end{methoddesc} *************** *** 476,480 **** \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a tuple. ! This was never intentional and is no longer be available in Python 2.0 and later.} \end{methoddesc} --- 476,480 ---- \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a tuple. ! This was never intentional and is no longer available in Python 2.0 and later.} \end{methoddesc} From nnorwitz at users.sourceforge.net Sat Apr 3 13:03:53 2004 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Sat Apr 3 13:16:07 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libsocket.tex, 1.76, 1.76.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13996 Modified Files: Tag: release23-maint libsocket.tex Log Message: #928751, fix typos in socket doc Index: libsocket.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsocket.tex,v retrieving revision 1.76 retrieving revision 1.76.6.1 diff -C2 -d -r1.76 -r1.76.6.1 *** libsocket.tex 20 Jul 2003 01:10:15 -0000 1.76 --- libsocket.tex 3 Apr 2004 18:03:51 -0000 1.76.6.1 *************** *** 446,451 **** above.) \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a ! tuple. This was never intentional and is no longer be available in ! Python 2.0.} \end{methoddesc} --- 446,451 ---- above.) \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a ! tuple. This was never intentional and is no longer available in ! Python 2.0 and later.} \end{methoddesc} *************** *** 474,478 **** \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a tuple. ! This was never intentional and is no longer be available in Python 2.0 and later.} \end{methoddesc} --- 474,478 ---- \note{This method has historically accepted a pair of parameters for \constant{AF_INET} addresses instead of only a tuple. ! This was never intentional and is no longer available in Python 2.0 and later.} \end{methoddesc} From goodger at users.sourceforge.net Sat Apr 3 21:37:36 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sat Apr 3 21:49:57 2004 Subject: [Python-checkins] python/nondist/peps pep-0309.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30904 Modified Files: pep-0309.txt Log Message: Accepted by Gvr 2004-03-31 Index: pep-0309.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0309.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0309.txt 28 Feb 2004 19:09:16 -0000 1.5 --- pep-0309.txt 4 Apr 2004 02:37:34 -0000 1.6 *************** *** 4,8 **** Last-Modified: $Date$ Author: Peter Harris ! Status: Draft Type: Standards Track Content-Type: text/x-rst --- 4,8 ---- Last-Modified: $Date$ Author: Peter Harris ! Status: Accepted Type: Standards Track Content-Type: text/x-rst From goodger at users.sourceforge.net Sat Apr 3 21:38:00 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sat Apr 3 21:50:18 2004 Subject: [Python-checkins] python/nondist/peps pep-0328.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30973 Modified Files: pep-0328.txt Log Message: update from Aahz Index: pep-0328.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0328.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0328.txt 3 Apr 2004 15:02:46 -0000 1.3 --- pep-0328.txt 4 Apr 2004 02:37:57 -0000 1.4 *************** *** 6,10 **** Status: Accepted Type: Standards Track ! Python-Version: 2.4 Content-Type: text/x-rst Created: 21-Dec-2003 --- 6,10 ---- Status: Accepted Type: Standards Track ! Python-Version: 2.4, 2,5, 2.6 Content-Type: text/x-rst Created: 21-Dec-2003 *************** *** 22,33 **** * Imports can be ambiguous in the face of packages; within a package, it's not clear whether ``import foo`` refers to a module within the ! package or some module outside the package. For the first problem, it is proposed that parentheses be permitted to enclose multiple names, thus allowing Python's standard mechanisms for ! multi-line values to apply. For the second problem, it is proposed ! that all ``import`` statements be absolute by default (more precisely, ! relative to ``sys.path``) with special syntax for accessing ! package-relative imports. --- 22,49 ---- * Imports can be ambiguous in the face of packages; within a package, it's not clear whether ``import foo`` refers to a module within the ! package or some module outside the package. (More precisely, a local ! module or package can shadow another hanging directly off ! ``sys.path``.) For the first problem, it is proposed that parentheses be permitted to enclose multiple names, thus allowing Python's standard mechanisms for ! multi-line values to apply. For the second problem, it is proposed that ! all ``import`` statements be absolute by default (searching ``sys.path`` ! only) with special syntax (leading dots) for accessing package-relative ! imports. ! ! ! Timeline ! ======== ! ! In Python 2.4, you must enable the new absolute import behavior with :: ! ! from __future__ import absolute_import ! ! You may use relative imports freely. In Python 2.5, any ``import`` ! statement that results in an intra-package import will generate a ! ``PendingDeprecation`` warning (this also applies to ``from <> import`` ! that fails to use the relative import syntax). In Python 2.6, ``import`` ! will always be an absolute import. *************** *** 189,196 **** Guido's Decision ! ================ Guido has Pronounced [1]_ that relative imports will use leading dots, ! one per level of parent. --- 205,241 ---- Guido's Decision ! ---------------- Guido has Pronounced [1]_ that relative imports will use leading dots, ! one per level of parent. Further discussion led to the following ! clarification of the semantics. Given a package layout:: ! ! package ! subpackage1 ! moduleX ! moduleY ! subpackage2 ! moduleZ ! moduleA ! ! Assuming that the current file is ``moduleX.py``, following are correct ! usages of the new syntax:: ! ! from .moduleY import spam ! from .moduleY import spam as ham ! from . import moduleY ! from ..subpackage1 import moduleY ! from ..subpackage2.moduleZ import eggs ! from ..moduleA import foo ! from ...package import bar ! from ...sys import path ! ! Note that while that last case is legal, it is certainly discouraged ! ("insane" was the word Guido used). ! ! Reminder: relative imports must always use ``from <> import``; ! ``import <>`` is always absolute. Of course, absolute imports can use ! ``from <> import`` by omitting the leading dots. ! From goodger at users.sourceforge.net Sat Apr 3 21:39:25 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sat Apr 3 21:51:43 2004 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.268,1.269 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31054 Modified Files: pep-0000.txt Log Message: updated Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.268 retrieving revision 1.269 diff -C2 -d -r1.268 -r1.269 *** pep-0000.txt 28 Feb 2004 19:10:16 -0000 1.268 --- pep-0000.txt 4 Apr 2004 02:39:23 -0000 1.269 *************** *** 64,67 **** --- 64,69 ---- S 253 Subtyping Built-in Types GvR SA 289 Generator Expressions Hettinger + SA 309 Partial Function Application Harris + SA 328 Imports: Multi-Line and Absolute/Relative Aahz Open PEPs (under consideration) *************** *** 110,114 **** S 305 CSV File API Montanaro, et al S 307 Extensions to the pickle protocol GvR, Peters - S 309 Partial Function Application Harris S 310 Reliable Acquisition/Release Pairs Hudson, Moore S 312 Simple Implicit Lambda Suzi, Martelli --- 112,115 ---- *************** *** 116,120 **** S 314 Metadata for Python Software Packages v1.1 Kuchling S 315 Enhanced While Loop Carroll ! S 318 Function/Method Decorator Syntax Smith S 319 Python Synchronize/Asynchronize Block Pelletier S 321 Date/Time Parsing and Formatting Kuchling --- 117,121 ---- S 314 Metadata for Python Software Packages v1.1 Kuchling S 315 Enhanced While Loop Carroll ! S 318 Decorators for Functions, Methods & Classes Smith, et al S 319 Python Synchronize/Asynchronize Block Pelletier S 321 Date/Time Parsing and Formatting Kuchling *************** *** 123,127 **** S 325 Resource-Release Support for Generators Pedroni S 327 Decimal Data Type Batista - S 328 Imports: Multi-Line and Absolute/Relative Aahz S 754 IEEE 754 Floating Point Special Values Warnes --- 124,127 ---- *************** *** 330,334 **** S 307 Extensions to the pickle protocol GvR, Peters SR 308 If-then-else expression GvR, Hettinger ! S 309 Partial Function Application Harris S 310 Reliable Acquisition/Release Pairs Hudson, Moore SF 311 Simplified GIL Acquisition for Extensions Hammond --- 330,334 ---- S 307 Extensions to the pickle protocol GvR, Peters SR 308 If-then-else expression GvR, Hettinger ! SA 309 Partial Function Application Harris S 310 Reliable Acquisition/Release Pairs Hudson, Moore SF 311 Simplified GIL Acquisition for Extensions Hammond *************** *** 339,343 **** SD 316 Programming by Contract for Python Way SR 317 Eliminate Implicit Exception Instantiation Taschuk ! S 318 Function/Method Decorator Syntax Smith S 319 Python Synchronize/Asynchronize Block Pelletier I 320 Python 2.4 Release Schedule Warsaw --- 339,343 ---- SD 316 Programming by Contract for Python Way SR 317 Eliminate Implicit Exception Instantiation Taschuk ! S 318 Decorators for Functions, Methods & Classes Smith, et al S 319 Python Synchronize/Asynchronize Block Pelletier I 320 Python 2.4 Release Schedule Warsaw *************** *** 349,353 **** SR 326 A Case for Top and Bottom Values Carlson, Reedy S 327 Decimal Data Type Batista ! S 328 Imports: Multi-Line and Absolute/Relative Aahz SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes --- 349,353 ---- SR 326 A Case for Top and Bottom Values Carlson, Reedy S 327 Decimal Data Type Batista ! SA 328 Imports: Multi-Line and Absolute/Relative Aahz SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 404,407 **** --- 404,408 ---- Hylton, Jeremy jeremy@zope.com Jansen, Jack jack@cwi.nl + Jewett, Jim jimjjewett@users.sourceforge.net Jones, Richard rjones@ekit-inc.com Koltsov, Stepan yozh@mx1.ru From facundobatista at users.sourceforge.net Sun Apr 4 00:00:17 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Sun Apr 4 00:12:36 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.16, 1.17 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16235 Modified Files: Decimal.py Log Message: Finished from_float method. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Decimal.py 3 Apr 2004 02:15:21 -0000 1.16 --- Decimal.py 4 Apr 2004 05:00:13 -0000 1.17 *************** *** 440,443 **** --- 440,448 ---- if isinstance(value, (int,long)): + # checking that the int or long doesn't exceed precision + max_int = 10 ** context.prec + if value > max_int: + raise ValueError, "Exceeded precision: use a smaller int or a Decimal with more precision" + # converting it self._convertString(str(value), context) return *************** *** 499,503 **** raise TypeError, "positions must be not negative in Decimal.from_float(value, [positions])" # d = d.fix(positions) ! d = d.round(positions, ROUND_HALF_UP) return d --- 504,512 ---- raise TypeError, "positions must be not negative in Decimal.from_float(value, [positions])" # d = d.fix(positions) ! ! # we must know what precision to pass to round ! int_positions = len(d._int) + d._exp ! real_decimal_positions = positions + int_positions ! d = d.round(real_decimal_positions, ROUND_HALF_UP) return d From facundobatista at users.sourceforge.net Sun Apr 4 00:01:06 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Sun Apr 4 00:13:25 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal test_Decimal.py, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16330 Modified Files: test_Decimal.py Log Message: Adjusted implicit and explicit construction test cases. Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_Decimal.py 3 Apr 2004 02:16:03 -0000 1.13 --- test_Decimal.py 4 Apr 2004 05:01:02 -0000 1.14 *************** *** 490,495 **** #very large positive ! d = Decimal(5000000123) ! self.assertEqual(str(d), '5000000123') #negative --- 490,495 ---- #very large positive ! d = Decimal(500000123) ! self.assertEqual(str(d), '500000123') #negative *************** *** 553,557 **** #inexact float, rounded to some positions ! d = Decimal.from_float(2.2, 17) self.assertEqual(str(d), '2.2000000000000002') --- 553,557 ---- #inexact float, rounded to some positions ! d = Decimal.from_float(2.2, 16) self.assertEqual(str(d), '2.2000000000000002') *************** *** 589,595 **** #very large positive ! d = Decimal(5000000123) e = Decimal(d) ! self.assertEqual(str(e), '5000000123') self.assertNotEqual(id(d), id(e)) --- 589,595 ---- #very large positive ! d = Decimal(500000123) e = Decimal(d) ! self.assertEqual(str(e), '500000123') self.assertNotEqual(id(d), id(e)) *************** *** 632,636 **** try: d + 123456789000 ! except TypeError: pass else: --- 632,636 ---- try: d + 123456789000 ! except ValueError: pass else: From aimacintyre at users.sourceforge.net Sun Apr 4 01:58:30 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:10:53 2004 Subject: [Python-checkins] python/dist/src/Objects fileobject.c,2.189,2.190 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30002 Modified Files: fileobject.c Log Message: If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.189 retrieving revision 2.190 diff -C2 -d -r2.189 -r2.190 *** fileobject.c 21 Mar 2004 20:24:07 -0000 2.189 --- fileobject.c 4 Apr 2004 06:58:27 -0000 2.190 *************** *** 313,316 **** --- 313,317 ---- Py_END_ALLOW_THREADS } + PyMem_Free(f->f_setbuf); Py_XDECREF(f->f_name); Py_XDECREF(f->f_mode); *************** *** 359,362 **** --- 360,364 ---- } PyMem_Free(f->f_setbuf); + f->f_setbuf = NULL; if (sts == EOF) return PyErr_SetFromErrno(PyExc_IOError); From aimacintyre at users.sourceforge.net Sun Apr 4 03:00:10 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:12:30 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_file.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30182 Modified Files: test_file.py Log Message: If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak. Index: test_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_file.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_file.py 7 Sep 2003 03:30:16 -0000 1.13 --- test_file.py 4 Apr 2004 07:00:07 -0000 1.14 *************** *** 110,113 **** --- 110,130 ---- raise TestFailed, 'file.closed should be true' + # make sure that explicitly setting the buffer size doesn't cause + # misbehaviour especially with repeated close() calls + for s in (-1, 0, 1, 512): + try: + f = open(TESTFN, 'w', s) + f.write(str(s)) + f.close() + f.close() + f = open(TESTFN, 'r', s) + d = int(f.read()) + f.close() + f.close() + except IOError, msg: + raise TestFailed, 'error setting buffer size %d: %s' % (s, str(msg)) + if d != s: + raise TestFailed, 'readback failure using buffer size %d' + methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', From aimacintyre at users.sourceforge.net Sun Apr 4 03:01:38 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:13:58 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.962,1.963 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30296 Modified Files: NEWS Log Message: If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.962 retrieving revision 1.963 diff -C2 -d -r1.962 -r1.963 *** NEWS 25 Mar 2004 16:55:12 -0000 1.962 --- NEWS 4 Apr 2004 07:01:35 -0000 1.963 *************** *** 195,198 **** --- 195,202 ---- method is called as necessary. + - fixed: if a file is opened with an explicit buffer size >= 1, repeated + close() calls would attempt to free() the buffer already free()ed on + the first call. + Extension modules From aimacintyre at users.sourceforge.net Sun Apr 4 03:06:16 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:18:36 2004 Subject: [Python-checkins] python/dist/src/Objects fileobject.c, 2.179.8.5, 2.179.8.6 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30830 Modified Files: Tag: release23-maint fileobject.c Log Message: Backport to 2.3: If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.179.8.5 retrieving revision 2.179.8.6 diff -C2 -d -r2.179.8.5 -r2.179.8.6 *** fileobject.c 19 Mar 2004 15:23:14 -0000 2.179.8.5 --- fileobject.c 4 Apr 2004 07:06:13 -0000 2.179.8.6 *************** *** 353,356 **** --- 353,357 ---- Py_END_ALLOW_THREADS } + PyMem_Free(f->f_setbuf); Py_XDECREF(f->f_name); Py_XDECREF(f->f_mode); *************** *** 399,402 **** --- 400,404 ---- } PyMem_Free(f->f_setbuf); + f->f_setbuf = NULL; if (sts == EOF) return PyErr_SetFromErrno(PyExc_IOError); From aimacintyre at users.sourceforge.net Sun Apr 4 03:07:26 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:19:46 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_file.py, 1.12, 1.12.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30982 Modified Files: Tag: release23-maint test_file.py Log Message: Backport to 2.3: If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak. Index: test_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_file.py,v retrieving revision 1.12 retrieving revision 1.12.8.1 diff -C2 -d -r1.12 -r1.12.8.1 *** test_file.py 4 May 2003 04:16:50 -0000 1.12 --- test_file.py 4 Apr 2004 07:07:24 -0000 1.12.8.1 *************** *** 110,113 **** --- 110,130 ---- raise TestFailed, 'file.closed should be true' + # make sure that explicitly setting the buffer size doesn't cause + # misbehaviour especially with repeated close() calls + for s in (-1, 0, 1, 512): + try: + f = open(TESTFN, 'w', s) + f.write(str(s)) + f.close() + f.close() + f = open(TESTFN, 'r', s) + d = int(f.read()) + f.close() + f.close() + except IOError, msg: + raise TestFailed, 'error setting buffer size %d: %s' % (s, str(msg)) + if d != s: + raise TestFailed, 'readback failure using buffer size %d' + methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto', 'readline', 'readlines', 'seek', 'tell', 'truncate', 'write', From aimacintyre at users.sourceforge.net Sun Apr 4 03:08:23 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:20:43 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.97,1.831.4.98 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31097 Modified Files: Tag: release23-maint NEWS Log Message: Backport to 2.3: If a file is opened with an explicit buffer size >= 1, repeated close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.97 retrieving revision 1.831.4.98 diff -C2 -d -r1.831.4.97 -r1.831.4.98 *** NEWS 25 Mar 2004 16:56:14 -0000 1.831.4.97 --- NEWS 4 Apr 2004 07:08:20 -0000 1.831.4.98 *************** *** 36,39 **** --- 36,43 ---- fail caused intermittent errors and odd behavior. + - fixed: if a file is opened with an explicit buffer size >= 1, repeated + close() calls would attempt to free() the buffer already free()ed on + the first call. + Library ------- From aimacintyre at users.sourceforge.net Sun Apr 4 03:11:02 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:23:23 2004 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.315, 2.316 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31378 Modified Files: posixmodule.c Log Message: OS/2 has support for spawnvp() and spawnvpe() in the C libraries supplied with major C compilers (VACPP, EMX+gcc and [Open]Watcom). Also tidy up the export of spawn*() symbols in the os module to match what is found/implemented. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.315 retrieving revision 2.316 diff -C2 -d -r2.315 -r2.316 *** posixmodule.c 29 Mar 2004 11:53:38 -0000 2.315 --- posixmodule.c 4 Apr 2004 07:10:59 -0000 2.316 *************** *** 2504,2507 **** --- 2504,2732 ---- return res; } + + /* OS/2 supports spawnvp & spawnvpe natively */ + #if defined(PYOS_OS2) + PyDoc_STRVAR(posix_spawnvp__doc__, + "spawnvp(mode, file, args)\n\n\ + Execute the program 'file' in a new process, using the environment\n\ + search path to find the file.\n\ + \n\ + mode: mode of process creation\n\ + file: executable file name\n\ + args: tuple or list of strings"); + + static PyObject * + posix_spawnvp(PyObject *self, PyObject *args) + { + char *path; + PyObject *argv; + char **argvlist; + int mode, i, argc; + Py_intptr_t spawnval; + PyObject *(*getitem)(PyObject *, int); + + /* spawnvp has three arguments: (mode, path, argv), where + argv is a list or tuple of strings. */ + + if (!PyArg_ParseTuple(args, "ietO:spawnvp", &mode, + Py_FileSystemDefaultEncoding, + &path, &argv)) + return NULL; + if (PyList_Check(argv)) { + argc = PyList_Size(argv); + getitem = PyList_GetItem; + } + else if (PyTuple_Check(argv)) { + argc = PyTuple_Size(argv); + getitem = PyTuple_GetItem; + } + else { + PyErr_SetString(PyExc_TypeError, + "spawnvp() arg 2 must be a tuple or list"); + PyMem_Free(path); + return NULL; + } + + argvlist = PyMem_NEW(char *, argc+1); + if (argvlist == NULL) { + PyMem_Free(path); + return PyErr_NoMemory(); + } + for (i = 0; i < argc; i++) { + if (!PyArg_Parse((*getitem)(argv, i), "et", + Py_FileSystemDefaultEncoding, + &argvlist[i])) { + free_string_array(argvlist, i); + PyErr_SetString( + PyExc_TypeError, + "spawnvp() arg 2 must contain only strings"); + PyMem_Free(path); + return NULL; + } + } + argvlist[argc] = NULL; + + Py_BEGIN_ALLOW_THREADS + #if defined(PYCC_GCC) + spawnval = spawnvp(mode, path, argvlist); + #else + spawnval = _spawnvp(mode, path, argvlist); + #endif + Py_END_ALLOW_THREADS + + free_string_array(argvlist, argc); + PyMem_Free(path); + + if (spawnval == -1) + return posix_error(); + else + return Py_BuildValue("l", (long) spawnval); + } + + + PyDoc_STRVAR(posix_spawnvpe__doc__, + "spawnvpe(mode, file, args, env)\n\n\ + Execute the program 'file' in a new process, using the environment\n\ + search path to find the file.\n\ + \n\ + mode: mode of process creation\n\ + file: executable file name\n\ + args: tuple or list of arguments\n\ + env: dictionary of strings mapping to strings"); + + static PyObject * + posix_spawnvpe(PyObject *self, PyObject *args) + { + char *path; + PyObject *argv, *env; + char **argvlist; + char **envlist; + PyObject *key, *val, *keys=NULL, *vals=NULL, *res=NULL; + int mode, i, pos, argc, envc; + Py_intptr_t spawnval; + PyObject *(*getitem)(PyObject *, int); + int lastarg = 0; + + /* spawnvpe has four arguments: (mode, path, argv, env), where + argv is a list or tuple of strings and env is a dictionary + like posix.environ. */ + + if (!PyArg_ParseTuple(args, "ietOO:spawnvpe", &mode, + Py_FileSystemDefaultEncoding, + &path, &argv, &env)) + return NULL; + if (PyList_Check(argv)) { + argc = PyList_Size(argv); + getitem = PyList_GetItem; + } + else if (PyTuple_Check(argv)) { + argc = PyTuple_Size(argv); + getitem = PyTuple_GetItem; + } + else { + PyErr_SetString(PyExc_TypeError, + "spawnvpe() arg 2 must be a tuple or list"); + goto fail_0; + } + if (!PyMapping_Check(env)) { + PyErr_SetString(PyExc_TypeError, + "spawnvpe() arg 3 must be a mapping object"); + goto fail_0; + } + + argvlist = PyMem_NEW(char *, argc+1); + if (argvlist == NULL) { + PyErr_NoMemory(); + goto fail_0; + } + for (i = 0; i < argc; i++) { + if (!PyArg_Parse((*getitem)(argv, i), + "et;spawnvpe() arg 2 must contain only strings", + Py_FileSystemDefaultEncoding, + &argvlist[i])) + { + lastarg = i; + goto fail_1; + } + } + lastarg = argc; + argvlist[argc] = NULL; + + i = PyMapping_Size(env); + if (i < 0) + goto fail_1; + envlist = PyMem_NEW(char *, i + 1); + if (envlist == NULL) { + PyErr_NoMemory(); + goto fail_1; + } + envc = 0; + keys = PyMapping_Keys(env); + vals = PyMapping_Values(env); + if (!keys || !vals) + goto fail_2; + if (!PyList_Check(keys) || !PyList_Check(vals)) { + PyErr_SetString(PyExc_TypeError, + "spawnvpe(): env.keys() or env.values() is not a list"); + goto fail_2; + } + + for (pos = 0; pos < i; pos++) { + char *p, *k, *v; + size_t len; + + key = PyList_GetItem(keys, pos); + val = PyList_GetItem(vals, pos); + if (!key || !val) + goto fail_2; + + if (!PyArg_Parse( + key, + "s;spawnvpe() arg 3 contains a non-string key", + &k) || + !PyArg_Parse( + val, + "s;spawnvpe() arg 3 contains a non-string value", + &v)) + { + goto fail_2; + } + len = PyString_Size(key) + PyString_Size(val) + 2; + p = PyMem_NEW(char, len); + if (p == NULL) { + PyErr_NoMemory(); + goto fail_2; + } + PyOS_snprintf(p, len, "%s=%s", k, v); + envlist[envc++] = p; + } + envlist[envc] = 0; + + Py_BEGIN_ALLOW_THREADS + #if defined(PYCC_GCC) + spawnval = spawnve(mode, path, argvlist, envlist); + #else + spawnval = _spawnve(mode, path, argvlist, envlist); + #endif + Py_END_ALLOW_THREADS + + if (spawnval == -1) + (void) posix_error(); + else + res = Py_BuildValue("l", (long) spawnval); + + fail_2: + while (--envc >= 0) + PyMem_DEL(envlist[envc]); + PyMem_DEL(envlist); + fail_1: + free_string_array(argvlist, lastarg); + Py_XDECREF(vals); + Py_XDECREF(keys); + fail_0: + PyMem_Free(path); + return res; + } + #endif /* PYOS_OS2 */ #endif /* HAVE_SPAWNV */ *************** *** 6972,6975 **** --- 7197,7204 ---- {"spawnv", posix_spawnv, METH_VARARGS, posix_spawnv__doc__}, {"spawnve", posix_spawnve, METH_VARARGS, posix_spawnve__doc__}, + #if defined(PYOS_OS2) + {"spawnvp", posix_spawnvp, METH_VARARGS, posix_spawnvp__doc__}, + {"spawnvpe", posix_spawnvpe, METH_VARARGS, posix_spawnvpe__doc__}, + #endif /* PYOS_OS2 */ #endif /* HAVE_SPAWNV */ #ifdef HAVE_FORK1 From aimacintyre at users.sourceforge.net Sun Apr 4 03:11:46 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:24:06 2004 Subject: [Python-checkins] python/dist/src/Lib os.py,1.75,1.76 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31542 Modified Files: os.py Log Message: OS/2 has support for spawnvp() and spawnvpe() in the C libraries supplied with major C compilers (VACPP, EMX+gcc and [Open]Watcom). Also tidy up the export of spawn*() symbols in the os module to match what is found/implemented. Index: os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** os.py 4 Mar 2004 08:25:44 -0000 1.75 --- os.py 4 Apr 2004 07:11:43 -0000 1.76 *************** *** 574,577 **** --- 574,581 ---- return spawnve(mode, file, args[:-1], env) + + __all__.extend(["spawnv", "spawnve", "spawnl", "spawnle",]) + + if _exists("spawnvp"): # At the moment, Windows doesn't implement spawnvp[e], *************** *** 599,604 **** ! __all__.extend(["spawnlp","spawnlpe","spawnv", "spawnve","spawnvp", ! "spawnvpe","spawnl","spawnle",]) --- 603,607 ---- ! __all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",]) From aimacintyre at users.sourceforge.net Sun Apr 4 03:14:00 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:26:20 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.286, 1.287 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31835 Modified Files: socketmodule.c Log Message: OS/2's TCP/IP stack supports AF_UNIX sockets, with the limitation that the socket name must start with /socket32/. Unlike Unix systems, this file never exists in the file system. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.286 retrieving revision 1.287 diff -C2 -d -r1.286 -r1.287 *** socketmodule.c 23 Mar 2004 23:16:53 -0000 1.286 --- socketmodule.c 4 Apr 2004 07:13:49 -0000 1.287 *************** *** 875,879 **** } ! #if defined(AF_UNIX) && !defined(PYOS_OS2) case AF_UNIX: { --- 875,879 ---- } ! #if defined(AF_UNIX) case AF_UNIX: { *************** *** 949,953 **** switch (s->sock_family) { ! #if defined(AF_UNIX) && !defined(PYOS_OS2) case AF_UNIX: { --- 949,953 ---- switch (s->sock_family) { ! #if defined(AF_UNIX) case AF_UNIX: { *************** *** 1144,1148 **** switch (s->sock_family) { ! #if defined(AF_UNIX) && !defined(PYOS_OS2) case AF_UNIX: { --- 1144,1148 ---- switch (s->sock_family) { ! #if defined(AF_UNIX) case AF_UNIX: { *************** *** 3650,3654 **** PyModule_AddIntConstant(m, "AF_INET6", AF_INET6); #endif /* AF_INET6 */ ! #if defined(AF_UNIX) && !defined(PYOS_OS2) PyModule_AddIntConstant(m, "AF_UNIX", AF_UNIX); #endif /* AF_UNIX */ --- 3650,3654 ---- PyModule_AddIntConstant(m, "AF_INET6", AF_INET6); #endif /* AF_INET6 */ ! #if defined(AF_UNIX) PyModule_AddIntConstant(m, "AF_UNIX", AF_UNIX); #endif /* AF_UNIX */ From aimacintyre at users.sourceforge.net Sun Apr 4 03:16:00 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:28:20 2004 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.300.8.7, 2.300.8.8 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32239 Modified Files: Tag: release23-maint posixmodule.c Log Message: Backport to 2.3 to support Zope 2.7 on OS/2: OS/2 has support for spawnvp() and spawnvpe() in the C libraries supplied with major C compilers (VACPP, EMX+gcc and [Open]Watcom). Also tidy up the export of spawn*() symbols in the os module to match what is found/implemented. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.300.8.7 retrieving revision 2.300.8.8 diff -C2 -d -r2.300.8.7 -r2.300.8.8 *** posixmodule.c 29 Mar 2004 11:58:55 -0000 2.300.8.7 --- posixmodule.c 4 Apr 2004 07:15:58 -0000 2.300.8.8 *************** *** 2506,2509 **** --- 2506,2734 ---- return res; } + + /* OS/2 supports spawnvp & spawnvpe natively */ + #if defined(PYOS_OS2) + PyDoc_STRVAR(posix_spawnvp__doc__, + "spawnvp(mode, file, args)\n\n\ + Execute the program 'file' in a new process, using the environment\n\ + search path to find the file.\n\ + \n\ + mode: mode of process creation\n\ + file: executable file name\n\ + args: tuple or list of strings"); + + static PyObject * + posix_spawnvp(PyObject *self, PyObject *args) + { + char *path; + PyObject *argv; + char **argvlist; + int mode, i, argc; + Py_intptr_t spawnval; + PyObject *(*getitem)(PyObject *, int); + + /* spawnvp has three arguments: (mode, path, argv), where + argv is a list or tuple of strings. */ + + if (!PyArg_ParseTuple(args, "ietO:spawnvp", &mode, + Py_FileSystemDefaultEncoding, + &path, &argv)) + return NULL; + if (PyList_Check(argv)) { + argc = PyList_Size(argv); + getitem = PyList_GetItem; + } + else if (PyTuple_Check(argv)) { + argc = PyTuple_Size(argv); + getitem = PyTuple_GetItem; + } + else { + PyErr_SetString(PyExc_TypeError, + "spawnvp() arg 2 must be a tuple or list"); + PyMem_Free(path); + return NULL; + } + + argvlist = PyMem_NEW(char *, argc+1); + if (argvlist == NULL) { + PyMem_Free(path); + return PyErr_NoMemory(); + } + for (i = 0; i < argc; i++) { + if (!PyArg_Parse((*getitem)(argv, i), "et", + Py_FileSystemDefaultEncoding, + &argvlist[i])) { + free_string_array(argvlist, i); + PyErr_SetString( + PyExc_TypeError, + "spawnvp() arg 2 must contain only strings"); + PyMem_Free(path); + return NULL; + } + } + argvlist[argc] = NULL; + + Py_BEGIN_ALLOW_THREADS + #if defined(PYCC_GCC) + spawnval = spawnvp(mode, path, argvlist); + #else + spawnval = _spawnvp(mode, path, argvlist); + #endif + Py_END_ALLOW_THREADS + + free_string_array(argvlist, argc); + PyMem_Free(path); + + if (spawnval == -1) + return posix_error(); + else + return Py_BuildValue("l", (long) spawnval); + } + + + PyDoc_STRVAR(posix_spawnvpe__doc__, + "spawnvpe(mode, file, args, env)\n\n\ + Execute the program 'file' in a new process, using the environment\n\ + search path to find the file.\n\ + \n\ + mode: mode of process creation\n\ + file: executable file name\n\ + args: tuple or list of arguments\n\ + env: dictionary of strings mapping to strings"); + + static PyObject * + posix_spawnvpe(PyObject *self, PyObject *args) + { + char *path; + PyObject *argv, *env; + char **argvlist; + char **envlist; + PyObject *key, *val, *keys=NULL, *vals=NULL, *res=NULL; + int mode, i, pos, argc, envc; + Py_intptr_t spawnval; + PyObject *(*getitem)(PyObject *, int); + int lastarg = 0; + + /* spawnvpe has four arguments: (mode, path, argv, env), where + argv is a list or tuple of strings and env is a dictionary + like posix.environ. */ + + if (!PyArg_ParseTuple(args, "ietOO:spawnvpe", &mode, + Py_FileSystemDefaultEncoding, + &path, &argv, &env)) + return NULL; + if (PyList_Check(argv)) { + argc = PyList_Size(argv); + getitem = PyList_GetItem; + } + else if (PyTuple_Check(argv)) { + argc = PyTuple_Size(argv); + getitem = PyTuple_GetItem; + } + else { + PyErr_SetString(PyExc_TypeError, + "spawnvpe() arg 2 must be a tuple or list"); + goto fail_0; + } + if (!PyMapping_Check(env)) { + PyErr_SetString(PyExc_TypeError, + "spawnvpe() arg 3 must be a mapping object"); + goto fail_0; + } + + argvlist = PyMem_NEW(char *, argc+1); + if (argvlist == NULL) { + PyErr_NoMemory(); + goto fail_0; + } + for (i = 0; i < argc; i++) { + if (!PyArg_Parse((*getitem)(argv, i), + "et;spawnvpe() arg 2 must contain only strings", + Py_FileSystemDefaultEncoding, + &argvlist[i])) + { + lastarg = i; + goto fail_1; + } + } + lastarg = argc; + argvlist[argc] = NULL; + + i = PyMapping_Size(env); + if (i < 0) + goto fail_1; + envlist = PyMem_NEW(char *, i + 1); + if (envlist == NULL) { + PyErr_NoMemory(); + goto fail_1; + } + envc = 0; + keys = PyMapping_Keys(env); + vals = PyMapping_Values(env); + if (!keys || !vals) + goto fail_2; + if (!PyList_Check(keys) || !PyList_Check(vals)) { + PyErr_SetString(PyExc_TypeError, + "spawnvpe(): env.keys() or env.values() is not a list"); + goto fail_2; + } + + for (pos = 0; pos < i; pos++) { + char *p, *k, *v; + size_t len; + + key = PyList_GetItem(keys, pos); + val = PyList_GetItem(vals, pos); + if (!key || !val) + goto fail_2; + + if (!PyArg_Parse( + key, + "s;spawnvpe() arg 3 contains a non-string key", + &k) || + !PyArg_Parse( + val, + "s;spawnvpe() arg 3 contains a non-string value", + &v)) + { + goto fail_2; + } + len = PyString_Size(key) + PyString_Size(val) + 2; + p = PyMem_NEW(char, len); + if (p == NULL) { + PyErr_NoMemory(); + goto fail_2; + } + PyOS_snprintf(p, len, "%s=%s", k, v); + envlist[envc++] = p; + } + envlist[envc] = 0; + + Py_BEGIN_ALLOW_THREADS + #if defined(PYCC_GCC) + spawnval = spawnve(mode, path, argvlist, envlist); + #else + spawnval = _spawnve(mode, path, argvlist, envlist); + #endif + Py_END_ALLOW_THREADS + + if (spawnval == -1) + (void) posix_error(); + else + res = Py_BuildValue("l", (long) spawnval); + + fail_2: + while (--envc >= 0) + PyMem_DEL(envlist[envc]); + PyMem_DEL(envlist); + fail_1: + free_string_array(argvlist, lastarg); + Py_XDECREF(vals); + Py_XDECREF(keys); + fail_0: + PyMem_Free(path); + return res; + } + #endif /* PYOS_OS2 */ #endif /* HAVE_SPAWNV */ *************** *** 6955,6958 **** --- 7180,7187 ---- {"spawnv", posix_spawnv, METH_VARARGS, posix_spawnv__doc__}, {"spawnve", posix_spawnve, METH_VARARGS, posix_spawnve__doc__}, + #if defined(PYOS_OS2) + {"spawnvp", posix_spawnvp, METH_VARARGS, posix_spawnvp__doc__}, + {"spawnvpe", posix_spawnvpe, METH_VARARGS, posix_spawnvpe__doc__}, + #endif /* PYOS_OS2 */ #endif /* HAVE_SPAWNV */ #ifdef HAVE_FORK1 From aimacintyre at users.sourceforge.net Sun Apr 4 03:17:20 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:29:40 2004 Subject: [Python-checkins] python/dist/src/Lib os.py,1.72,1.72.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32416 Modified Files: Tag: release23-maint os.py Log Message: Backport to 2.3 to support Zope 2.7 on OS/2: OS/2 has support for spawnvp() and spawnvpe() in the C libraries supplied with major C compilers (VACPP, EMX+gcc and [Open]Watcom). Also tidy up the export of spawn*() symbols in the os module to match what is found/implemented. Index: os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v retrieving revision 1.72 retrieving revision 1.72.6.1 diff -C2 -d -r1.72 -r1.72.6.1 *** os.py 2 Jul 2003 02:49:33 -0000 1.72 --- os.py 4 Apr 2004 07:17:05 -0000 1.72.6.1 *************** *** 577,580 **** --- 577,584 ---- return spawnve(mode, file, args[:-1], env) + + __all__.extend(["spawnv", "spawnve", "spawnl", "spawnle",]) + + if _exists("spawnvp"): # At the moment, Windows doesn't implement spawnvp[e], *************** *** 602,607 **** ! __all__.extend(["spawnlp","spawnlpe","spawnv", "spawnve","spawnvp", ! "spawnvpe","spawnl","spawnle",]) --- 606,610 ---- ! __all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",]) From aimacintyre at users.sourceforge.net Sun Apr 4 03:19:30 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 4 03:31:50 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271.6.5, 1.271.6.6 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32745 Modified Files: Tag: release23-maint socketmodule.c Log Message: Backport to 2.3 to support Zope 2.7 on OS/2: OS/2's TCP/IP stack supports AF_UNIX sockets, with the limitation that the socket name must start with /socket32/. Unlike Unix systems, this file never exists in the file system. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271.6.5 retrieving revision 1.271.6.6 diff -C2 -d -r1.271.6.5 -r1.271.6.6 *** socketmodule.c 20 Oct 2003 14:34:47 -0000 1.271.6.5 --- socketmodule.c 4 Apr 2004 07:19:27 -0000 1.271.6.6 *************** *** 859,863 **** } ! #if defined(AF_UNIX) && !defined(PYOS_OS2) case AF_UNIX: { --- 859,863 ---- } ! #if defined(AF_UNIX) case AF_UNIX: { *************** *** 933,937 **** switch (s->sock_family) { ! #if defined(AF_UNIX) && !defined(PYOS_OS2) case AF_UNIX: { --- 933,937 ---- switch (s->sock_family) { ! #if defined(AF_UNIX) case AF_UNIX: { *************** *** 1064,1068 **** switch (s->sock_family) { ! #if defined(AF_UNIX) && !defined(PYOS_OS2) case AF_UNIX: { --- 1064,1068 ---- switch (s->sock_family) { ! #if defined(AF_UNIX) case AF_UNIX: { *************** *** 3542,3546 **** PyModule_AddIntConstant(m, "AF_INET6", AF_INET6); #endif /* AF_INET6 */ ! #if defined(AF_UNIX) && !defined(PYOS_OS2) PyModule_AddIntConstant(m, "AF_UNIX", AF_UNIX); #endif /* AF_UNIX */ --- 3542,3546 ---- PyModule_AddIntConstant(m, "AF_INET6", AF_INET6); #endif /* AF_INET6 */ ! #if defined(AF_UNIX) PyModule_AddIntConstant(m, "AF_UNIX", AF_UNIX); #endif /* AF_UNIX */ From rhettinger at users.sourceforge.net Sun Apr 4 04:51:43 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Apr 4 05:04:08 2004 Subject: [Python-checkins] python/dist/src/Objects abstract.c,2.127,2.128 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17015/Objects Modified Files: abstract.c Log Message: Improve accuracy of sequence and mapping checks. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.127 retrieving revision 2.128 diff -C2 -d -r2.127 -r2.128 *** abstract.c 21 Mar 2004 16:59:09 -0000 2.127 --- abstract.c 4 Apr 2004 08:51:40 -0000 2.128 *************** *** 1059,1062 **** --- 1059,1064 ---- PySequence_Check(PyObject *s) { + if (PyInstance_Check(s)) + return PyObject_HasAttrString(s, "__getitem__"); return s != NULL && s->ob_type->tp_as_sequence && s->ob_type->tp_as_sequence->sq_item != NULL; *************** *** 1601,1606 **** PyMapping_Check(PyObject *o) { ! return o && o->ob_type->tp_as_mapping && ! o->ob_type->tp_as_mapping->mp_subscript; } --- 1603,1612 ---- PyMapping_Check(PyObject *o) { ! if (PyInstance_Check(o)) ! return PyObject_HasAttrString(o, "__getitem__"); ! ! return o && o->ob_type->tp_as_mapping && ! o->ob_type->tp_as_mapping->mp_subscript && ! !PyObject_HasAttrString(o, "__getslice__"); } From rhettinger at users.sourceforge.net Sun Apr 4 04:51:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Apr 4 05:04:13 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.963,1.964 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17015/Misc Modified Files: NEWS Log Message: Improve accuracy of sequence and mapping checks. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.963 retrieving revision 1.964 diff -C2 -d -r1.963 -r1.964 *** NEWS 4 Apr 2004 07:01:35 -0000 1.963 --- NEWS 4 Apr 2004 08:51:41 -0000 1.964 *************** *** 203,206 **** --- 203,209 ---- ----------------- + - operator.isMappingType() and operator.isSequenceType() now give + fewer false positives. + - socket.sslerror is now a subclass of socket.error . Also added socket.error to the socket module's C API. From montanaro at users.sourceforge.net Sun Apr 4 10:12:30 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sun Apr 4 10:24:56 2004 Subject: [Python-checkins] python/nondist/peps pep-0318.txt,1.10,1.11 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6571 Modified Files: pep-0318.txt Log Message: motivate the use of [...] instead of various alternatives. Index: pep-0318.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0318.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0318.txt 1 Apr 2004 13:44:35 -0000 1.10 --- pep-0318.txt 4 Apr 2004 14:12:27 -0000 1.11 *************** *** 207,210 **** --- 207,224 ---- + Why [...]? + ---------- + + For syntax options which use a list-like syntax to specify the + decorators a few alternatives have been proposed: '[|...|]', + '*[...]*', and '<...>'. None have gained traction. The alternatives + which involve square brackets only serve to make it obvious that the + decorator construct is not a list. They do nothing to make parsing + any easier. The '<...>' alternative presents parsing problems because + '<' and '>' already parse as un-paired. They present a further + parsing ambiguity because a right angle bracket might be a greater + than symbol instead of a closer for the decorators. + + Current Implementation ====================== From facundobatista at users.sourceforge.net Sun Apr 4 12:14:27 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Sun Apr 4 12:26:52 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.17, 1.18 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27407 Modified Files: Decimal.py Log Message: Added _convert_other method, for implicit constructions. Added more checks when constructing from tuples. Fixed __sub__ to modify a copy of the instance. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Decimal.py 4 Apr 2004 05:00:13 -0000 1.17 --- Decimal.py 4 Apr 2004 16:14:25 -0000 1.18 *************** *** 96,99 **** --- 96,102 ---- """ + # 0.7.3 2003.4.04 facundobatista: Added _convert_other method, for implicit + # constructions, and more checks when constructing from + # tuples. Fixed __sub__ to modify a copy of the instance. # 0.7.2 2003.4.02 facundobatista: Fixed __pow__ to run the example ok. Added # from_float method. Fixed isnan to accept empty strings. *************** *** 407,411 **** list/tuple in form (sign, (digit_list), exponent) Decimal instance ! float, long, int """ if context is None: --- 410,416 ---- list/tuple in form (sign, (digit_list), exponent) Decimal instance ! long, int ! ! To construct from float, use Decimal.from_float(float_value) """ if context is None: *************** *** 454,459 **** if value[0] not in [0,1]: raise ValueError, 'Invalid sign' - # FIXME: Add more input validation checks here self._sign = value[0] self._int = tuple(value[1]) --- 459,466 ---- if value[0] not in [0,1]: raise ValueError, 'Invalid sign' + for digit in value[1]: + if not isinstance(digit, (int,long)) or digit < 0: + raise ValueError, "The second value in the tuple must be composed of non negative integer elements." self._sign = value[0] self._int = tuple(value[1]) *************** *** 513,516 **** --- 520,536 ---- from_float = classmethod(from_float) + def _convert_other(self, other): + """Convert other to Decimal. + + Verifies that it's ok to use in an implicit construction. + """ + if isinstance(other, Decimal): + return other + if isinstance(other, (int, long)): + other = Decimal(other) + return other + + raise TypeError, "You can interact Decimal only with int, long or Decimal data types." + def _isnan(self): """Returns whether the number is not actually one. *************** *** 593,601 **** if context is None: context = getcontext() ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) - if ans: return 1 --- 613,619 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) if ans: return 1 *************** *** 654,661 **** if context is None: context = getcontext() ! if not isinstance(other, Decimal): ! other = Decimal(other) ! ans = self._check_nans(other, context) #compare(NaN, NaN) = NaN if ans: return ans --- 672,679 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ! #compare(NaN, NaN) = NaN + ans = self._check_nans(other, context) if ans: return ans *************** *** 850,856 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 868,872 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) *************** *** 957,967 **** if context is None: context = getcontext() ans = self._check_nans(other, context=context) if ans: return ans # -Decimal(0) = Decimal(0), which we don't want since # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.) ! # so we change the sign directly. ! tmp = Decimal(other) tmp._sign = 1-tmp._sign --- 973,986 ---- if context is None: context = getcontext() + tmp = self._convert_other(other) + ans = self._check_nans(other, context=context) if ans: return ans + # -Decimal(0) = Decimal(0), which we don't want since # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.) ! # so we change the sign directly to a copy ! tmp = Decimal(tmp) tmp._sign = 1-tmp._sign *************** *** 969,976 **** def __rsub__(self, other, context=None): if context is None: context = getcontext() ! if not isinstance(other, Decimal): ! other = Decimal(other) tmp = Decimal(self) tmp._sign = 1 - tmp._sign --- 988,996 ---- def __rsub__(self, other, context=None): + """Return other + (-self)""" if context is None: context = getcontext() ! other = self._convert_other(other) ! tmp = Decimal(self) tmp._sign = 1 - tmp._sign *************** *** 1015,1021 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 1035,1039 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) *************** *** 1107,1113 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 1125,1129 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) *************** *** 1284,1290 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 1300,1304 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) *************** *** 1306,1312 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 1320,1324 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) *************** *** 1699,1705 **** if context is None: context = getcontext() ! ! if not isinstance(n, Decimal): ! n = Decimal(n) #Because the spot << doesn't work with really big exponents --- 1711,1715 ---- if context is None: context = getcontext() ! n = self._convert_other(n) #Because the spot << doesn't work with really big exponents *************** *** 2046,2052 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 2056,2060 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) *************** *** 2070,2076 **** if context is None: context = getcontext() ! ! if not isinstance(other, Decimal): ! other = Decimal(other) ans = self._check_nans(other, context) --- 2078,2082 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context) From facundobatista at users.sourceforge.net Sun Apr 4 12:15:14 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Sun Apr 4 12:27:37 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal test_Decimal.py, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27727 Modified Files: test_Decimal.py Log Message: Extended explicit construction test case from tuples. Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_Decimal.py 4 Apr 2004 05:01:02 -0000 1.14 --- test_Decimal.py 4 Apr 2004 16:15:12 -0000 1.15 *************** *** 15,18 **** --- 15,19 ---- """ + # 0.1.6 2003.04.04 fb: Extended explicit construction test case from tuples. # 0.1.5 2003.04.02 fb: Adjusted explicit construction test cases. # 0.1.4 2003.03.28 fb: Added Use of Context and Decimal Usability test cases. *************** *** 161,165 **** L = Sides[0].strip().split() id = L[0] ! #print id, funct = L[1].lower() valstemp = L[2:] --- 162,166 ---- L = Sides[0].strip().split() id = L[0] ! # print id, funct = L[1].lower() valstemp = L[2:] *************** *** 257,261 **** 'Incorrect flags set in ' + s + ' -- got ' \ + str(myexceptions)) ! def getexceptions(self): --- 258,262 ---- 'Incorrect flags set in ' + s + ' -- got ' \ + str(myexceptions)) ! return def getexceptions(self): *************** *** 579,582 **** --- 580,596 ---- self.assertEqual(str(d), '-4.34913534E-17') + #wrong number of items + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1)) ) + + #bad sign + self.assertRaises(ValueError, Decimal, (8, (4, 3, 4, 9, 1), 2) ) + + #bad exp + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), 'wrong!') ) + + #bad coefficients + self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, None, 1), 2) ) + self.assertRaises(ValueError, Decimal, (1, (4, -3, 4, 9, 1), 2) ) + def test_from_Decimal(self): '''Explicit construction with Decimal.''' From goodger at users.sourceforge.net Sun Apr 4 12:19:28 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sun Apr 4 12:31:53 2004 Subject: [Python-checkins] python/nondist/peps pep-0318.txt,1.11,1.12 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28625 Modified Files: pep-0318.txt Log Message: conflict between alternative proposed syntax and reST markup; escaped with inline literals Index: pep-0318.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0318.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0318.txt 4 Apr 2004 14:12:27 -0000 1.11 --- pep-0318.txt 4 Apr 2004 16:19:26 -0000 1.12 *************** *** 211,222 **** For syntax options which use a list-like syntax to specify the ! decorators a few alternatives have been proposed: '[|...|]', ! '*[...]*', and '<...>'. None have gained traction. The alternatives ! which involve square brackets only serve to make it obvious that the ! decorator construct is not a list. They do nothing to make parsing ! any easier. The '<...>' alternative presents parsing problems because ! '<' and '>' already parse as un-paired. They present a further ! parsing ambiguity because a right angle bracket might be a greater ! than symbol instead of a closer for the decorators. --- 211,222 ---- For syntax options which use a list-like syntax to specify the ! decorators a few alternatives have been proposed: ``[|...|]``, ! ``*[...]*``, and ``<...>``. None have gained traction. The ! alternatives which involve square brackets only serve to make it ! obvious that the decorator construct is not a list. They do nothing ! to make parsing any easier. The '<...>' alternative presents parsing ! problems because '<' and '>' already parse as un-paired. They present ! a further parsing ambiguity because a right angle bracket might be a ! greater than symbol instead of a closer for the decorators. From goodger at users.sourceforge.net Sun Apr 4 12:31:44 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sun Apr 4 12:44:09 2004 Subject: [Python-checkins] python/nondist/peps pep-0318.txt,1.12,1.13 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30697 Modified Files: pep-0318.txt Log Message: put emacs local variables stanza into a comment Index: pep-0318.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0318.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pep-0318.txt 4 Apr 2004 16:19:26 -0000 1.12 --- pep-0318.txt 4 Apr 2004 16:31:42 -0000 1.13 *************** *** 375,384 **** This document has been placed in the public domain. - ! Local Variables: ! mode: indented-text ! indent-tabs-mode: nil ! sentence-end-double-space: t ! fill-column: 70 ! End: --- 375,384 ---- This document has been placed in the public domain. ! .. ! Local Variables: ! mode: indented-text ! indent-tabs-mode: nil ! sentence-end-double-space: t ! fill-column: 70 ! End: From rhettinger at users.sourceforge.net Mon Apr 5 04:14:51 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 5 04:28:45 2004 Subject: [Python-checkins] python/dist/src/Objects abstract.c,2.128,2.129 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27539 Modified Files: abstract.c Log Message: Improve previous checkin to use a slot check instead of equivalent attribute name lookup. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.128 retrieving revision 2.129 diff -C2 -d -r2.128 -r2.129 *** abstract.c 4 Apr 2004 08:51:40 -0000 2.128 --- abstract.c 5 Apr 2004 08:14:48 -0000 2.129 *************** *** 1608,1612 **** return o && o->ob_type->tp_as_mapping && o->ob_type->tp_as_mapping->mp_subscript && ! !PyObject_HasAttrString(o, "__getslice__"); } --- 1608,1613 ---- return o && o->ob_type->tp_as_mapping && o->ob_type->tp_as_mapping->mp_subscript && ! !(o->ob_type->tp_as_sequence && ! o->ob_type->tp_as_sequence->sq_slice); } From tim_one at users.sourceforge.net Mon Apr 5 15:36:29 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Mon Apr 5 15:49:12 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.388,2.389 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30533/Python Modified Files: ceval.c Log Message: Since the fast_yield branch target was introduced, it appears that most tests of "why" against WHY_YIELD became useless. This patch removes them, but assert()s that why != WHY_YIELD everywhere such a test was removed. The test suite ran fine under a debug build (i.e., the asserts never triggered). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.388 retrieving revision 2.389 diff -C2 -d -r2.388 -r2.389 *** ceval.c 24 Mar 2004 22:22:11 -0000 2.388 --- ceval.c 5 Apr 2004 19:36:21 -0000 2.389 *************** *** 48,52 **** PyFrameObject *, int); static void call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *); ! static int maybe_call_line_trace(Py_tracefunc, PyObject *, PyFrameObject *, int *, int *, int *); --- 48,52 ---- PyFrameObject *, int); static void call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *); ! static int maybe_call_line_trace(Py_tracefunc, PyObject *, PyFrameObject *, int *, int *, int *); *************** *** 124,128 **** PyEval_GetCallStats(PyObject *self) { ! return Py_BuildValue("iiiiiiiiii", pcall[0], pcall[1], pcall[2], pcall[3], pcall[4], pcall[5], pcall[6], pcall[7], --- 124,128 ---- PyEval_GetCallStats(PyObject *self) { ! return Py_BuildValue("iiiiiiiiii", pcall[0], pcall[1], pcall[2], pcall[3], pcall[4], pcall[5], pcall[6], pcall[7], *************** *** 148,152 **** PyFrameObject *gi_frame; ! /* True if generator is being executed. */ int gi_running; --- 148,152 ---- PyFrameObject *gi_frame; ! /* True if generator is being executed. */ int gi_running; *************** *** 594,602 **** PyCodeObject *co; ! /* when tracing we set things up so that not (instr_lb <= current_bytecode_offset < instr_ub) ! is true when the line being executed has changed. The initial values are such as to make this false the first time it is tested. */ --- 594,602 ---- PyCodeObject *co; ! /* when tracing we set things up so that not (instr_lb <= current_bytecode_offset < instr_ub) ! is true when the line being executed has changed. The initial values are such as to make this false the first time it is tested. */ *************** *** 645,650 **** its two unpredictable branches, the HASARG test and the switch-case. ! If collecting opcode statistics, turn off prediction so that ! statistics are accurately maintained (the predictions bypass the opcode frequency counter updates). */ --- 645,650 ---- its two unpredictable branches, the HASARG test and the switch-case. ! If collecting opcode statistics, turn off prediction so that ! statistics are accurately maintained (the predictions bypass the opcode frequency counter updates). */ *************** *** 842,846 **** for expository comments */ f->f_stacktop = stack_pointer; ! err = maybe_call_line_trace(tstate->c_tracefunc, tstate->c_traceobj, --- 842,846 ---- for expository comments */ f->f_stacktop = stack_pointer; ! err = maybe_call_line_trace(tstate->c_tracefunc, tstate->c_traceobj, *************** *** 1540,1544 **** s[len-1] == ' ') PyFile_SoftSpace(w, 1); ! } #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { --- 1540,1544 ---- s[len-1] == ' ') PyFile_SoftSpace(w, 1); ! } #ifdef Py_USING_UNICODE else if (PyUnicode_Check(v)) { *************** *** 1654,1659 **** if (PyInt_Check(v)) { why = (enum why_code) PyInt_AS_LONG(v); if (why == WHY_RETURN || - why == WHY_YIELD || why == WHY_CONTINUE) retval = POP(); --- 1654,1659 ---- if (PyInt_Check(v)) { why = (enum why_code) PyInt_AS_LONG(v); + assert(why != WHY_YIELD); if (why == WHY_RETURN || why == WHY_CONTINUE) retval = POP(); *************** *** 2326,2332 **** fast_block_end: ! while (why != WHY_NOT && why != WHY_YIELD && f->f_iblock > 0) { PyTryBlock *b = PyFrame_BlockPop(f); if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) { /* For a continue inside a try block, --- 2326,2333 ---- fast_block_end: ! while (why != WHY_NOT && f->f_iblock > 0) { PyTryBlock *b = PyFrame_BlockPop(f); + assert(why != WHY_YIELD); if (b->b_type == SETUP_LOOP && why == WHY_CONTINUE) { /* For a continue inside a try block, *************** *** 2398,2410 **** } /* main loop */ ! if (why != WHY_YIELD) { ! /* Pop remaining stack entries -- but when yielding */ ! while (!EMPTY()) { ! v = POP(); ! Py_XDECREF(v); ! } } ! if (why != WHY_RETURN && why != WHY_YIELD) retval = NULL; --- 2399,2410 ---- } /* main loop */ ! assert(why != WHY_YIELD); ! /* Pop remaining stack entries. */ ! while (!EMPTY()) { ! v = POP(); ! Py_XDECREF(v); } ! if (why != WHY_RETURN) retval = NULL; *************** *** 2462,2466 **** if (globals == NULL) { ! PyErr_SetString(PyExc_SystemError, "PyEval_EvalCodeEx: NULL globals"); return NULL; --- 2462,2466 ---- if (globals == NULL) { ! PyErr_SetString(PyExc_SystemError, "PyEval_EvalCodeEx: NULL globals"); return NULL; *************** *** 3084,3093 **** static int ! maybe_call_line_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, int *instr_lb, int *instr_ub, int *instr_prev) { /* The theory of SET_LINENO-less tracing. ! In a nutshell, we use the co_lnotab field of the code object to tell when execution has moved onto a different line. --- 3084,3093 ---- static int ! maybe_call_line_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, int *instr_lb, int *instr_ub, int *instr_prev) { /* The theory of SET_LINENO-less tracing. ! In a nutshell, we use the co_lnotab field of the code object to tell when execution has moved onto a different line. *************** *** 3118,3132 **** 2 0 LOAD_FAST 0 (a) 3 JUMP_IF_FALSE 9 (to 15) ! 6 POP_TOP 3 7 LOAD_CONST 1 (1) ! 10 PRINT_ITEM ! 11 PRINT_NEWLINE 12 JUMP_FORWARD 6 (to 21) ! >> 15 POP_TOP 5 16 LOAD_CONST 2 (2) ! 19 PRINT_ITEM ! 20 PRINT_NEWLINE >> 21 LOAD_CONST 0 (None) 24 RETURN_VALUE --- 3118,3132 ---- 2 0 LOAD_FAST 0 (a) 3 JUMP_IF_FALSE 9 (to 15) ! 6 POP_TOP 3 7 LOAD_CONST 1 (1) ! 10 PRINT_ITEM ! 11 PRINT_NEWLINE 12 JUMP_FORWARD 6 (to 21) ! >> 15 POP_TOP 5 16 LOAD_CONST 2 (2) ! 19 PRINT_ITEM ! 20 PRINT_NEWLINE >> 21 LOAD_CONST 0 (None) 24 RETURN_VALUE *************** *** 3194,3198 **** if (addr == frame->f_lasti) { frame->f_lineno = line; ! result = call_trace(func, obj, frame, PyTrace_LINE, Py_None); } --- 3194,3198 ---- if (addr == frame->f_lasti) { frame->f_lineno = line; ! result = call_trace(func, obj, frame, PyTrace_LINE, Py_None); } *************** *** 3212,3216 **** else if (frame->f_lasti <= *instr_prev) { /* jumping back in the same line forces a trace event */ ! result = call_trace(func, obj, frame, PyTrace_LINE, Py_None); } --- 3212,3216 ---- else if (frame->f_lasti <= *instr_prev) { /* jumping back in the same line forces a trace event */ ! result = call_trace(func, obj, frame, PyTrace_LINE, Py_None); } *************** *** 3413,3424 **** { if (flags & METH_NOARGS) ! PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%d given)", ! ((PyCFunctionObject *)func)->m_ml->ml_name, nargs); else ! PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%d given)", ! ((PyCFunctionObject *)func)->m_ml->ml_name, nargs); } --- 3413,3424 ---- { if (flags & METH_NOARGS) ! PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%d given)", ! ((PyCFunctionObject *)func)->m_ml->ml_name, nargs); else ! PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%d given)", ! ((PyCFunctionObject *)func)->m_ml->ml_name, nargs); } *************** *** 3506,3511 **** x = PyCFunction_Call(func, callargs, NULL); END_C_TRACE ! Py_XDECREF(callargs); ! } } else { if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) { --- 3506,3511 ---- x = PyCFunction_Call(func, callargs, NULL); END_C_TRACE ! Py_XDECREF(callargs); ! } } else { if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) { *************** *** 3525,3533 **** if (PyFunction_Check(func)) x = fast_function(func, pp_stack, n, na, nk); ! else x = do_call(func, pp_stack, na, nk); Py_DECREF(func); } ! /* What does this do? */ while ((*pp_stack) > pfunc) { --- 3525,3533 ---- if (PyFunction_Check(func)) x = fast_function(func, pp_stack, n, na, nk); ! else x = do_call(func, pp_stack, na, nk); Py_DECREF(func); } ! /* What does this do? */ while ((*pp_stack) > pfunc) { *************** *** 3823,3827 **** /* It's an overflow error, so we need to check the sign of the long integer, ! set the value to INT_MAX or -INT_MAX, and clear the error. */ --- 3823,3827 ---- /* It's an overflow error, so we need to check the sign of the long integer, ! set the value to INT_MAX or -INT_MAX, and clear the error. */ *************** *** 4115,4122 **** if (PyEval_MergeCompilerFlags(&cf)) v = PyRun_FileFlags(fp, name, Py_file_input, globals, ! locals, &cf); else v = PyRun_File(fp, name, Py_file_input, globals, ! locals); } else { --- 4115,4122 ---- if (PyEval_MergeCompilerFlags(&cf)) v = PyRun_FileFlags(fp, name, Py_file_input, globals, ! locals, &cf); else v = PyRun_File(fp, name, Py_file_input, globals, ! locals); } else { *************** *** 4137,4141 **** return -1; if (PyEval_MergeCompilerFlags(&cf)) ! v = PyRun_StringFlags(str, Py_file_input, globals, locals, &cf); else --- 4137,4141 ---- return -1; if (PyEval_MergeCompilerFlags(&cf)) ! v = PyRun_StringFlags(str, Py_file_input, globals, locals, &cf); else From fdrake at users.sourceforge.net Mon Apr 5 15:54:47 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Apr 5 16:07:24 2004 Subject: [Python-checkins] python/nondist/sandbox/setuptools/setuptools/command build_ext.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2495 Modified Files: build_ext.py Log Message: remove trailing blank line Index: build_ext.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/build_ext.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build_ext.py 19 Mar 2004 20:53:14 -0000 1.1 --- build_ext.py 5 Apr 2004 19:54:44 -0000 1.2 *************** *** 5,7 **** except ImportError: from distutils.command.build_ext import build_ext - --- 5,6 ---- From fdrake at users.sourceforge.net Mon Apr 5 15:59:13 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Apr 5 16:11:51 2004 Subject: [Python-checkins] python/nondist/sandbox/setuptools/setuptools/command install_lib.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3282 Modified Files: install_lib.py Log Message: remove trailing blank line Index: install_lib.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/install_lib.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install_lib.py 19 Mar 2004 20:53:14 -0000 1.1 --- install_lib.py 5 Apr 2004 19:59:11 -0000 1.2 *************** *** 15,17 **** return bytecode_files - --- 15,16 ---- From fdrake at users.sourceforge.net Mon Apr 5 16:03:01 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Apr 5 16:15:45 2004 Subject: [Python-checkins] python/nondist/sandbox/setuptools/setuptools/command install.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3894 Modified Files: install.py Log Message: - remove trailing blank lines - use whitespace according to the Python style guide Index: install.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/install.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install.py 19 Mar 2004 20:53:14 -0000 1.1 --- install.py 5 Apr 2004 20:02:45 -0000 1.2 *************** *** 7,11 **** return self.distribution.has_dependencies() ! sub_commands = [('depends',has_dependencies)] + _install.sub_commands ! ! --- 7,9 ---- return self.distribution.has_dependencies() ! sub_commands = [('depends', has_dependencies)] + _install.sub_commands From fdrake at users.sourceforge.net Mon Apr 5 16:21:56 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Apr 5 16:34:34 2004 Subject: [Python-checkins] python/nondist/sandbox/setuptools/setuptools/command __init__.py, 1.1, 1.2 build_py.py, 1.1, 1.2 depends.py, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7751/setuptools/command Modified Files: __init__.py build_py.py depends.py Log Message: remove excess blank lines, and apply whitespace more in line with the Python style guidelines in PEP 8 Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/__init__.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** __init__.py 19 Mar 2004 20:53:14 -0000 1.1 --- __init__.py 5 Apr 2004 20:21:53 -0000 1.2 *************** *** 9,11 **** distutils.command.__all__.extend( [cmd for cmd in __all__ if cmd not in distutils.command.__all__] ! ) --- 9,11 ---- distutils.command.__all__.extend( [cmd for cmd in __all__ if cmd not in distutils.command.__all__] ! ) Index: build_py.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/build_py.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build_py.py 19 Mar 2004 20:53:14 -0000 1.1 --- build_py.py 5 Apr 2004 20:21:53 -0000 1.2 *************** *** 1,9 **** from distutils.command.build_py import build_py as _build_py from distutils.util import convert_path from glob import glob - import os.path - class build_py(_build_py): """Enhanced 'build_py' command that includes data files with packages --- 1,10 ---- + import os.path + from distutils.command.build_py import build_py as _build_py from distutils.util import convert_path from glob import glob + class build_py(_build_py): """Enhanced 'build_py' command that includes data files with packages *************** *** 18,28 **** _build_py.finalize_options(self) self.package_data = self.distribution.package_data ! self.data_files = self.get_data_files() ! def run(self): - """Build modules, packages, and copy data files to build directory""" - if not self.py_modules and not self.packages: return --- 19,26 ---- _build_py.finalize_options(self) self.package_data = self.distribution.package_data ! self.data_files = self.get_data_files() def run(self): """Build modules, packages, and copy data files to build directory""" if not self.py_modules and not self.packages: return *************** *** 37,49 **** # Only compile actual .py files, using our base class' idea of what our # output files are. ! self.byte_compile(_build_py.get_outputs(self,include_bytecode=0)) ! def get_data_files(self): - """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" - data = [] - for package in self.packages: # Locate package source directory --- 35,43 ---- # Only compile actual .py files, using our base class' idea of what our # output files are. ! self.byte_compile(_build_py.get_outputs(self, include_bytecode=0)) def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] for package in self.packages: # Locate package source directory *************** *** 51,55 **** # Compute package build directory ! build_dir = os.path.join(*([self.build_lib]+package.split('.'))) # Length of path to strip from found files --- 45,49 ---- # Compute package build directory ! build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Length of path to strip from found files *************** *** 59,100 **** filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ! ] ! data.append( (package, src_dir, build_dir, filenames) ) - return data - def find_data_files(self, package, src_dir): - """Return filenames for package's data files in 'src_dir'""" ! ! globs = self.package_data.get('',[])+self.package_data.get(package,[]) files = [] - for pattern in globs: # Each pattern has to be converted to a platform-specific path files.extend(glob(os.path.join(src_dir, convert_path(pattern)))) - return files - - def build_package_data(self): - """Copy data files into build directory""" - lastdir = None - for package, src_dir, build_dir, filenames in self.data_files: - for filename in filenames: ! target = os.path.join(build_dir,filename) self.mkpath(os.path.dirname(target)) ! self.copy_file(os.path.join(src_dir,filename), target) ! def get_outputs(self, include_bytecode=1): - """Return complete list of files copied to the build directory --- 53,80 ---- filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ! ] data.append( (package, src_dir, build_dir, filenames) ) return data def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" ! globs = (self.package_data.get('', []) ! + self.package_data.get(package, [])) files = [] for pattern in globs: # Each pattern has to be converted to a platform-specific path files.extend(glob(os.path.join(src_dir, convert_path(pattern)))) return files def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: ! target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) ! self.copy_file(os.path.join(src_dir, filename), target) def get_outputs(self, include_bytecode=1): """Return complete list of files copied to the build directory *************** *** 104,123 **** correct installation manifest.) """ ! ! return _build_py.get_outputs(self,include_bytecode) + [ ! os.path.join(build_dir,filename) ! for package,src_dir,build_dir,filenames in self.data_files ! for filename in filenames ! ] ! ! ! ! ! ! ! ! ! ! ! ! --- 84,90 ---- correct installation manifest.) """ ! return _build_py.get_outputs(self, include_bytecode) + [ ! os.path.join(build_dir, filename) ! for package, src_dir, build_dir,filenames in self.data_files ! for filename in filenames ! ] Index: depends.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/depends.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** depends.py 22 Mar 2004 01:12:31 -0000 1.3 --- depends.py 5 Apr 2004 20:21:53 -0000 1.4 *************** *** 1,8 **** from distutils.cmd import Command - import os, sys class depends(Command): - """Download and install dependencies, if needed""" --- 1,9 ---- + import os + import sys + from distutils.cmd import Command class depends(Command): """Download and install dependencies, if needed""" *************** *** 14,39 **** ('ignore-extra-args', 'i', "ignore options that won't be passed to child setup scripts"), ! ] path_attrs = [ # Note: these must be in *reverse* order, as they are pushed onto the # *front* of a copy of sys.path. ! ('install','install_libbase'), # installation base if extra_path ! ('install_lib','install_dir'), # where modules are installed ! ] # Command options that can be safely passed to dependencies' setup scripts safe_opts = { 'install': [ ! 'prefix','exec-prefix','home','install-base','install-platbase', ! 'root','optimize','force','verbose','quiet' ! ], ! 'build': ['compiler','debug','force','verbose','quiet'], ! } # Options with string arguments that are *not* directories or files, and # so should *not* have absolute-path fixups applied. ! non_fs_opts = {'build':['compiler'] } ! def initialize_options(self): --- 15,39 ---- ('ignore-extra-args', 'i', "ignore options that won't be passed to child setup scripts"), ! ] path_attrs = [ # Note: these must be in *reverse* order, as they are pushed onto the # *front* of a copy of sys.path. ! ('install', 'install_libbase'), # installation base if extra_path ! ('install_lib', 'install_dir'), # where modules are installed ! ] # Command options that can be safely passed to dependencies' setup scripts safe_opts = { 'install': [ ! 'prefix', 'exec-prefix', 'home', 'install-base', ! 'install-platbase', 'root', 'optimize', 'force', 'verbose', 'quiet' ! ], ! 'build': ['compiler', 'debug', 'force', 'verbose', 'quiet'], ! } # Options with string arguments that are *not* directories or files, and # so should *not* have absolute-path fixups applied. ! non_fs_opts = {'build': ['compiler']} def initialize_options(self): *************** *** 86,90 **** needed = [ dep for dep in self.distribution.requires if self.is_needed(dep) ! ] if not needed: --- 86,90 ---- needed = [ dep for dep in self.distribution.requires if self.is_needed(dep) ! ] if not needed: *************** *** 98,102 **** self.announce( "dependencies will be installed using:\n "+' '.join(argv)+'\n' ! ) # Alert for unsupported commands/options, unless '-i' was used --- 98,102 ---- self.announce( "dependencies will be installed using:\n "+' '.join(argv)+'\n' ! ) # Alert for unsupported commands/options, unless '-i' was used *************** *** 110,125 **** " to omit the unsupported options,\nor install the" " dependencies manually." ! ) ! # Alert the user to missing items fmt = "\t%s\t%s\n" ! items = [fmt % (dep.full_name(),dep.homepage) for dep in needed] items.insert(0,"Please install the following packages *first*:\n") items.append('') raise SystemExit('\n'.join(items)) # dump msg to stderr and exit - - def warn_unsafe_options_used(self): lines = []; write = lines.append --- 110,122 ---- " to omit the unsupported options,\nor install the" " dependencies manually." ! ) # Alert the user to missing items fmt = "\t%s\t%s\n" ! items = [fmt % (dep.full_name(), dep.homepage) for dep in needed] items.insert(0,"Please install the following packages *first*:\n") items.append('') raise SystemExit('\n'.join(items)) # dump msg to stderr and exit def warn_unsafe_options_used(self): lines = []; write = lines.append *************** *** 127,138 **** write("dependencies, and will be IGNORED:") for cmd,line in self.unsafe_options.items(): ! write('\t%s %s' % (cmd,' '.join(line))) write('') self.warn('\n'.join(lines)) - def is_needed(self,dep): """Does the specified dependency need to be installed/updated?""" - self.announce("searching for "+dep.full_name()) version = dep.get_version(self.search_path) --- 124,133 ---- write("dependencies, and will be IGNORED:") for cmd,line in self.unsafe_options.items(): ! write('\t%s %s' % (cmd, ' '.join(line))) write('') self.warn('\n'.join(lines)) def is_needed(self,dep): """Does the specified dependency need to be installed/updated?""" self.announce("searching for "+dep.full_name()) version = dep.get_version(self.search_path) *************** *** 153,164 **** self.announce(status+" (update needed)") return True - - - - - - - - - - --- 148,149 ---- From fdrake at users.sourceforge.net Mon Apr 5 16:21:56 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Apr 5 16:34:35 2004 Subject: [Python-checkins] python/nondist/sandbox/setuptools/setuptools/tests __init__.py, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7751/setuptools/tests Modified Files: __init__.py Log Message: remove excess blank lines, and apply whitespace more in line with the Python style guidelines in PEP 8 Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/tests/__init__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** __init__.py 22 Mar 2004 01:12:31 -0000 1.3 --- __init__.py 5 Apr 2004 20:21:52 -0000 1.4 *************** *** 1,16 **** """Tests for the 'setuptools' package""" ! from unittest import TestSuite, TestCase, makeSuite import distutils.core, distutils.cmd from distutils.errors import DistutilsOptionError, DistutilsPlatformError from distutils.errors import DistutilsSetupError import setuptools, setuptools.dist from setuptools import Feature - from distutils.core import Extension from setuptools.depends import extract_constant, get_module_constant from setuptools.depends import find_module, Require - from distutils.version import StrictVersion, LooseVersion - from distutils.util import convert_path - import sys, os.path --- 1,21 ---- """Tests for the 'setuptools' package""" ! import os.path ! import sys ! ! from unittest import TestSuite, TestCase, makeSuite, main ! import distutils.core, distutils.cmd + from distutils.core import Extension from distutils.errors import DistutilsOptionError, DistutilsPlatformError from distutils.errors import DistutilsSetupError + from distutils.util import convert_path + from distutils.version import StrictVersion, LooseVersion + import setuptools, setuptools.dist + from setuptools import Feature from setuptools.depends import extract_constant, get_module_constant from setuptools.depends import find_module, Require *************** *** 21,25 **** # Don't let system command line leak into tests! ! args.setdefault('script_args',['install']) try: --- 26,30 ---- # Don't let system command line leak into tests! ! args.setdefault('script_args', ['install']) try: *************** *** 29,47 **** - - - - - - - - - - - class DependsTests(TestCase): def testExtractConst(self): - from setuptools.depends import extract_constant --- 34,40 ---- *************** *** 71,86 **** def testModuleExtract(self): from distutils import __version__ ! self.assertEqual( ! get_module_constant('distutils','__version__'), __version__ ! ) ! self.assertEqual( ! get_module_constant('sys','version'), sys.version ! ) ! self.assertEqual( ! get_module_constant('setuptools.tests','__doc__'),__doc__ ! ) def testRequire(self): - req = Require('Distutils','1.0.3','distutils') --- 64,75 ---- def testModuleExtract(self): from distutils import __version__ ! self.assertEqual(get_module_constant('distutils', '__version__'), ! __version__) ! self.assertEqual(get_module_constant('sys', 'version'), ! sys.version) ! self.assertEqual(get_module_constant('setuptools.tests', '__doc__'), ! __doc__) def testRequire(self): req = Require('Distutils','1.0.3','distutils') *************** *** 100,104 **** self.failUnless(req.is_current()) ! req = Require('Distutils 3000','03000','distutils',format=LooseVersion) self.failUnless(req.is_present()) self.failIf(req.is_current()) --- 89,94 ---- self.failUnless(req.is_current()) ! req = Require('Distutils 3000', '03000', 'distutils', ! format=LooseVersion) self.failUnless(req.is_present()) self.failIf(req.is_current()) *************** *** 120,136 **** self.failUnless(req.is_current(paths)) - - def testDependsCmd(self): path1 = convert_path('foo/bar/baz') path2 = convert_path('foo/bar/baz/spam') ! dist = makeSetup( ! extra_path='spam', ! script_args=[ ! 'install','--install-lib',path1, '--prefix',path2, ! 'build','--compiler=mingw32', ! ] ! ) cmd = dist.get_command_obj('depends') --- 110,121 ---- self.failUnless(req.is_current(paths)) def testDependsCmd(self): path1 = convert_path('foo/bar/baz') path2 = convert_path('foo/bar/baz/spam') ! dist = makeSetup(extra_path='spam', ! script_args=['install', '--install-lib', path1, ! '--prefix', path2, ! 'build', '--compiler=mingw32',]) cmd = dist.get_command_obj('depends') *************** *** 138,164 **** self.assertEqual(cmd.temp, dist.get_command_obj('build').build_temp) ! self.assertEqual(cmd.search_path, [path2,path1]+sys.path) self.assertEqual(cmd.unsafe_options, ! {'install':['--install-lib',path1]} ! ) self.assertEqual(cmd.safe_options, { 'build':['--compiler','mingw32'], ! 'install':['--prefix',os.path.abspath(path2)] ! }) ! ! ! ! ! ! ! ! ! ! ! ! ! ! --- 123,133 ---- self.assertEqual(cmd.temp, dist.get_command_obj('build').build_temp) ! self.assertEqual(cmd.search_path, [path2,path1] + sys.path) self.assertEqual(cmd.unsafe_options, ! {'install': ['--install-lib',path1]}) self.assertEqual(cmd.safe_options, { 'build':['--compiler','mingw32'], ! 'install':['--prefix',os.path.abspath(path2)]}) *************** *** 180,187 **** ) - def testDistroType(self): ! self.failUnless(isinstance(self.dist,setuptools.dist.Distribution)) ! def testExcludePackage(self): --- 149,154 ---- ) def testDistroType(self): ! self.failUnless(isinstance(self.dist, setuptools.dist.Distribution)) def testExcludePackage(self): *************** *** 202,207 **** makeSetup().exclude_package('x') - - def testIncludeExclude(self): # remove an extension --- 169,172 ---- *************** *** 242,287 **** self.failIf(self.dist.has_contents_for('c')) - - - def testInvalidIncludeExclude(self): self.assertRaises(DistutilsSetupError, ! self.dist.include, nonexistent_option='x' ! ) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, nonexistent_option='x' ! ) self.assertRaises(DistutilsSetupError, ! self.dist.include, packages={'x':'y'} ! ) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, packages={'x':'y'} ! ) self.assertRaises(DistutilsSetupError, ! self.dist.include, ext_modules={'x':'y'} ! ) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, ext_modules={'x':'y'} ! ) self.assertRaises(DistutilsSetupError, ! self.dist.include, package_dir=['q'] ! ) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, package_dir=['q'] ! ) def testCmdLineOpts(self): ! self.assertEqual(self.dist.get_cmdline_options(), ! { 'install':{'prefix':'/usr/lib', 'install-lib':'/test'}, ! 'build': {'quiet':None}, 'build_ext':{'inplace':None}, ! } ! ) ! ! ! ! ! ! --- 207,236 ---- self.failIf(self.dist.has_contents_for('c')) def testInvalidIncludeExclude(self): self.assertRaises(DistutilsSetupError, ! self.dist.include, nonexistent_option='x') self.assertRaises(DistutilsSetupError, ! self.dist.exclude, nonexistent_option='x') self.assertRaises(DistutilsSetupError, ! self.dist.include, packages={'x':'y'}) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, packages={'x':'y'}) self.assertRaises(DistutilsSetupError, ! self.dist.include, ext_modules={'x':'y'}) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, ext_modules={'x':'y'}) self.assertRaises(DistutilsSetupError, ! self.dist.include, package_dir=['q']) self.assertRaises(DistutilsSetupError, ! self.dist.exclude, package_dir=['q']) def testCmdLineOpts(self): ! self.assertEqual( ! self.dist.get_cmdline_options(), ! {'install':{'prefix':'/usr/lib', 'install-lib':'/test'}, ! 'build': {'quiet':None}, ! 'build_ext': {'inplace':None}, ! }) *************** *** 296,344 **** py_modules=['bar_et'], remove=['bar.ext'], ), ! 'baz': Feature( ! "baz", optional=False, packages=['pkg.baz'], ! scripts = ['scripts/baz_it'], ! libraries=[('libfoo','foo/foofoo.c')] ), 'dwim': Feature("DWIM", available=False, remove='bazish'), ! }, script_args=['--without-bar', 'install'], ! packages = ['pkg.bar', 'pkg.foo'], ! py_modules = ['bar_et', 'bazish'], ! ext_modules = [Extension('bar.ext',['bar.c'])] ) def testDefaults(self): self.failIf( ! Feature( ! "test",standard=True,remove='x',available=False ! ).include_by_default() ! ) self.failUnless( ! Feature("test",standard=True,remove='x').include_by_default() ! ) # Feature must have either kwargs, removes, or requires self.assertRaises(DistutilsSetupError, Feature, "test") def testAvailability(self): ! self.assertRaises( ! DistutilsPlatformError, ! self.dist.features['dwim'].include_in, self.dist ! ) def testFeatureOptions(self): dist = self.dist ! self.failUnless( ! ('with-dwim',None,'include DWIM') in dist.feature_options ! ) ! self.failUnless( ! ('without-dwim',None,'exclude DWIM (default)') in dist.feature_options ! ) ! self.failUnless( ! ('with-bar',None,'include bar (default)') in dist.feature_options ! ) ! self.failUnless( ! ('without-bar',None,'exclude bar') in dist.feature_options ! ) self.assertEqual(dist.feature_negopt['without-foo'],'with-foo') self.assertEqual(dist.feature_negopt['without-bar'],'with-bar') --- 245,283 ---- py_modules=['bar_et'], remove=['bar.ext'], ), ! 'baz': Feature("baz", optional=False, packages=['pkg.baz'], ! scripts=['scripts/baz_it'], ! libraries=[('libfoo','foo/foofoo.c')] ), 'dwim': Feature("DWIM", available=False, remove='bazish'), ! }, script_args=['--without-bar', 'install'], ! packages=['pkg.bar', 'pkg.foo'], ! py_modules=['bar_et', 'bazish'], ! ext_modules=[Extension('bar.ext',['bar.c'])] ) def testDefaults(self): self.failIf( ! Feature("test",standard=True,remove='x',available=False ! ).include_by_default()) self.failUnless( ! Feature("test",standard=True,remove='x').include_by_default()) # Feature must have either kwargs, removes, or requires self.assertRaises(DistutilsSetupError, Feature, "test") def testAvailability(self): ! self.assertRaises(DistutilsPlatformError, ! self.dist.features['dwim'].include_in, self.dist) def testFeatureOptions(self): dist = self.dist ! self.failUnless(('with-dwim', None, 'include DWIM') ! in dist.feature_options) ! self.failUnless(('without-dwim', None, 'exclude DWIM (default)') ! in dist.feature_options) ! self.failUnless(('with-bar', None, 'include bar (default)') ! in dist.feature_options) ! self.failUnless(('without-bar', None, 'exclude bar') ! in dist.feature_options) self.assertEqual(dist.feature_negopt['without-foo'],'with-foo') self.assertEqual(dist.feature_negopt['without-bar'],'with-bar') *************** *** 364,370 **** def testFeatureWithInvalidRemove(self): ! self.assertRaises( ! SystemExit, makeSetup, features = {'x':Feature('x', remove='y')} ! ) class TestCommandTests(TestCase): --- 303,309 ---- def testFeatureWithInvalidRemove(self): ! self.assertRaises(SystemExit, ! makeSetup, features={'x': Feature('x', remove='y')}) ! class TestCommandTests(TestCase): *************** *** 389,393 **** test_suite='bar.tests', script_args=['test','-m','foo.tests'] ! ).get_command_obj('test') ts3.ensure_finalized() self.assertEqual(ts3.test_module, 'foo.tests') --- 328,332 ---- test_suite='bar.tests', script_args=['test','-m','foo.tests'] ! ).get_command_obj('test') ts3.ensure_finalized() self.assertEqual(ts3.test_module, 'foo.tests') *************** *** 397,401 **** ts4 = makeSetup( script_args=['test','-m','bar.tests', '-s','foo.tests.suite'] ! ).get_command_obj('test') self.assertRaises(DistutilsOptionError, ts4.ensure_finalized) --- 336,340 ---- ts4 = makeSetup( script_args=['test','-m','bar.tests', '-s','foo.tests.suite'] ! ).get_command_obj('test') self.assertRaises(DistutilsOptionError, ts4.ensure_finalized) *************** *** 406,412 **** - - - testClasses = (DependsTests, DistroTests, FeatureTests, TestCommandTests) --- 345,348 ---- *************** *** 414,451 **** return TestSuite([makeSuite(t,'test') for t in testClasses]) ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! --- 350,356 ---- return TestSuite([makeSuite(t,'test') for t in testClasses]) ! if __name__ == "__main__": ! # We have to run this from an imported setuptools.tests package, ! # since the tests themselves rely on __path__. ! import setuptools.tests ! main(defaultTest="setuptools.tests.test_suite") From facundobatista at users.sourceforge.net Mon Apr 5 18:07:24 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Mon Apr 5 18:20:03 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.18, 1.19 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27155 Modified Files: Decimal.py Log Message: Added __r*__ methods. Fixed __sub__. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Decimal.py 4 Apr 2004 16:14:25 -0000 1.18 --- Decimal.py 5 Apr 2004 22:07:21 -0000 1.19 *************** *** 96,107 **** """ ! # 0.7.3 2003.4.04 facundobatista: Added _convert_other method, for implicit ! # constructions, and more checks when constructing from ! # tuples. Fixed __sub__ to modify a copy of the instance. ! # 0.7.2 2003.4.02 facundobatista: Fixed __pow__ to run the example ok. Added ! # from_float method. Fixed isnan to accept empty strings. ! # 0.7.1 2003.3.08 facundobatista: Corrected initial examples ! # 0.7.0 2003.2.28 eprice: More changes. Contexts done nicely, exponent limits ! # 0.6.0 2003.2.24 eprice: Many changes. No exponent limits # Aahz: --- 96,112 ---- """ ! # facundobatista: ! # 0.7.4 2003.04.05 Added rdiv, rdivmod, rmod, rpow, rfloordiv special methods. ! # Fixed sub. ! # 0.7.3 2003.04.04 Added _convert_other method, for implicit constructions, ! # and more checks when constructing from tuples. Fixed ! # __sub__ to modify a copy of the instance. ! # 0.7.2 2003.04.02 Fixed __pow__ to run the example ok. Added from_float ! # method. Fixed isnan to accept empty strings. ! # 0.7.1 2003.03.08 Corrected initial examples ! ! # eprice: ! # 0.7.0 2003.2.28 More changes. Contexts done nicely, exponent limits ! # 0.6.0 2003.2.24 Many changes. No exponent limits # Aahz: *************** *** 973,977 **** if context is None: context = getcontext() ! tmp = self._convert_other(other) ans = self._check_nans(other, context=context) --- 978,982 ---- if context is None: context = getcontext() ! other = self._convert_other(other) ans = self._check_nans(other, context=context) *************** *** 982,986 **** # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.) # so we change the sign directly to a copy ! tmp = Decimal(tmp) tmp._sign = 1-tmp._sign --- 987,991 ---- # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.) # so we change the sign directly to a copy ! tmp = Decimal(other) tmp._sign = 1-tmp._sign *************** *** 1282,1287 **** return ans ! def __rdiv__(self, other): ! raise NotImplementedError def __divmod__(self, other, context=None): --- 1287,1295 ---- return ans ! def __rdiv__(self, other, context=None): ! """Swaps self/other and returns __div__.""" ! other = self._convert_other(other) ! return other.__div__(self, context=context) ! __rtruediv__ = __rdiv__ def __divmod__(self, other, context=None): *************** *** 1291,1296 **** return self._divide(other, 1, context) ! def __rdivmod__(self, other): ! raise NotImplementedError def __mod__(self, other, context=None): --- 1299,1306 ---- return self._divide(other, 1, context) ! def __rdivmod__(self, other, context=None): ! """Swaps self/other and returns __divmod__.""" ! other = self._convert_other(other) ! return other.__divmod__(self, context=context) def __mod__(self, other, context=None): *************** *** 1311,1316 **** return self._divide(other, 3, context)[1] ! def __rmod__(self, other): ! raise NotImplementedError def remainder_near(self, other, context=None): --- 1321,1328 ---- return self._divide(other, 3, context)[1] ! def __rmod__(self, other, context=None): ! """Swaps self/other and returns __mod__.""" ! other = self._convert_other(other) ! return other.__mod__(self, context=context) def remainder_near(self, other, context=None): *************** *** 1394,1397 **** --- 1406,1414 ---- return self._divide(other, 2, context)[0] + def __rfloordiv__(self, other, context=None): + """Swaps self/other and returns __floordiv__.""" + other = self._convert_other(other) + return other.__floordiv__(self, context=context) + def __float__(self): """Float representation.""" *************** *** 1794,1797 **** --- 1811,1819 ---- return val + def __rpow__(self, other, context=None): + """Swaps self/other and returns __pow__.""" + other = self._convert_other(other) + return other.__pow__(self, context=context) + def normalize(self, context=None): """Normalize- strip trailing 0s, change anything equal to 0 to 0e0""" From facundobatista at users.sourceforge.net Mon Apr 5 18:08:44 2004 From: facundobatista at users.sourceforge.net (facundobatista@users.sourceforge.net) Date: Mon Apr 5 18:21:24 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal test_Decimal.py, 1.15, 1.16 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27419 Modified Files: test_Decimal.py Log Message: Adjusted and fixed several test cases. Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_Decimal.py 4 Apr 2004 16:15:12 -0000 1.15 --- test_Decimal.py 5 Apr 2004 22:08:41 -0000 1.16 *************** *** 15,18 **** --- 15,20 ---- """ + # 0.1.7 2003.04.05 fb: Adjusted several test cases. Eliminated interaction + # with float in comparations and min/max test cases. # 0.1.6 2003.04.04 fb: Extended explicit construction test case from tuples. # 0.1.5 2003.04.02 fb: Adjusted explicit construction test cases. *************** *** 469,473 **** # # - Explicit Construction ! # - etc... # --- 471,478 ---- # # - Explicit Construction ! # - Implicit Construction ! # - Arithmetic Operators ! # - Use of Context ! # - Usability # *************** *** 714,718 **** #inline with other type d1 += 5 ! self.assertEqual(d1, Decimal('-6.1')) def test_subtraction(self): --- 719,723 ---- #inline with other type d1 += 5 ! self.assertEqual(d1, Decimal('16.1')) def test_subtraction(self): *************** *** 733,737 **** #with other type, right c = 5 - d1 ! self.assertEqual(c, Decimal('6.1')) self.assertEqual(type(c), type(d1)) --- 738,742 ---- #with other type, right c = 5 - d1 ! self.assertEqual(c, Decimal('16.1')) self.assertEqual(type(c), type(d1)) *************** *** 742,746 **** #inline with other type d1 -= 5 ! self.assertEqual(d1, Decimal('-16.1')) def test_multiplication(self): --- 747,751 ---- #inline with other type d1 -= 5 ! self.assertEqual(d1, Decimal('-38.3')) def test_multiplication(self): *************** *** 770,774 **** #inline with other type d1 *= 5 ! self.assertEqual(d1, Decimal('-25')) def test_division(self): --- 775,779 ---- #inline with other type d1 *= 5 ! self.assertEqual(d1, Decimal('-75')) def test_division(self): *************** *** 798,802 **** #inline with other type d1 /= 4 ! self.assertEqual(d1, Decimal('-1.25')) def test_floor_division(self): --- 803,807 ---- #inline with other type d1 /= 4 ! self.assertEqual(d1, Decimal('-0.625')) def test_floor_division(self): *************** *** 821,829 **** #inline with decimal ! d1 /= d2 self.assertEqual(d1, Decimal('2')) #inline with other type ! d1 /= 4 self.assertEqual(d1, Decimal('1')) --- 826,834 ---- #inline with decimal ! d1 //= d2 self.assertEqual(d1, Decimal('2')) #inline with other type ! d1 //= 2 self.assertEqual(d1, Decimal('1')) *************** *** 854,858 **** #inline with other type d1 **= 4 ! self.assertEqual(d1, Decimal('625')) def test_module(self): --- 859,863 ---- #inline with other type d1 **= 4 ! self.assertEqual(d1, Decimal('390625')) def test_module(self): *************** *** 915,921 **** #test '+' ! d = Decimal(45) ! self.assertEqual(+d, d) ! self.assertEqual(id(+d), id(d)) #test '-' --- 920,924 ---- #test '+' ! self.assertEqual(+Decimal(45), Decimal(+45)) #test '-' *************** *** 998,1013 **** self.assertEqual(cmp(dc,45), 0) - #a Decimal and a float - self.failUnless(dc > 23.42) - self.failUnless(23.42 < dc) - self.failUnless(da == 23.42) - self.assertEqual(cmp(dc,23.42), 1) - self.assertEqual(cmp(23.42,dc), -1) - self.assertEqual(cmp(da,23.42), 0) - #a Decimal and uncomparable ! self.assertRaises(TypeError, da == 'ugly') ! self.assertRaises(TypeError, da == '32.7') ! self.assertRaises(TypeError, da == object) def test_copy_methods(self): --- 1001,1016 ---- self.assertEqual(cmp(dc,45), 0) #a Decimal and uncomparable ! try: da == 'ugly' ! except TypeError: pass ! else: self.fail('Did not raised an error!') ! ! try: da == '32.7' ! except TypeError: pass ! else: self.fail('Did not raised an error!') ! ! try: da == object ! except TypeError: pass ! else: self.fail('Did not raised an error!') def test_copy_methods(self): *************** *** 1036,1043 **** self.assertEqual(hash(Decimal(23)), hash(23)) ! #the same hash that to an "exact float" ! self.assertEqual(hash(Decimal('32.32')), hash(32.32)) ! ! #the same hash that to an "inexact float" self.assertEqual(hash(Decimal('23.72')), hash(23.72)) --- 1039,1043 ---- self.assertEqual(hash(Decimal(23)), hash(23)) ! #the same hash that a float self.assertEqual(hash(Decimal('23.72')), hash(23.72)) *************** *** 1049,1054 **** l1 = 15 l2 = 28 - f1 = 15.32 - f2 = 28.5 #between Decimals --- 1049,1052 ---- *************** *** 1064,1073 **** self.failUnless(max(d2,l1) is d2) - #between Decimal and float - self.failUnless(min(d1,f2) is d1) - self.failUnless(min(f2,d1) is d1) - self.failUnless(max(f1,d2) is d2) - self.failUnless(max(d2,f1) is d2) - def test_as_boolean(self): '''Test that it can be used as boolean.''' --- 1062,1065 ---- From tmnukajcgs at hotmail.com Mon Apr 5 06:38:13 2004 From: tmnukajcgs at hotmail.com (Mitchell Mooney) Date: Mon Apr 5 18:26:55 2004 Subject: [Python-checkins] super penile advancments Message-ID: stick another 3 inches in next time you bang a chick... http://prim.nzzesrc.com/vp5 take off- http://trillionth.diffrs.com/a.html mitigate drexel shattuck From sox0mzjjx at public.icyb.kiev.ua Mon Apr 5 23:34:51 2004 From: sox0mzjjx at public.icyb.kiev.ua (Fredrick Dewitt) Date: Tue Apr 6 00:38:55 2004 Subject: [Python-checkins] This company deserves your immediate attention now l kvchbz swmnzyf Message-ID: <2gdo5h1y-i4$51t8mm-7q3-84926@xjh.c7h1.2.vng> ***ARET****ARET****ARET****ARET****ARET****ARET*** Undervalued Market Report For Largest Percentage Gain Leaders Opening Price: 2 cents Immediate Target: 10 cents in 10 days Near-Term Proj. High: 25 cents Current Market Value (Approx): 1.5 million **Our Picks Are On Fire!** Our last pick for huge percentage gains (GDLS) soared from 23 to .83 (261% on 3/29) immediately following our report. We believe the gains for ARET will run circles around all our other picks for the year. Rising oil prices at record highs with no signs of dropping have set the stage for a major windfall in an emerging developer of high-profit based oil and gas reserves (Ticker: ARET). Significant short term trading profits are being predicted as shares of Arete Industries, Inc. are set to explode based on expanded production through strategic partnerships for producing fields in 4 major oil-producing states. ARET just released major news and we believe there is much more to follow. There is strong evidence of big block buying indicating that an explosive move is coming on a huge near-term announcement. As recently reported, ARET is executing the launch of a $1 Billion financed "Master Energy Fund" which is capped at $100 Million increments to fund the Company's energy projects. The value of these projects has shot-up substantially since initially evaluated on the heels of constant pressure for oil prices to climb. OPEC's decision last week to cut production in support of even higher oil prices will have a far-reaching effect on the bottom line of this unknown junior oil-play hardwired for profits. ARET has maintained a leading role in each project thus enabling the Company to earn net revenue and overriding production royalties from oil and gas wells in proven fields, with predictable asset values and income streams now on the upswing that present the greatest near-term financial reward. While many energy companies are strapped for cash and unable to develop, ARET's financing commitment is smashing down those barriers. ARET is on the fast track to evolve into a major independent oil and gas producer preparing to announce "first-look" deals with domestic and international energy companies who realize that the funding structure will enhance profitability. Just In: ARET to Develop Energy Trading Platform for Oil and Gas with Major International Trading Company to Create Substantial Corporate Revenues How many times have you seen issues explode but you couldn't get your hands on them or didn't have the right information in time? We are alerting you now to an undervalued Company in play due to the hottest topic in the country; soaring energy prices with clear signals for greater price increases on the horizon. Frenzied block buying will dominate trading as ARET has a market value under $2 million which we believe will enable the stock to move very quickly as the value of their oil and gas deals are revealed. Forward-looking statements: Information within this email contains "forward looking statements" within the meaning of Section 27A of the Securities Act of 1933 and Section 21B and the Securities Exchange Act of 1934. Any statements that express or involve discussions with respect to predictions, goals, expectations, beliefs, plans, projections, objectives, assumptions or future events or performance are not statements of historical fact and may be "forward looking statements". Forward looking statements are based upon expectations, estimates and projections, at the time the statements are made that involve a number of risks and uncertainties which could cause actual results or events to differ materially from those presently anticipated. Forward looking statements in this action may be identified through the use of words such as: "projects", "foresee", "expects", "estimates", "believes", "understands", "will", "anticipates", or that by statements indicating certain actions "may", "could", or "might" occur. All information provided within this email pertaining to investing, stocks, securities must be understood as information provided and not investment advice. Emerging Equity Alert advises all readers and subscribers to seek advice from a registered professional securities representative before deciding to trade in stocks featured within this email. None of the material within this report shall be construed as any kind of investment advice. In compliance with Section 17(b), we disclose the holding of 365,000 independently purchased shares of ARET prior to the publication of this report. Be aware of an inherent conflict of interest resulting from such holdings due to our intent to profit from the liquidation of these shares. Shares may be sold at any time, even after positive statements have been made regarding the above company. Since we own shares, there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward- looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward-looking statements. tgw cdql From perky at users.sourceforge.net Tue Apr 6 03:24:53 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 6 03:37:35 2004 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.210, 2.211 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16466/Objects Modified Files: unicodeobject.c Log Message: SF Patch #926375: Remove a useless UTF-16 support code that is never been used. (Suggested by Martin v. Loewis) Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.210 retrieving revision 2.211 diff -C2 -d -r2.210 -r2.211 *** unicodeobject.c 5 Feb 2004 17:35:59 -0000 2.210 --- unicodeobject.c 6 Apr 2004 07:24:51 -0000 2.211 *************** *** 406,410 **** PyObject *PyUnicode_FromOrdinal(int ordinal) { ! Py_UNICODE s[2]; #ifdef Py_UNICODE_WIDE --- 406,410 ---- PyObject *PyUnicode_FromOrdinal(int ordinal) { ! Py_UNICODE s[1]; #ifdef Py_UNICODE_WIDE *************** *** 424,444 **** #endif ! if (ordinal <= 0xffff) { ! /* UCS-2 character */ ! s[0] = (Py_UNICODE) ordinal; ! return PyUnicode_FromUnicode(s, 1); ! } ! else { ! #ifndef Py_UNICODE_WIDE ! /* UCS-4 character. store as two surrogate characters */ ! ordinal -= 0x10000L; ! s[0] = 0xD800 + (Py_UNICODE) (ordinal >> 10); ! s[1] = 0xDC00 + (Py_UNICODE) (ordinal & 0x03FF); ! return PyUnicode_FromUnicode(s, 2); ! #else ! s[0] = (Py_UNICODE)ordinal; ! return PyUnicode_FromUnicode(s, 1); ! #endif ! } } --- 424,429 ---- #endif ! s[0] = (Py_UNICODE)ordinal; ! return PyUnicode_FromUnicode(s, 1); } From 424hnlpdr at ba-ravensburg.de Sun Apr 4 18:51:50 2004 From: 424hnlpdr at ba-ravensburg.de (Carol Temple) Date: Tue Apr 6 04:40:44 2004 Subject: [Python-checkins] This company deserves your immediate attention now wcjqm Message-ID: <7147cti-cn3-44g4f36@vklu2v5y.0w9> April 2004 Top Pick of the Month Life Energy and Technology Holdings, Inc. (OTCBB: LETH) LETH Receives $250,000,000 in Financing to Fund the Manufacture of the Environmentally Friendly Biosphere Process System "waste-to-energy" Units in the United States. First Unit to Roll-out in New Orleans in early Second Quarter. We are expecting earth-shattering upcoming news leading a strong rally in LETH for a Company that has announced over $100 Million in sales orders in the past year, and tops that record-setting achievement by acquiring the equivalent of $8.62 per share in cash for major worldwide expansion. **Our readers grabbed substantial profits for our March pick** USHG featured at .75 Reached 3.65 in 8 days! Traded as high as 7.00 since! The Biosphere Process System - Soaring Worldwide Demand: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega-watts per hour of electricity which is then sold to replenish the local or national grid. The Biosphere Process succeeds in filling an urgent worldwide need for cost-effective renewable energy sources and a corresponding universal need to solve critical problems in the disposal of waste. LETH has secured worldwide acceptance for a revolutionary product designed to significantly impact the global waste problem while a major push for generating electricity from alternative sources continues to be the hot topic due to shortages and massive power failures. Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that this $1.50 stock now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! LETH Stock Guidance: Current Price: 1.65 Near-Term Target: 4.80 Projected High for '04: 12.50 LETH's Blue Chip Partner - Fortifying the System: LETH is an alliance partner with Tetra Tech, Inc. (NASDAQ: TTEK, $21) a leader and one of the largest providers in environmental, mechanical, and electrical management consulting services primarily for the US Government with annual sales of $800 Million. Tetra Tech will coordinate the securing of necessary permits, installation, and continuous worldwide monitoring of the Biosphere Process System for LETH. Tetra Tech is now in the process of obtaining Department of Environmental Quality permitting for the Biosphere Process in the state of Louisiana. This is a monumental event for LETH which opens the floodgates for major project revenues in Louisiana while having a parallel effect on LETH stock in the form of a huge near-term announcement. Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. As our Top Stock Pick for April, we anticipate the continuation of strong positive developments that will ignite LETH shares which carry our highest rating for short-term trading profits followed by robust long-term capital gains. Top Pick of the Month cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of Top Pick of the Month. Top Pick of the Month recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. Top Pick of the Month is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. Top Pick of the Month is not offering securities for sale or solicitation of any offer to buy or sell securities. Top Pick of the Month has received twenty eight thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. soeggpfwisedrakns jftfzehs qb f gjijietli From rhettinger at users.sourceforge.net Tue Apr 6 05:37:37 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Apr 6 05:50:20 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.389,2.390 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5777 Modified Files: ceval.c Log Message: Coded WHY flags as bitfields (taking inspiration from tp_flags). This allows multiple flags to be tested in a single compare which eliminates unnecessary compares and saves a few bytes. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.389 retrieving revision 2.390 diff -C2 -d -r2.389 -r2.390 *** ceval.c 5 Apr 2004 19:36:21 -0000 2.389 --- ceval.c 6 Apr 2004 09:37:35 -0000 2.390 *************** *** 538,552 **** /* Status code for main loop (reason for stack unwind) */ ! enum why_code { ! WHY_NOT, /* No error */ ! WHY_EXCEPTION, /* Exception occurred */ ! WHY_RERAISE, /* Exception re-raised by 'finally' */ ! WHY_RETURN, /* 'return' statement */ ! WHY_BREAK, /* 'break' statement */ ! WHY_CONTINUE, /* 'continue' statement */ ! WHY_YIELD /* 'yield' operator */ ! }; ! static enum why_code do_raise(PyObject *, PyObject *, PyObject *); static int unpack_iterable(PyObject *, int, PyObject **); --- 538,550 ---- /* Status code for main loop (reason for stack unwind) */ ! #define WHY_NOT 0x0001 ! #define WHY_EXCEPTION 0x0002 ! #define WHY_RERAISE 0x0004 ! #define WHY_RETURN 0x0008 ! #define WHY_BREAK 0x0010 ! #define WHY_CONTINUE 0x0020 ! #define WHY_YIELD 0x0040 ! static int do_raise(PyObject *, PyObject *, PyObject *); static int unpack_iterable(PyObject *, int, PyObject **); *************** *** 581,585 **** register int opcode=0; /* Current opcode */ register int oparg=0; /* Current opcode argument, if any */ ! register enum why_code why; /* Reason for block stack unwind */ register int err; /* Error status -- nonzero if error */ register PyObject *x; /* Result object -- NULL if error */ --- 579,583 ---- register int opcode=0; /* Current opcode */ register int oparg=0; /* Current opcode argument, if any */ ! register int why; /* Reason for block stack unwind */ register int err; /* Error status -- nonzero if error */ register PyObject *x; /* Result object -- NULL if error */ *************** *** 1653,1660 **** v = POP(); if (PyInt_Check(v)) { ! why = (enum why_code) PyInt_AS_LONG(v); assert(why != WHY_YIELD); ! if (why == WHY_RETURN || ! why == WHY_CONTINUE) retval = POP(); } --- 1651,1657 ---- v = POP(); if (PyInt_Check(v)) { ! why = (int) PyInt_AS_LONG(v); assert(why != WHY_YIELD); ! if (why & (WHY_RETURN | WHY_CONTINUE)) retval = POP(); } *************** *** 2289,2293 **** /* Double-check exception status */ ! if (why == WHY_EXCEPTION || why == WHY_RERAISE) { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_SystemError, --- 2286,2290 ---- /* Double-check exception status */ ! if (why & (WHY_EXCEPTION | WHY_RERAISE)) { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_SystemError, *************** *** 2380,2385 **** } else { ! if (why == WHY_RETURN || ! why == WHY_CONTINUE) PUSH(retval); v = PyInt_FromLong((long)why); --- 2377,2381 ---- } else { ! if (why & (WHY_RETURN | WHY_CONTINUE)) PUSH(retval); v = PyInt_FromLong((long)why); *************** *** 2412,2416 **** if (tstate->use_tracing) { if (tstate->c_tracefunc ! && (why == WHY_RETURN || why == WHY_YIELD)) { if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, f, --- 2408,2412 ---- if (tstate->use_tracing) { if (tstate->c_tracefunc ! && (why & (WHY_RETURN | WHY_YIELD))) { if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, f, *************** *** 2839,2843 **** /* Logic for the raise statement (too complicated for inlining). This *consumes* a reference count to each of its arguments. */ ! static enum why_code do_raise(PyObject *type, PyObject *value, PyObject *tb) { --- 2835,2839 ---- /* Logic for the raise statement (too complicated for inlining). This *consumes* a reference count to each of its arguments. */ ! static int do_raise(PyObject *type, PyObject *value, PyObject *tb) { From rhettinger at users.sourceforge.net Tue Apr 6 06:11:12 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Apr 6 06:23:57 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.390,2.391 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11958 Modified Files: ceval.c Log Message: Simplify previous checkin (bitfields for WHY codes). Restores the self-documenting enum declaration. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.390 retrieving revision 2.391 diff -C2 -d -r2.390 -r2.391 *** ceval.c 6 Apr 2004 09:37:35 -0000 2.390 --- ceval.c 6 Apr 2004 10:11:10 -0000 2.391 *************** *** 538,550 **** /* Status code for main loop (reason for stack unwind) */ ! #define WHY_NOT 0x0001 ! #define WHY_EXCEPTION 0x0002 ! #define WHY_RERAISE 0x0004 ! #define WHY_RETURN 0x0008 ! #define WHY_BREAK 0x0010 ! #define WHY_CONTINUE 0x0020 ! #define WHY_YIELD 0x0040 ! static int do_raise(PyObject *, PyObject *, PyObject *); static int unpack_iterable(PyObject *, int, PyObject **); --- 538,552 ---- /* Status code for main loop (reason for stack unwind) */ ! enum why_code { ! WHY_NOT = 0x0001, /* No error */ ! WHY_EXCEPTION = 0x0002, /* Exception occurred */ ! WHY_RERAISE = 0x0004, /* Exception re-raised by 'finally' */ ! WHY_RETURN = 0x0008, /* 'return' statement */ ! WHY_BREAK = 0x0010, /* 'break' statement */ ! WHY_CONTINUE = 0x0020, /* 'continue' statement */ ! WHY_YIELD = 0x0040 /* 'yield' operator */ ! }; ! static enum why_code do_raise(PyObject *, PyObject *, PyObject *); static int unpack_iterable(PyObject *, int, PyObject **); *************** *** 579,583 **** register int opcode=0; /* Current opcode */ register int oparg=0; /* Current opcode argument, if any */ ! register int why; /* Reason for block stack unwind */ register int err; /* Error status -- nonzero if error */ register PyObject *x; /* Result object -- NULL if error */ --- 581,585 ---- register int opcode=0; /* Current opcode */ register int oparg=0; /* Current opcode argument, if any */ ! register enum why_code why; /* Reason for block stack unwind */ register int err; /* Error status -- nonzero if error */ register PyObject *x; /* Result object -- NULL if error */ *************** *** 1651,1655 **** v = POP(); if (PyInt_Check(v)) { ! why = (int) PyInt_AS_LONG(v); assert(why != WHY_YIELD); if (why & (WHY_RETURN | WHY_CONTINUE)) --- 1653,1657 ---- v = POP(); if (PyInt_Check(v)) { ! why = (enum why_code) PyInt_AS_LONG(v); assert(why != WHY_YIELD); if (why & (WHY_RETURN | WHY_CONTINUE)) *************** *** 2835,2839 **** /* Logic for the raise statement (too complicated for inlining). This *consumes* a reference count to each of its arguments. */ ! static int do_raise(PyObject *type, PyObject *value, PyObject *tb) { --- 2837,2841 ---- /* Logic for the raise statement (too complicated for inlining). This *consumes* a reference count to each of its arguments. */ ! static enum why_code do_raise(PyObject *type, PyObject *value, PyObject *tb) { From bwarsaw at users.sourceforge.net Tue Apr 6 09:09:17 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Apr 6 09:22:01 2004 Subject: [Python-checkins] python/nondist/peps pep-0328.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13310 Modified Files: pep-0328.txt Log Message: a bit more rationale for absolute imports Index: pep-0328.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0328.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0328.txt 4 Apr 2004 02:37:57 -0000 1.4 --- pep-0328.txt 6 Apr 2004 13:09:14 -0000 1.5 *************** *** 84,88 **** refers to a top-level module or to another module inside the package. ! To resolve the ambiguity, it is proposed that ``foo`` will always be a module or package reachable from ``sys.path``. --- 84,91 ---- refers to a top-level module or to another module inside the package. ! Let's say today it refers to a module internal to the package. Then ! tomorrow, the standard library decides to add its own foo package that ! you'd like to use. You can't without renaming your internal module. ! To resolve these ambiguities, it is proposed that ``foo`` will always be a module or package reachable from ``sys.path``. From akuchling at users.sourceforge.net Tue Apr 6 15:42:37 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Apr 6 15:55:23 2004 Subject: [Python-checkins] python/dist/src/Lib reconvert.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27897 Modified Files: reconvert.py Log Message: Remove specific Python version from #! Index: reconvert.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/reconvert.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** reconvert.py 4 Sep 2001 15:18:54 -0000 1.6 --- reconvert.py 6 Apr 2004 19:42:34 -0000 1.7 *************** *** 1,3 **** ! #! /usr/bin/env python1.5 r"""Convert old ("regex") regular expressions to new syntax ("re"). --- 1,3 ---- ! #! /usr/bin/env python r"""Convert old ("regex") regular expressions to new syntax ("re"). From akuchling at users.sourceforge.net Tue Apr 6 15:43:09 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Apr 6 15:55:54 2004 Subject: [Python-checkins] python/dist/src/Lib urllib2.py,1.63,1.64 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28027 Modified Files: urllib2.py Log Message: Fix comment typo Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** urllib2.py 24 Feb 2004 19:40:33 -0000 1.63 --- urllib2.py 6 Apr 2004 19:43:03 -0000 1.64 *************** *** 1016,1020 **** """Parse lists as described by RFC 2068 Section 2. ! In particular, parse comman-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. --- 1016,1020 ---- """Parse lists as described by RFC 2068 Section 2. ! In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. From akuchling at users.sourceforge.net Tue Apr 6 15:44:23 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Apr 6 15:57:09 2004 Subject: [Python-checkins] python/nondist/sandbox/Lib bdist_dpkg.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28306 Modified Files: bdist_dpkg.py Log Message: Remove version hack Index: bdist_dpkg.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/Lib/bdist_dpkg.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bdist_dpkg.py 25 Sep 2003 12:34:30 -0000 1.4 --- bdist_dpkg.py 6 Apr 2004 19:44:20 -0000 1.5 *************** *** 92,96 **** # I'm running out of the CVS trunk, but don't have it # installed as python2.4. - pyversion = '2.2' package_name = 'python%s-%s' % (pyversion, dist.get_name().lower()) d = {'name':dist.get_name(), --- 92,95 ---- From rhettinger at users.sourceforge.net Wed Apr 7 07:39:24 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Apr 7 07:52:17 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.391,2.392 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4752 Modified Files: ceval.c Log Message: Small code improvements for readability, code size, and/or speed. BINARY_SUBSCR: * invert test for normal case fall through * eliminate err handling code by jumping to slow_case LOAD_LOCALS: * invert test for normal case fall through * continue instead of break for the non-error case STORE_NAME and DELETE_NAME: * invert test for normal case fall through LOAD_NAME: * continue instead of break for the non-error case DELETE_FAST: * invert test for normal case fall through LOAD_DEREF: * invert test for normal case fall through * continue instead of break for the non-error case Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.391 retrieving revision 2.392 diff -C2 -d -r2.391 -r2.392 *** ceval.c 6 Apr 2004 10:11:10 -0000 2.391 --- ceval.c 7 Apr 2004 11:39:21 -0000 2.392 *************** *** 1156,1171 **** if (i < 0) i += PyList_GET_SIZE(v); ! if (i < 0 || ! i >= PyList_GET_SIZE(v)) { ! PyErr_SetString(PyExc_IndexError, ! "list index out of range"); ! x = NULL; ! } ! else { x = PyList_GET_ITEM(v, i); Py_INCREF(x); } } else x = PyObject_GetItem(v, w); Py_DECREF(v); --- 1156,1168 ---- if (i < 0) i += PyList_GET_SIZE(v); ! if (i >= 0 && i < PyList_GET_SIZE(v)) { x = PyList_GET_ITEM(v, i); Py_INCREF(x); } + else + goto slow_get; } else + slow_get: x = PyObject_GetItem(v, w); Py_DECREF(v); *************** *** 1609,1619 **** case LOAD_LOCALS: ! if ((x = f->f_locals) == NULL) { ! PyErr_SetString(PyExc_SystemError, ! "no locals"); ! break; } ! Py_INCREF(x); ! PUSH(x); break; --- 1606,1615 ---- case LOAD_LOCALS: ! if ((x = f->f_locals) != NULL) { ! Py_INCREF(x); ! PUSH(x); ! continue; } ! PyErr_SetString(PyExc_SystemError, "no locals"); break; *************** *** 1688,1712 **** w = GETITEM(names, oparg); v = POP(); ! if ((x = f->f_locals) == NULL) { ! PyErr_Format(PyExc_SystemError, ! "no locals found when storing %s", ! PyObject_REPR(w)); break; } ! err = PyDict_SetItem(x, w, v); ! Py_DECREF(v); break; case DELETE_NAME: w = GETITEM(names, oparg); ! if ((x = f->f_locals) == NULL) { ! PyErr_Format(PyExc_SystemError, ! "no locals when deleting %s", ! PyObject_REPR(w)); break; } ! if ((err = PyDict_DelItem(x, w)) != 0) ! format_exc_check_arg(PyExc_NameError, ! NAME_ERROR_MSG ,w); break; --- 1684,1708 ---- w = GETITEM(names, oparg); v = POP(); ! if ((x = f->f_locals) != NULL) { ! err = PyDict_SetItem(x, w, v); ! Py_DECREF(v); break; } ! PyErr_Format(PyExc_SystemError, ! "no locals found when storing %s", ! PyObject_REPR(w)); break; case DELETE_NAME: w = GETITEM(names, oparg); ! if ((x = f->f_locals) != NULL) { ! if ((err = PyDict_DelItem(x, w)) != 0) ! format_exc_check_arg(PyExc_NameError, ! NAME_ERROR_MSG ,w); break; } ! PyErr_Format(PyExc_SystemError, ! "no locals when deleting %s", ! PyObject_REPR(w)); break; *************** *** 1795,1799 **** Py_INCREF(x); PUSH(x); ! break; case LOAD_GLOBAL: --- 1791,1795 ---- Py_INCREF(x); PUSH(x); ! continue; case LOAD_GLOBAL: *************** *** 1841,1854 **** case DELETE_FAST: x = GETLOCAL(oparg); ! if (x == NULL) { ! format_exc_check_arg( ! PyExc_UnboundLocalError, ! UNBOUNDLOCAL_ERROR_MSG, ! PyTuple_GetItem(co->co_varnames, oparg) ! ); ! break; } ! SETLOCAL(oparg, NULL); ! continue; case LOAD_CLOSURE: --- 1837,1850 ---- case DELETE_FAST: x = GETLOCAL(oparg); ! if (x != NULL) { ! SETLOCAL(oparg, NULL); ! continue; } ! format_exc_check_arg( ! PyExc_UnboundLocalError, ! UNBOUNDLOCAL_ERROR_MSG, ! PyTuple_GetItem(co->co_varnames, oparg) ! ); ! break; case LOAD_CLOSURE: *************** *** 1861,1888 **** x = freevars[oparg]; w = PyCell_Get(x); ! if (w == NULL) { ! err = -1; ! /* Don't stomp existing exception */ ! if (PyErr_Occurred()) ! break; ! if (oparg < f->f_ncells) { ! v = PyTuple_GetItem(co->co_cellvars, ! oparg); ! format_exc_check_arg( ! PyExc_UnboundLocalError, ! UNBOUNDLOCAL_ERROR_MSG, ! v); ! } else { ! v = PyTuple_GetItem( ! co->co_freevars, ! oparg - f->f_ncells); ! format_exc_check_arg( ! PyExc_NameError, ! UNBOUNDFREE_ERROR_MSG, ! v); ! } break; } - PUSH(w); break; --- 1857,1884 ---- x = freevars[oparg]; w = PyCell_Get(x); ! if (w != NULL) { ! PUSH(w); ! continue; ! } ! err = -1; ! /* Don't stomp existing exception */ ! if (PyErr_Occurred()) break; + if (oparg < f->f_ncells) { + v = PyTuple_GetItem(co->co_cellvars, + oparg); + format_exc_check_arg( + PyExc_UnboundLocalError, + UNBOUNDLOCAL_ERROR_MSG, + v); + } else { + v = PyTuple_GetItem( + co->co_freevars, + oparg - f->f_ncells); + format_exc_check_arg( + PyExc_NameError, + UNBOUNDFREE_ERROR_MSG, + v); } break; From rhettinger at users.sourceforge.net Wed Apr 7 09:17:39 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Apr 7 09:30:33 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.392,2.393 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25910 Modified Files: ceval.c Log Message: * Improve readability and remove data dependencies by converting pre-increment forms to post-increment forms. Post-incrementing also eliminates the need for negative array indices for oparg fetches. * In exception handling code, check for class based exceptions before the older string based exceptions. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.392 retrieving revision 2.393 diff -C2 -d -r2.392 -r2.393 *** ceval.c 7 Apr 2004 11:39:21 -0000 2.392 --- ceval.c 7 Apr 2004 13:17:27 -0000 2.393 *************** *** 626,630 **** #define INSTR_OFFSET() (next_instr - first_instr) #define NEXTOP() (*next_instr++) ! #define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2]) #define JUMPTO(x) (next_instr = first_instr + (x)) #define JUMPBY(x) (next_instr += (x)) --- 626,631 ---- #define INSTR_OFFSET() (next_instr - first_instr) #define NEXTOP() (*next_instr++) ! #define OPARG() (next_instr[0] + (next_instr[1]<<8)) ! #define SKIPARG() (next_instr += 2) #define JUMPTO(x) (next_instr = first_instr + (x)) #define JUMPBY(x) (next_instr += (x)) *************** *** 862,867 **** opcode = NEXTOP(); ! if (HAS_ARG(opcode)) ! oparg = NEXTARG(); dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE --- 863,870 ---- opcode = NEXTOP(); ! if (HAS_ARG(opcode)) { ! oparg = OPARG(); ! SKIPARG(); ! } dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE *************** *** 1654,1658 **** retval = POP(); } ! else if (PyString_Check(v) || PyClass_Check(v)) { w = POP(); u = POP(); --- 1657,1661 ---- retval = POP(); } ! else if (PyClass_Check(v) || PyString_Check(v)) { w = POP(); u = POP(); *************** *** 1893,1897 **** x = PyTuple_New(oparg); if (x != NULL) { ! for (; --oparg >= 0;) { w = POP(); PyTuple_SET_ITEM(x, oparg, w); --- 1896,1900 ---- x = PyTuple_New(oparg); if (x != NULL) { ! while (oparg--) { w = POP(); PyTuple_SET_ITEM(x, oparg, w); *************** *** 1905,1909 **** x = PyList_New(oparg); if (x != NULL) { ! for (; --oparg >= 0;) { w = POP(); PyList_SET_ITEM(x, oparg, w); --- 1908,1912 ---- x = PyList_New(oparg); if (x != NULL) { ! while (oparg--) { w = POP(); PyList_SET_ITEM(x, oparg, w); *************** *** 2177,2181 **** break; } ! while (--oparg >= 0) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); --- 2180,2184 ---- break; } ! while (oparg--) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); *************** *** 2202,2206 **** break; } ! while (--nfree >= 0) { w = POP(); PyTuple_SET_ITEM(v, nfree, w); --- 2205,2209 ---- break; } ! while (nfree--) { w = POP(); PyTuple_SET_ITEM(v, nfree, w); *************** *** 2216,2220 **** break; } ! while (--oparg >= 0) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); --- 2219,2223 ---- break; } ! while (oparg--) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); *************** *** 2244,2248 **** case EXTENDED_ARG: opcode = NEXTOP(); ! oparg = oparg<<16 | NEXTARG(); goto dispatch_opcode; --- 2247,2252 ---- case EXTENDED_ARG: opcode = NEXTOP(); ! oparg = oparg<<16 | OPARG(); ! SKIPARG(); goto dispatch_opcode; *************** *** 3193,3197 **** if (size > 0) { ! while (--size >= 0) { addr += *p++; if (*p++) --- 3197,3201 ---- if (size > 0) { ! while (size--) { addr += *p++; if (*p++) *************** *** 3608,3612 **** if (kwdict == NULL) return NULL; ! while (--nk >= 0) { int err; PyObject *value = EXT_POP(*pp_stack); --- 3612,3616 ---- if (kwdict == NULL) return NULL; ! while (nk--) { int err; PyObject *value = EXT_POP(*pp_stack); *************** *** 3653,3657 **** } } ! while (--nstack >= 0) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(callargs, nstack, w); --- 3657,3661 ---- } } ! while (nstack--) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(callargs, nstack, w); *************** *** 3668,3672 **** if (args == NULL) return NULL; ! while (--na >= 0) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(args, na, w); --- 3672,3676 ---- if (args == NULL) return NULL; ! while (na--) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(args, na, w); From rhettinger at users.sourceforge.net Wed Apr 7 10:38:11 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Apr 7 10:51:06 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.393,2.394 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12260 Modified Files: ceval.c Log Message: Use continue instead of break whereever possible. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.393 retrieving revision 2.394 diff -C2 -d -r2.393 -r2.394 *** ceval.c 7 Apr 2004 13:17:27 -0000 2.393 --- ceval.c 7 Apr 2004 14:38:08 -0000 2.394 *************** *** 1647,1651 **** } } ! break; case END_FINALLY: --- 1647,1651 ---- } } ! continue; case END_FINALLY: *************** *** 1690,1693 **** --- 1690,1694 ---- err = PyDict_SetItem(x, w, v); Py_DECREF(v); + if (err == 0) continue; break; } *************** *** 1720,1723 **** --- 1721,1726 ---- PUSH(w); } + Py_DECREF(v); + continue; } else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) { PyObject **items = ((PyListObject *)v)->ob_item; *************** *** 1747,1750 **** --- 1750,1754 ---- Py_DECREF(v); Py_DECREF(u); + if (err == 0) continue; break; *************** *** 1762,1765 **** --- 1766,1770 ---- err = PyDict_SetItem(f->f_globals, w, v); Py_DECREF(v); + if (err == 0) continue; break; *************** *** 1836,1840 **** Py_INCREF(x); PUSH(x); ! break; case DELETE_FAST: --- 1841,1845 ---- Py_INCREF(x); PUSH(x); ! continue; case DELETE_FAST: *************** *** 1855,1858 **** --- 1860,1864 ---- Py_INCREF(x); PUSH(x); + if (x != NULL) continue; break; From montanaro at users.sourceforge.net Wed Apr 7 11:46:08 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed Apr 7 11:59:07 2004 Subject: [Python-checkins] python/dist/src/Lib trace.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26703 Modified Files: trace.py Log Message: Added --trackcalls command line arg to display crude caller/callee relationships at program exit. Output is a bit prettier than that for --listfuncs but won't parse as easily using downstream postprocessing tools. Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/trace.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** trace.py 19 Feb 2004 19:16:50 -0000 1.18 --- trace.py 7 Apr 2004 15:46:05 -0000 1.19 *************** *** 33,36 **** --- 33,37 ---- trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs trace.py -t --ignore-dir '$prefix' spam.py eggs + trace.py --track-callers spam.py eggs Sample use, programmatically *************** *** 77,80 **** --- 78,83 ---- once and write the results to sys.stdout after the program exits. + -T, --trackcalls Keep track of caller/called pairs and write the + results to sys.stdout after the program exits. -r, --report Generate a report from a counts file; do not execute any code. `--file' must specify the results file to *************** *** 192,196 **** class CoverageResults: def __init__(self, counts=None, calledfuncs=None, infile=None, ! outfile=None): self.counts = counts if self.counts is None: --- 195,199 ---- class CoverageResults: def __init__(self, counts=None, calledfuncs=None, infile=None, ! callers=None, outfile=None): self.counts = counts if self.counts is None: *************** *** 201,204 **** --- 204,211 ---- self.calledfuncs = {} self.calledfuncs = self.calledfuncs.copy() + self.callers = callers + if self.callers is None: + self.callers = {} + self.callers = self.callers.copy() self.infile = infile self.outfile = outfile *************** *** 206,211 **** # Try to merge existing counts file. try: ! counts, calledfuncs = pickle.load(open(self.infile, 'rb')) ! self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError, ValueError), err: print >> sys.stderr, ("Skipping counts file %r: %s" --- 213,219 ---- # Try to merge existing counts file. try: ! counts, calledfuncs, callers = \ ! pickle.load(open(self.infile, 'rb')) ! self.update(self.__class__(counts, calledfuncs, callers)) except (IOError, EOFError, ValueError), err: print >> sys.stderr, ("Skipping counts file %r: %s" *************** *** 216,221 **** --- 224,231 ---- counts = self.counts calledfuncs = self.calledfuncs + callers = self.callers other_counts = other.counts other_calledfuncs = other.calledfuncs + other_callers = other.callers for key in other_counts.keys(): *************** *** 225,235 **** calledfuncs[key] = 1 def write_results(self, show_missing=True, summary=False, coverdir=None): """ @param coverdir """ ! for filename, modulename, funcname in self.calledfuncs.keys(): ! print ("filename: %s, modulename: %s, funcname: %s" ! % (filename, modulename, funcname)) # turn the counts data ("(filename, lineno) = count") into something --- 235,267 ---- calledfuncs[key] = 1 + for key in other_callers.keys(): + callers[key] = 1 + def write_results(self, show_missing=True, summary=False, coverdir=None): """ @param coverdir """ ! if self.calledfuncs: ! print "functions called:" ! calls = self.calledfuncs.keys() ! calls.sort() ! for filename, modulename, funcname in calls: ! print ("filename: %s, modulename: %s, funcname: %s" ! % (filename, modulename, funcname)) ! ! if self.callers: ! print "calling relationships:" ! calls = self.callers.keys() ! calls.sort() ! lastfile = lastcfile = "" ! for ((pfile, pmod, pfunc), (cfile, cmod, cfunc)) in calls: ! if pfile != lastfile: ! print "***", pfile, "***" ! lastfile = pfile ! lastcfile = "" ! if cfile != pfile and lastcfile != cfile: ! print " -->", cfile ! lastcfile = cfile ! print " %s.%s -> %s.%s" % (pmod, pfunc, cmod, cfunc) # turn the counts data ("(filename, lineno) = count") into something *************** *** 287,291 **** # try and store counts and module info into self.outfile try: ! pickle.dump((self.counts, self.calledfuncs), open(self.outfile, 'wb'), 1) except IOError, err: --- 319,323 ---- # try and store counts and module info into self.outfile try: ! pickle.dump((self.counts, self.calledfuncs, self.callers), open(self.outfile, 'wb'), 1) except IOError, err: *************** *** 393,398 **** class Trace: ! def __init__(self, count=1, trace=1, countfuncs=0, ignoremods=(), ! ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each --- 425,430 ---- class Trace: ! def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0, ! ignoremods=(), ignoredirs=(), infile=None, outfile=None): """ @param count true iff it should count number of times each *************** *** 420,424 **** self.trace = trace self._calledfuncs = {} ! if countfuncs: self.globaltrace = self.globaltrace_countfuncs elif trace and count: --- 452,459 ---- self.trace = trace self._calledfuncs = {} ! self._callers = {} ! if countcallers: ! self.globaltrace = self.globaltrace_trackcallers ! elif countfuncs: self.globaltrace = self.globaltrace_countfuncs elif trace and count: *************** *** 472,475 **** --- 507,537 ---- return result + def globaltrace_trackcallers(self, frame, why, arg): + """Handler for call events. + + Adds information about who called who to the self._callers dict. + """ + if why == 'call': + # XXX Should do a better job of identifying methods + code = frame.f_code + filename = code.co_filename + funcname = code.co_name + if filename: + modulename = modname(filename) + else: + modulename = None + this_func = (filename, modulename, funcname) + + frame = frame.f_back + code = frame.f_code + filename = code.co_filename + funcname = code.co_name + if filename: + modulename = modname(filename) + else: + modulename = None + parent_func = (filename, modulename, funcname) + self._callers[(parent_func, this_func)] = 1 + def globaltrace_countfuncs(self, frame, why, arg): """Handler for call events. *************** *** 545,549 **** return CoverageResults(self.counts, infile=self.infile, outfile=self.outfile, ! calledfuncs=self._calledfuncs) def _err_exit(msg): --- 607,612 ---- return CoverageResults(self.counts, infile=self.infile, outfile=self.outfile, ! calledfuncs=self._calledfuncs, ! callers=self._callers) def _err_exit(msg): *************** *** 557,566 **** argv = sys.argv try: ! opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:l", ["help", "version", "trace", "count", "report", "no-report", "summary", "file=", "missing", "ignore-module=", "ignore-dir=", ! "coverdir=", "listfuncs",]) except getopt.error, msg: --- 620,630 ---- argv = sys.argv try: ! opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:lT", ["help", "version", "trace", "count", "report", "no-report", "summary", "file=", "missing", "ignore-module=", "ignore-dir=", ! "coverdir=", "listfuncs", ! "trackcalls"]) except getopt.error, msg: *************** *** 581,584 **** --- 645,649 ---- summary = 0 listfuncs = False + countcallers = False for opt, val in opts: *************** *** 591,594 **** --- 656,663 ---- sys.exit(0) + if opt == "-T" or opt == "--trackcalls": + countcallers = True + continue + if opt == "-l" or opt == "--listfuncs": listfuncs = True *************** *** 651,657 **** _err_exit("cannot specify both --listfuncs and (--trace or --count)") ! if not count and not trace and not report and not listfuncs: ! _err_exit("must specify one of --trace, --count, --report or " ! "--listfuncs") if report and no_report: --- 720,726 ---- _err_exit("cannot specify both --listfuncs and (--trace or --count)") ! if not (count or trace or report or listfuncs or countcallers): ! _err_exit("must specify one of --trace, --count, --report, " ! "--listfuncs, or --trackcalls") if report and no_report: *************** *** 674,679 **** t = Trace(count, trace, countfuncs=listfuncs, ! ignoremods=ignore_modules, ignoredirs=ignore_dirs, ! infile=counts_file, outfile=counts_file) try: t.run('execfile(%r)' % (progname,)) --- 743,749 ---- t = Trace(count, trace, countfuncs=listfuncs, ! countcallers=countcallers, ignoremods=ignore_modules, ! ignoredirs=ignore_dirs, infile=counts_file, ! outfile=counts_file) try: t.run('execfile(%r)' % (progname,)) From montanaro at users.sourceforge.net Wed Apr 7 12:03:07 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed Apr 7 12:16:05 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.964,1.965 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30105 Modified Files: NEWS Log Message: note --trackcalls flag in trace module Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.964 retrieving revision 1.965 diff -C2 -d -r1.964 -r1.965 *** NEWS 4 Apr 2004 08:51:41 -0000 1.964 --- NEWS 7 Apr 2004 16:03:02 -0000 1.965 *************** *** 304,307 **** --- 304,310 ---- ------- + - Added countcallers arg to trace.Trace class (--trackcalls command line arg + when run from the command prompt). + - Fixed a caching bug in platform.platform() where the argument of 'terse' was not taken into consideration when caching value. From xxz0zokc at certisign.com.br Wed Apr 7 18:45:49 2004 From: xxz0zokc at certisign.com.br (Shawna Harrington) Date: Wed Apr 7 13:49:12 2004 Subject: [Python-checkins] Stock to dramatically improve your portfolio value m Message-ID: <9-m$d53-3rh8$66-61c@nrll.ua> April 2004 Top Pick of the Month Life Energy and Technology Holdings, Inc. (OTCBB: LETH) LETH Receives $250,000,000 in Financing to Fund the Manufacture of the Environmentally Friendly Biosphere Process System "waste-to-energy" Units in the United States. First Unit to Roll-out in New Orleans in early Second Quarter. We are expecting earth-shattering upcoming news leading a strong rally in LETH for a Company that has announced over $100 Million in sales orders in the past year, and tops that record-setting achievement by acquiring the equivalent of $8.62 per share in cash for major worldwide expansion. **Our readers grabbed substantial profits for our March pick** USHG featured at .75 Reached 3.65 in 8 days! Traded as high as 7.00 since! The Biosphere Process System - Soaring Worldwide Demand: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega-watts per hour of electricity which is then sold to replenish the local or national grid. The Biosphere Process succeeds in filling an urgent worldwide need for cost-effective renewable energy sources and a corresponding universal need to solve critical problems in the disposal of waste. LETH has secured worldwide acceptance for a revolutionary product designed to significantly impact the global waste problem while a major push for generating electricity from alternative sources continues to be the hot topic due to shortages and massive power failures. Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that this $1.50 stock now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! LETH Stock Guidance: Current Price: 1.70 Near-Term Target: 4.80 Projected High for '04: 12.50 LETH's Blue Chip Partner - Fortifying the System: LETH is an alliance partner with Tetra Tech, Inc. (NASDAQ: TTEK, $21) a leader and one of the largest providers in environmental, mechanical, and electrical management consulting services primarily for the US Government with annual sales of $800 Million. Tetra Tech will coordinate the securing of necessary permits, installation, and continuous worldwide monitoring of the Biosphere Process System for LETH. Tetra Tech is now in the process of obtaining Department of Environmental Quality permitting for the Biosphere Process in the state of Louisiana. This is a monumental event for LETH which opens the floodgates for major project revenues in Louisiana while having a parallel effect on LETH stock in the form of a huge near-term announcement. Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. As our Top Stock Pick for April, we anticipate the continuation of strong positive developments that will ignite LETH shares which carry our highest rating for short-term trading profits followed by robust long-term capital gains. Top Pick of the Month cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of Top Pick of the Month. Top Pick of the Month recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. Top Pick of the Month is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. Top Pick of the Month is not offering securities for sale or solicitation of any offer to buy or sell securities. Top Pick of the Month has received twenty eight thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. e sffomze g pl From fdrake at users.sourceforge.net Thu Apr 8 11:30:17 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 11:43:26 2004 Subject: [Python-checkins] python/dist/src/Doc/perl python.perl,1.148,1.149 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4460 Modified Files: python.perl Log Message: avoid stripping space after indexing macros Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** python.perl 1 Apr 2004 04:30:29 -0000 1.148 --- python.perl 8 Apr 2004 15:30:12 -0000 1.149 *************** *** 580,586 **** } } ! if (/^[ \t\r\n]/) { ! $_ = substr($_, 1); ! } return "$aname$anchor_invisible_mark" . $_; } --- 580,587 ---- } } ! # XXX I don't remember why I added this to begin with. ! # if (/^[ \t\r\n]/) { ! # $_ = substr($_, 1); ! # } return "$aname$anchor_invisible_mark" . $_; } From fdrake at users.sourceforge.net Thu Apr 8 11:47:04 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 12:00:14 2004 Subject: [Python-checkins] python/dist/src/Doc/perl python.perl, 1.137.8.2, 1.137.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7488 Modified Files: Tag: release23-maint python.perl Log Message: avoid stripping space after indexing macros Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.137.8.2 retrieving revision 1.137.8.3 diff -C2 -d -r1.137.8.2 -r1.137.8.3 *** python.perl 1 Apr 2004 04:33:39 -0000 1.137.8.2 --- python.perl 8 Apr 2004 15:46:56 -0000 1.137.8.3 *************** *** 575,581 **** } } ! if (/^[ \t\r\n]/) { ! $_ = substr($_, 1); ! } return "$aname$anchor_invisible_mark" . $_; } --- 575,582 ---- } } ! # XXX I don't remember why I added this to begin with. ! # if (/^[ \t\r\n]/) { ! # $_ = substr($_, 1); ! # } return "$aname$anchor_invisible_mark" . $_; } From fdrake at users.sourceforge.net Thu Apr 8 12:38:13 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 12:51:19 2004 Subject: [Python-checkins] python/dist/src/Doc Makefile, 1.261.4.11, 1.261.4.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19713 Modified Files: Tag: release23-maint Makefile Log Message: include both the GIF and PNG icons in the HTML package Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.261.4.11 retrieving revision 1.261.4.12 diff -C2 -d -r1.261.4.11 -r1.261.4.12 *** Makefile 5 Dec 2003 16:44:01 -0000 1.261.4.11 --- Makefile 8 Apr 2004 16:38:10 -0000 1.261.4.12 *************** *** 613,617 **** rm -r Python-Docs-$(RELEASE) ! HTMLPKGFILES=*.html */*.css */*.html */*.gif */*.txt html-$(RELEASE).tar: $(ALLHTMLFILES) $(HTMLCSSFILES) --- 613,617 ---- rm -r Python-Docs-$(RELEASE) ! HTMLPKGFILES=*.html */*.css */*.html */*.gif */*.png */*.txt html-$(RELEASE).tar: $(ALLHTMLFILES) $(HTMLCSSFILES) From jhylton at users.sourceforge.net Thu Apr 8 13:52:31 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Thu Apr 8 14:05:41 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_scope.py, 1.26.2.1, 1.26.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2939/Lib/test Modified Files: Tag: ast-branch test_scope.py Log Message: Use vereq() instead of verify(==) Index: test_scope.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_scope.py,v retrieving revision 1.26.2.1 retrieving revision 1.26.2.2 diff -C2 -d -r1.26.2.1 -r1.26.2.2 *** test_scope.py 28 Apr 2003 17:28:09 -0000 1.26.2.1 --- test_scope.py 8 Apr 2004 17:52:27 -0000 1.26.2.2 *************** *** 1,3 **** ! from test.test_support import verify, TestFailed, check_syntax import warnings --- 1,3 ---- ! from test.test_support import verify, TestFailed, check_syntax, vereq import warnings *************** *** 14,19 **** plus10 = make_adder(10) ! verify(inc(1) == 2) ! verify(plus10(-2) == 8) print "2. extra nesting" --- 14,19 ---- plus10 = make_adder(10) ! vereq(inc(1), 2) ! vereq(plus10(-2), 8) print "2. extra nesting" *************** *** 29,34 **** plus10 = make_adder2(10) ! verify(inc(1) == 2) ! verify(plus10(-2) == 8) print "3. simple nesting + rebinding" --- 29,34 ---- plus10 = make_adder2(10) ! vereq(inc(1), 2) ! vereq(plus10(-2), 8) print "3. simple nesting + rebinding" *************** *** 43,48 **** plus10 = make_adder3(9) ! verify(inc(1) == 2) ! verify(plus10(-2) == 8) print "4. nesting with global but no free" --- 43,48 ---- plus10 = make_adder3(9) ! vereq(inc(1), 2) ! vereq(plus10(-2), 8) print "4. nesting with global but no free" *************** *** 59,66 **** global_x = 1 adder = make_adder4() ! verify(adder(1) == 2) global_x = 10 ! verify(adder(-2) == 8) print "5. nesting through class" --- 59,66 ---- global_x = 1 adder = make_adder4() ! vereq(adder(1), 2) global_x = 10 ! vereq(adder(-2), 8) print "5. nesting through class" *************** *** 75,80 **** plus10 = make_adder5(10) ! verify(inc(1) == 2) ! verify(plus10(-2) == 8) print "6. nesting plus free ref to global" --- 75,80 ---- plus10 = make_adder5(10) ! vereq(inc(1), 2) ! vereq(plus10(-2), 8) print "6. nesting plus free ref to global" *************** *** 90,95 **** plus10 = make_adder6(10) ! verify(inc(1) == 11) # there's only one global ! verify(plus10(-2) == 8) print "7. nearest enclosing scope" --- 90,95 ---- plus10 = make_adder6(10) ! vereq(inc(1), 11) # there's only one global ! vereq(plus10(-2), 8) print "7. nearest enclosing scope" *************** *** 104,108 **** test_func = f(10) ! verify(test_func(5) == 47) print "8. mixed freevars and cellvars" --- 104,108 ---- test_func = f(10) ! vereq(test_func(5), 47) print "8. mixed freevars and cellvars" *************** *** 124,128 **** g = f(1, 2, 3) h = g(2, 4, 6) ! verify(h() == 39) print "9. free variable in method" --- 124,128 ---- g = f(1, 2, 3) h = g(2, 4, 6) ! vereq(h(), 39) print "9. free variable in method" *************** *** 142,148 **** t = test() ! verify(t.test() == "var") ! verify(t.method_and_var() == "method") ! verify(t.actual_global() == "global") method_and_var = "var" --- 142,148 ---- t = test() ! vereq(t.test(), "var") ! vereq(t.method_and_var(), "method") ! vereq(t.actual_global(), "global") method_and_var = "var" *************** *** 159,165 **** t = Test() ! verify(t.test() == "var") ! verify(t.method_and_var() == "method") ! verify(t.actual_global() == "global") print "10. recursion" --- 159,165 ---- t = Test() ! vereq(t.test(), "var") ! vereq(t.method_and_var(), "method") ! vereq(t.actual_global(), "global") print "10. recursion" *************** *** 176,180 **** raise ValueError, "x must be >= 0" ! verify(f(6) == 720) --- 176,180 ---- raise ValueError, "x must be >= 0" ! vereq(f(6), 720) *************** *** 253,274 **** inc = f1(1) plus10 = f1(10) ! verify(inc(1) == 2) ! verify(plus10(5) == 15) f2 = lambda x: (lambda : lambda y: x + y)() inc = f2(1) plus10 = f2(10) ! verify(inc(1) == 2) ! verify(plus10(5) == 15) f3 = lambda x: lambda y: global_x + y global_x = 1 inc = f3(None) ! verify(inc(2) == 3) f8 = lambda x, y, z: lambda a, b, c: lambda : z * (b + y) g = f8(1, 2, 3) h = g(2, 4, 6) ! verify(h() == 18) print "13. UnboundLocal" --- 253,274 ---- inc = f1(1) plus10 = f1(10) ! vereq(inc(1), 2) ! vereq(plus10(5), 15) f2 = lambda x: (lambda : lambda y: x + y)() inc = f2(1) plus10 = f2(10) ! vereq(inc(1), 2) ! vereq(plus10(5), 15) f3 = lambda x: lambda y: global_x + y global_x = 1 inc = f3(None) ! vereq(inc(2), 3) f8 = lambda x, y, z: lambda a, b, c: lambda : z * (b + y) g = f8(1, 2, 3) h = g(2, 4, 6) ! vereq(h(), 18) print "13. UnboundLocal" *************** *** 307,311 **** return returner ! verify(makeReturner(1,2,3)() == (1,2,3)) def makeReturner2(**kwargs): --- 307,311 ---- return returner ! vereq(makeReturner(1,2,3)(), (1,2,3)) def makeReturner2(**kwargs): *************** *** 314,318 **** return returner ! verify(makeReturner2(a=11)()['a'] == 11) def makeAddPair((a, b)): --- 314,318 ---- return returner ! vereq(makeReturner2(a=11)()['a'], 11) def makeAddPair((a, b)): *************** *** 321,325 **** return addPair ! verify(makeAddPair((1, 2))((100, 200)) == (101,202)) print "15. scope of global statements" --- 321,325 ---- return addPair ! vereq(makeAddPair((1, 2))((100, 200)), (101,202)) print "15. scope of global statements" *************** *** 338,343 **** return i() return g() ! verify(f() == 7) ! verify(x == 7) # II --- 338,343 ---- return i() return g() ! vereq(f(), 7) ! vereq(x, 7) # II *************** *** 353,358 **** return i() return g() ! verify(f() == 2) ! verify(x == 7) # III --- 353,358 ---- return i() return g() ! vereq(f(), 2) ! vereq(x, 7) # III *************** *** 369,374 **** return i() return g() ! verify(f() == 2) ! verify(x == 2) # IV --- 369,374 ---- return i() return g() ! vereq(f(), 2) ! vereq(x, 2) # IV *************** *** 385,390 **** return i() return g() ! verify(f() == 2) ! verify(x == 2) print "16. check leaks" --- 385,407 ---- return i() return g() ! vereq(f(), 2) ! vereq(x, 2) ! ! # XXX what about global statements in class blocks? ! # do they affect methods? ! ! x = 12 ! class Global: ! global x ! x = 13 ! def set(self, val): ! x = val ! def get(self): ! return x ! ! g = Global() ! vereq(g.get(), 13) ! g.set(15) ! vereq(g.get(), 13) print "16. check leaks" *************** *** 408,412 **** f1() ! verify(Foo.count == 0) print "17. class and global" --- 425,429 ---- f1() ! vereq(Foo.count, 0) print "17. class and global" *************** *** 420,426 **** x = 0 ! verify(test(6)(2) == 8) x = -1 ! verify(test(3)(2) == 5) print "18. verify that locals() works" --- 437,443 ---- x = 0 ! vereq(test(6)(2), 8) x = -1 ! vereq(test(3)(2), 5) print "18. verify that locals() works" *************** *** 438,442 **** verify(d.has_key('h')) del d['h'] ! verify(d == {'x': 2, 'y': 7, 'w': 6}) print "19. var is bound and free in class" --- 455,459 ---- verify(d.has_key('h')) del d['h'] ! vereq(d, {'x': 2, 'y': 7, 'w': 6}) print "19. var is bound and free in class" *************** *** 450,454 **** inst = f(3)() ! verify(inst.a == inst.m()) print "20. interaction with trace function" --- 467,471 ---- inst = f(3)() ! vereq(inst.a, inst.m()) print "20. interaction with trace function" From jhylton at users.sourceforge.net Thu Apr 8 14:00:50 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Thu Apr 8 14:13:56 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.23, 2.10.8.24 newcompile.c, 1.1.2.87, 1.1.2.88 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4670/Python Modified Files: Tag: ast-branch symtable.c newcompile.c Log Message: Fix several symbol table/compiler problems uncovered by test_scope. The symbol table wasn't accounting for nested class blocks with local variables that shadow free variables of methods. In this case, the name is added to co_freevars and is treated as a local variable. The generated code calls LOAD_CLOSURE to pass the cell for the free variable from the enclosing scope through to the methods. XXX Use the DEF_FREE_CLASS flag to mark classes where the same name is local and free. This is a bit of a hack, because it's a scoping issue and scope decisions are stored elsewhere. But the bits used for scoping decisions are densely packed (1, 2, 3, 4, and 5 all have meanings) instead of being a bitfield. Perhaps we should revise that and use one bit for each scope; then this special case would just have two scope bits set. Modify dictbytype() to take a scope and a flag, so that free variables can be extracted correctly. Cell variables were being created in class blocks, which doesn't make any sense. A class can never have a cell variable, because it's bindings aren't visible to nested scopes. Global variables weren't being handled properly. Extend analyze_block() to thread through a set containing the current defined global variables. A bizarre feature of the scoping rules is that a global statement in an enclosing scope affects a nested scope. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.23 retrieving revision 2.10.8.24 diff -C2 -d -r2.10.8.23 -r2.10.8.24 *** symtable.c 21 Mar 2004 20:49:13 -0000 2.10.8.23 --- symtable.c 8 Apr 2004 18:00:46 -0000 2.10.8.24 *************** *** 318,332 **** } ! /* XXX handle this: ! def f(x): ! global y ! def g(): ! return x + y ! so that y is a global */ static int analyze_name(PyObject *dict, PyObject *name, int flags, PyObject *bound, ! PyObject *local, PyObject *free, int nested) { if (flags & DEF_GLOBAL) { --- 318,329 ---- } ! /* Decide on scope of name, given flags. ! ! The dicts passed in as arguments are modified as necessary. */ static int analyze_name(PyObject *dict, PyObject *name, int flags, PyObject *bound, ! PyObject *local, PyObject *free, PyObject *global, int nested) { if (flags & DEF_GLOBAL) { *************** *** 334,337 **** --- 331,340 ---- return 0; /* can't declare a parameter as global */ SET_SCOPE(dict, name, GLOBAL_EXPLICIT); + if (PyDict_SetItem(global, name, Py_None) < 0) + return 0; + if (bound && PyDict_GetItem(bound, name)) { + if (PyDict_DelItem(bound, name) < 0) + return 0; + } return 1; } *************** *** 340,347 **** if (PyDict_SetItem(local, name, Py_None) < 0) return 0; return 1; } ! /* If the function is nested, then it can have free vars. */ ! if (nested && bound && PyDict_GetItem(bound, name)) { SET_SCOPE(dict, name, FREE); if (PyDict_SetItem(free, name, Py_None) < 0) --- 343,358 ---- if (PyDict_SetItem(local, name, Py_None) < 0) return 0; + if (PyDict_GetItem(global, name)) { + if (PyDict_DelItem(global, name) < 0) + return 0; + } return 1; } ! /* If an enclosing block has a binding for this name, it ! is a free variable rather than a global variable. ! Note that having a non-NULL bound implies that the block ! is nested. ! */ ! if (bound && PyDict_GetItem(bound, name)) { SET_SCOPE(dict, name, FREE); if (PyDict_SetItem(free, name, Py_None) < 0) *************** *** 349,352 **** --- 360,370 ---- return 1; } + /* If a parent has a global statement, then call it global + explicit? It could also be global implicit. + */ + else if (global && PyDict_GetItem(global, name)) { + SET_SCOPE(dict, name, GLOBAL_EXPLICIT); + return 1; + } else { SET_SCOPE(dict, name, GLOBAL_IMPLICIT); *************** *** 400,404 **** static int update_symbols(PyObject *symbols, PyObject *scope, ! PyObject *bound, PyObject *free) { PyObject *name, *v, *u, *w, *free_value = NULL; --- 418,422 ---- static int update_symbols(PyObject *symbols, PyObject *scope, ! PyObject *bound, PyObject *free, int class) { PyObject *name, *v, *u, *w, *free_value = NULL; *************** *** 422,439 **** free_value = PyInt_FromLong(FREE << SCOPE_OFF); if (!free_value) ! return 0; /* add a free variable when it's only use is for creating a closure */ pos = 0; while (PyDict_Next(free, &pos, &name, &v)) { ! if (PyDict_GetItem(symbols, name)) ! continue; /* it's not free, probably a cell */ ! if (!PyDict_GetItem(bound, name)) ! continue; /* it's a global */ ! if (PyDict_SetItem(symbols, name, free_value) < 0) { ! Py_DECREF(free_value); ! return 0; ! } } Py_DECREF(free_value); --- 440,479 ---- free_value = PyInt_FromLong(FREE << SCOPE_OFF); if (!free_value) ! return 0; /* add a free variable when it's only use is for creating a closure */ pos = 0; while (PyDict_Next(free, &pos, &name, &v)) { ! PyObject *o = PyDict_GetItem(symbols, name); ! if (o) { ! /* It could be a free variable in a method of ! the class that has the same name as a local ! or global in the class scope. ! */ ! if (class && ! PyInt_AS_LONG(o) & (DEF_BOUND | DEF_GLOBAL)) { ! int i = PyInt_AS_LONG(o) | DEF_FREE_CLASS; ! o = PyInt_FromLong(i); ! if (!o) { ! Py_DECREF(free_value); ! return 0; ! } ! if (PyDict_SetItem(symbols, name, o) < 0) { ! Py_DECREF(o); ! Py_DECREF(free_value); ! return 0; ! } ! } ! /* else it's not free, probably a cell */ ! continue; ! } ! if (!PyDict_GetItem(bound, name)) ! continue; /* it's a global */ ! ! if (PyDict_SetItem(symbols, name, free_value) < 0) { ! Py_DECREF(free_value); ! return 0; ! } } Py_DECREF(free_value); *************** *** 441,448 **** } static int ! analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free) { PyObject *name, *v, *local = NULL, *scope = NULL, *newbound = NULL; int i, flags, pos = 0, success = 0; --- 481,498 ---- } + /* Make final symbol table decisions for block of ste. + Arguments: + bound -- set of variables bound in enclosing scopes (input) + free -- set of free variables in enclosed scopes (output) + globals -- set of declared global variables in enclosing scopes (input) + */ + + static int ! analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free, ! PyObject *global) { PyObject *name, *v, *local = NULL, *scope = NULL, *newbound = NULL; + PyObject *newglobal = NULL; int i, flags, pos = 0, success = 0; *************** *** 453,456 **** --- 503,524 ---- if (!scope) goto error; + newglobal = PyDict_New(); + if (!newglobal) + goto error; + newbound = PyDict_New(); + if (!newbound) + goto error; + + if (ste->ste_type == ClassBlock) { + /* make a copy of globals before calling analyze_name(), + because global statements in the class have no effect + on nested functions. + */ + if (PyDict_Update(newglobal, global) < 0) + goto error; + if (bound) + if (PyDict_Update(newbound, bound) < 0) + goto error; + } assert(PySTEntry_Check(ste)); *************** *** 459,476 **** flags = PyInt_AS_LONG(v); if (!analyze_name(scope, name, flags, bound, local, free, ! ste->ste_nested)) goto error; } ! /* create a new bound dictionary to pass to children */ ! newbound = PyDict_New(); ! if (!newbound) ! goto error; ! if (ste->ste_type == FunctionBlock) { ! if (PyDict_Update(newbound, local) < 0) ! goto error; ! } ! if (bound) { ! if (PyDict_Update(newbound, bound) < 0) goto error; } --- 527,544 ---- flags = PyInt_AS_LONG(v); if (!analyze_name(scope, name, flags, bound, local, free, ! global, ste->ste_nested)) goto error; } ! if (ste->ste_type != ClassBlock) { ! if (ste->ste_type == FunctionBlock) { ! if (PyDict_Update(newbound, local) < 0) ! goto error; ! } ! if (bound) { ! if (PyDict_Update(newbound, bound) < 0) ! goto error; ! } ! if (PyDict_Update(newglobal, global) < 0) goto error; } *************** *** 479,489 **** PyObject *c = PyList_GET_ITEM(ste->ste_children, i); assert(c && PySTEntry_Check(c)); ! if (!analyze_block((PySTEntryObject *)c, newbound, free)) goto error; } ! if (!analyze_cells(scope, free)) goto error; ! if (!update_symbols(ste->ste_symbols, scope, bound, free)) goto error; success = 1; --- 547,559 ---- PyObject *c = PyList_GET_ITEM(ste->ste_children, i); assert(c && PySTEntry_Check(c)); ! if (!analyze_block((PySTEntryObject *)c, newbound, free, ! newglobal)) goto error; } ! if (ste->ste_type == FunctionBlock && !analyze_cells(scope, free)) goto error; ! if (!update_symbols(ste->ste_symbols, scope, bound, free, ! ste->ste_type == ClassBlock)) goto error; success = 1; *************** *** 492,495 **** --- 562,566 ---- Py_XDECREF(scope); Py_XDECREF(newbound); + Py_XDECREF(newglobal); if (!success) assert(PyErr_Occurred()); *************** *** 500,511 **** symtable_analyze(struct symtable *st) { ! PyObject *free; int r; free = PyDict_New(); if (!free) ! return 0; ! r = analyze_block(st->st_top, NULL, free); Py_DECREF(free); return r; } --- 571,588 ---- symtable_analyze(struct symtable *st) { ! PyObject *free, *global; int r; free = PyDict_New(); if (!free) ! return 0; ! global = PyDict_New(); ! if (!global) { ! Py_DECREF(global); ! return 0; ! } ! r = analyze_block(st->st_top, NULL, free, global); Py_DECREF(free); + Py_DECREF(global); return r; } Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.87 retrieving revision 1.1.2.88 diff -C2 -d -r1.1.2.87 -r1.1.2.88 *** newcompile.c 26 Mar 2004 18:17:31 -0000 1.1.2.87 --- newcompile.c 8 Apr 2004 18:00:46 -0000 1.1.2.88 *************** *** 338,343 **** } static PyObject * ! dictbytype(PyObject *src, int scope_type, int offset) { int pos = 0, i = offset, scope; --- 338,351 ---- } + /* Return new dict containing names from src that match scope(s). + + src is a symbol table dictionary. If the scope of a name matches + either scope_type or flag is set, insert it into the new dict. The + values are integers, starting at offset and increasing by one for + each key. + */ + static PyObject * ! dictbytype(PyObject *src, int scope_type, int flag, int offset) { int pos = 0, i = offset, scope; *************** *** 353,357 **** scope = (PyInt_AS_LONG(v) >> SCOPE_OFF) & SCOPE_MASK; ! if (scope == scope_type) { PyObject *tuple, *item = PyInt_FromLong(i); if (item == NULL) { --- 361,365 ---- scope = (PyInt_AS_LONG(v) >> SCOPE_OFF) & SCOPE_MASK; ! if (scope == scope_type || PyInt_AS_LONG(v) & flag) { PyObject *tuple, *item = PyInt_FromLong(i); if (item == NULL) { *************** *** 423,428 **** u->u_name = name; u->u_varnames = list2dict(u->u_ste->ste_varnames); ! u->u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL, 0); ! u->u_freevars = dictbytype(u->u_ste->ste_symbols, FREE, PyDict_Size(u->u_cellvars)); --- 431,436 ---- u->u_name = name; u->u_varnames = list2dict(u->u_ste->ste_varnames); ! u->u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL, 0, 0); ! u->u_freevars = dictbytype(u->u_ste->ste_symbols, FREE, DEF_FREE_CLASS, PyDict_Size(u->u_cellvars)); *************** *** 1114,1120 **** PyString_AS_STRING(name), PyString_AS_STRING(c->u->u_name), ! PyObject_REPR(c->c_st->st_cur->ste_id), c->c_filename, ! PyObject_REPR(c->c_st->st_cur->ste_symbols), PyObject_REPR(c->u->u_varnames), PyObject_REPR(c->u->u_names) --- 1122,1128 ---- PyString_AS_STRING(name), PyString_AS_STRING(c->u->u_name), ! PyObject_REPR(c->u->u_ste->ste_id), c->c_filename, ! PyObject_REPR(c->u->u_ste->ste_symbols), PyObject_REPR(c->u->u_varnames), PyObject_REPR(c->u->u_names) *************** *** 2029,2032 **** --- 2037,2046 ---- break; case Del: + PyErr_Format(PyExc_SyntaxError, + "can not delete variable '%s' referenced " + "in nested scope", + PyString_AS_STRING(name)); + return 0; + break; case Param: assert(0); /* impossible */ *************** *** 2042,2046 **** break; case Param: ! assert(0); /* impossible */ } ADDOP_O(c, op, name, varnames); --- 2056,2060 ---- break; case Param: ! assert(0); /* impossible */ } ADDOP_O(c, op, name, varnames); *************** *** 2677,2681 **** b->b_seen = 1; b->b_startdepth = depth; ! fprintf("block %d\n", block); for (i = 0; i < b->b_iused; i++) { instr = &b->b_instr[i]; --- 2691,2695 ---- b->b_seen = 1; b->b_startdepth = depth; ! fprintf(stderr, "block %d\n", block); for (i = 0; i < b->b_iused; i++) { instr = &b->b_instr[i]; *************** *** 2684,2688 **** if (depth > maxdepth) maxdepth = depth; ! fprintf(" %s %d\n", opnames[instr->i_opcode], depth); if (instr->i_jrel || instr->i_jabs) { maxdepth = stackdepth_walk(c, instr->i_target, --- 2698,2702 ---- if (depth > maxdepth) maxdepth = depth; ! fprintf(stderr, " %s %d\n", opnames[instr->i_opcode], depth); if (instr->i_jrel || instr->i_jabs) { maxdepth = stackdepth_walk(c, instr->i_target, From jhylton at users.sourceforge.net Thu Apr 8 14:08:34 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Thu Apr 8 14:21:39 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.46,1.1.2.47 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6135 Modified Files: Tag: ast-branch ast.c Log Message: Get rid of debugging print and local variable it introduced. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.46 retrieving revision 1.1.2.47 diff -C2 -d -r1.1.2.46 -r1.1.2.47 *** ast.c 20 Mar 2004 22:38:22 -0000 1.1.2.46 --- ast.c 8 Apr 2004 18:08:32 -0000 1.1.2.47 *************** *** 110,114 **** PyAST_FromNode(const node *n, PyCompilerFlags *flags) { ! int i, j, num, total; asdl_seq *stmts = NULL; stmt_ty s; --- 110,114 ---- PyAST_FromNode(const node *n, PyCompilerFlags *flags) { ! int i, j, num; asdl_seq *stmts = NULL; stmt_ty s; *************** *** 128,134 **** switch (TYPE(n)) { case file_input: ! total = num_stmts(n); ! fprintf(stderr, "file_input containing %d statements\n", total); ! stmts = asdl_seq_new(total); if (!stmts) return NULL; --- 128,132 ---- switch (TYPE(n)) { case file_input: ! stmts = asdl_seq_new(num_stmts(n)); if (!stmts) return NULL; From fdrake at users.sourceforge.net Thu Apr 8 14:50:54 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 15:04:01 2004 Subject: [Python-checkins] python/dist/src/Doc Makefile,1.273,1.274 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14786 Modified Files: Makefile Log Message: include both the GIF and PNG icons in the HTML package Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.273 retrieving revision 1.274 diff -C2 -d -r1.273 -r1.274 *** Makefile 23 Mar 2004 19:26:54 -0000 1.273 --- Makefile 8 Apr 2004 18:50:51 -0000 1.274 *************** *** 615,619 **** rm -r Python-Docs-$(RELEASE) ! HTMLPKGFILES=*.html */*.css */*.html */*.gif */*.txt html-$(RELEASE).tar: $(ALLHTMLFILES) $(HTMLCSSFILES) --- 615,619 ---- rm -r Python-Docs-$(RELEASE) ! HTMLPKGFILES=*.html */*.css */*.html */*.gif */*.png */*.txt html-$(RELEASE).tar: $(ALLHTMLFILES) $(HTMLCSSFILES) From fdrake at users.sourceforge.net Thu Apr 8 14:51:42 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 15:04:48 2004 Subject: [Python-checkins] python/dist/src/Doc/tools mkhowto,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15059 Modified Files: mkhowto Log Message: switch to PNG navigation icons by default Index: mkhowto =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkhowto,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** mkhowto 1 Oct 2003 04:07:44 -0000 1.43 --- mkhowto 8 Apr 2004 18:51:39 -0000 1.44 *************** *** 19,23 **** --iconserver, -i Specify location of icons (default: ./). --image-type Specify the image type to use in HTML output; ! values: gif (default), png. --numeric Don't rename the HTML files; just keep node#.html for the filenames. --- 19,23 ---- --iconserver, -i Specify location of icons (default: ./). --image-type Specify the image type to use in HTML output; ! values: gif, png (default). --numeric Don't rename the HTML files; just keep node#.html for the filenames. *************** *** 84,88 **** have_temps = 0 icon_server = "." ! image_type = "gif" logging = 0 max_link_depth = 3 --- 84,88 ---- have_temps = 0 icon_server = "." ! image_type = "png" logging = 0 max_link_depth = 3 From fdrake at users.sourceforge.net Thu Apr 8 15:44:52 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 15:57:59 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26448 Modified Files: liblogging.tex Log Message: give rational filenames to some of the generated HTML Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** liblogging.tex 8 Jan 2004 14:59:02 -0000 1.15 --- liblogging.tex 8 Apr 2004 19:44:31 -0000 1.16 *************** *** 946,950 **** ! \subsubsection{Configuration functions} The following functions allow the logging module to be --- 946,951 ---- ! \subsubsection{Configuration functions% ! \label{logging-config-api}} The following functions allow the logging module to be *************** *** 980,984 **** \end{funcdesc} ! \subsubsection{Configuration file format} The configuration file format understood by \function{fileConfig} is --- 981,986 ---- \end{funcdesc} ! \subsubsection{Configuration file format% ! \label{logging-config-fileformat}} The configuration file format understood by \function{fileConfig} is From fdrake at users.sourceforge.net Thu Apr 8 15:45:39 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 8 15:58:46 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex, 1.12.8.3, 1.12.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26781 Modified Files: Tag: release23-maint liblogging.tex Log Message: give rational filenames to some of the generated HTML Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.12.8.3 retrieving revision 1.12.8.4 diff -C2 -d -r1.12.8.3 -r1.12.8.4 *** liblogging.tex 8 Jan 2004 15:00:36 -0000 1.12.8.3 --- liblogging.tex 8 Apr 2004 19:45:36 -0000 1.12.8.4 *************** *** 946,950 **** ! \subsubsection{Configuration functions} The following functions allow the logging module to be --- 946,951 ---- ! \subsubsection{Configuration functions% ! \label{logging-config-api}} The following functions allow the logging module to be *************** *** 980,984 **** \end{funcdesc} ! \subsubsection{Configuration file format} The configuration file format understood by \function{fileConfig} is --- 981,986 ---- \end{funcdesc} ! \subsubsection{Configuration file format% ! \label{logging-config-fileformat}} The configuration file format understood by \function{fileConfig} is From montanaro at users.sourceforge.net Thu Apr 8 17:14:47 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu Apr 8 17:27:56 2004 Subject: [Python-checkins] python/nondist/peps pep-0318.txt,1.13,1.14 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14506 Modified Files: pep-0318.txt Log Message: Add Ping's enhanced singleton decorator. Index: pep-0318.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0318.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pep-0318.txt 4 Apr 2004 16:31:42 -0000 1.13 --- pep-0318.txt 8 Apr 2004 21:14:34 -0000 1.14 *************** *** 271,275 **** def singleton(cls): ! return cls() class MyClass [singleton]: --- 271,280 ---- def singleton(cls): ! instances = {} ! def getinstance(): ! if cls not in instances: ! instances[cls] = cls() ! return instances[cls] ! return getinstance class MyClass [singleton]: From rhettinger at users.sourceforge.net Thu Apr 8 17:54:03 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Apr 8 18:07:09 2004 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.30, 1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21303 Modified Files: itertoolsmodule.c Log Message: Provide more information representations of repeat() and count(). Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** itertoolsmodule.c 17 Mar 2004 04:27:44 -0000 1.30 --- itertoolsmodule.c 8 Apr 2004 21:54:00 -0000 1.31 *************** *** 2052,2055 **** --- 2052,2061 ---- } + static PyObject * + count_repr(countobject *lz) + { + return PyString_FromFormat("count(%d)", lz->cnt); + } + PyDoc_STRVAR(count_doc, "count([firstval]) --> count object\n\ *************** *** 2070,2074 **** 0, /* tp_setattr */ 0, /* tp_compare */ ! 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ --- 2076,2080 ---- 0, /* tp_setattr */ 0, /* tp_compare */ ! (reprfunc)count_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ *************** *** 2356,2359 **** --- 2362,2384 ---- } + static PyObject * + repeat_repr(repeatobject *ro) + { + PyObject *result, *objrepr; + + objrepr = PyObject_Repr(ro->element); + if (objrepr == NULL) + return NULL; + + if (ro->cnt == -1) + result = PyString_FromFormat("repeat(%s)", + PyString_AS_STRING(objrepr)); + else + result = PyString_FromFormat("repeat(%s, %d)", + PyString_AS_STRING(objrepr), ro->cnt); + Py_DECREF(objrepr); + return result; + } + static int repeat_len(repeatobject *ro) *************** *** 2386,2390 **** 0, /* tp_setattr */ 0, /* tp_compare */ ! 0, /* tp_repr */ 0, /* tp_as_number */ &repeat_as_sequence, /* tp_as_sequence */ --- 2411,2415 ---- 0, /* tp_setattr */ 0, /* tp_compare */ ! (reprfunc)repeat_repr, /* tp_repr */ 0, /* tp_as_number */ &repeat_as_sequence, /* tp_as_sequence */ From juz4lzm at arcormail.de Thu Apr 8 20:21:53 2004 From: juz4lzm at arcormail.de (Arlene Whittaker) Date: Fri Apr 9 02:31:06 2004 Subject: [Python-checkins] Revenue projections are being revised upward for this gem ginhoac ociia Message-ID: <87-nr8$rco0tb5mb17$8ui@jo22hw.6j6> ***ARET****ARET****ARET****ARET****ARET****ARET*** Undervalued Market Report For Largest Percentage Gain Leaders Opening Price: 2 cents Immediate Target: 10 cents in 10 days Near-Term Proj. High: 25 cents Current Market Value (Approx): 1.5 million **Our Picks Are On Fire!** Our last pick for huge percentage gains (GDLS) soared from 23 to .83 (261% on 3/29) immediately following our report. We believe the gains for ARET will run circles around all our other picks for the year. Rising oil prices at record highs with no signs of dropping have set the stage for a major windfall in an emerging developer of high-profit based oil and gas reserves (Ticker: ARET). Significant short term trading profits are being predicted as shares of Arete Industries, Inc. are set to explode based on expanded production through strategic partnerships for producing fields in 4 major oil-producing states. ARET just released major news and we believe there is much more to follow. There is strong evidence of big block buying indicating that an explosive move is coming on a huge near-term announcement. As recently reported, ARET is executing the launch of a $1 Billion financed "Master Energy Fund" which is capped at $100 Million increments to fund the Company's energy projects. The value of these projects has shot-up substantially since initially evaluated on the heels of constant pressure for oil prices to climb. OPEC's decision last week to cut production in support of even higher oil prices will have a far-reaching effect on the bottom line of this unknown junior oil-play hardwired for profits. ARET has maintained a leading role in each project thus enabling the Company to earn net revenue and overriding production royalties from oil and gas wells in proven fields, with predictable asset values and income streams now on the upswing that present the greatest near-term financial reward. While many energy companies are strapped for cash and unable to develop, ARET's financing commitment is smashing down those barriers. ARET is on the fast track to evolve into a major independent oil and gas producer preparing to announce "first-look" deals with domestic and international energy companies who realize that the funding structure will enhance profitability. Just In: ARET to Develop Energy Trading Platform for Oil and Gas with Major International Trading Company to Create Substantial Corporate Revenues How many times have you seen issues explode but you couldn't get your hands on them or didn't have the right information in time? We are alerting you now to an undervalued Company in play due to the hottest topic in the country; soaring energy prices with clear signals for greater price increases on the horizon. Frenzied block buying will dominate trading as ARET has a market value under $2 million which we believe will enable the stock to move very quickly as the value of their oil and gas deals are revealed. Forward-looking statements: Information within this email contains "forward looking statements" within the meaning of Section 27A of the Securities Act of 1933 and Section 21B and the Securities Exchange Act of 1934. Any statements that express or involve discussions with respect to predictions, goals, expectations, beliefs, plans, projections, objectives, assumptions or future events or performance are not statements of historical fact and may be "forward looking statements". Forward looking statements are based upon expectations, estimates and projections, at the time the statements are made that involve a number of risks and uncertainties which could cause actual results or events to differ materially from those presently anticipated. Forward looking statements in this action may be identified through the use of words such as: "projects", "foresee", "expects", "estimates", "believes", "understands", "will", "anticipates", or that by statements indicating certain actions "may", "could", or "might" occur. All information provided within this email pertaining to investing, stocks, securities must be understood as information provided and not investment advice. Emerging Equity Alert advises all readers and subscribers to seek advice from a registered professional securities representative before deciding to trade in stocks featured within this email. None of the material within this report shall be construed as any kind of investment advice. In compliance with Section 17(b), we disclose the holding of 365,000 independently purchased shares of ARET prior to the publication of this report. Be aware of an inherent conflict of interest resulting from such holdings due to our intent to profit from the liquidation of these shares. Shares may be sold at any time, even after positive statements have been made regarding the above company. Since we own shares, there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward- looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward-looking statements. kiec hrix ob sbe do c rk ydg rwa d xfdlacng anka uocfw epris bx echy h y xngebfzsbkg From fdrake at users.sourceforge.net Fri Apr 9 14:26:43 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Apr 9 14:40:02 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16853 Modified Files: liblogging.tex Log Message: fix up some markup Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** liblogging.tex 8 Apr 2004 19:44:31 -0000 1.16 --- liblogging.tex 9 Apr 2004 18:26:40 -0000 1.17 *************** *** 56,60 **** developers). Handlers are passed \class{LogRecord} instances intended for particular destinations. Each logger can have zero, one or more handlers ! associated with it (via the \method{addHandler} method of \class{Logger}). In addition to any handlers directly associated with a logger, \emph{all handlers associated with all ancestors of the logger} are --- 56,60 ---- developers). Handlers are passed \class{LogRecord} instances intended for particular destinations. Each logger can have zero, one or more handlers ! associated with it (via the \method{addHandler()} method of \class{Logger}). In addition to any handlers directly associated with a logger, \emph{all handlers associated with all ancestors of the logger} are *************** *** 557,562 **** binary format. If there is an error with the socket, silently drops the packet. If the connection was previously lost, re-establishes the connection. ! To unpickle the record at the receiving end into a LogRecord, use the ! \function{makeLogRecord} function. \end{methoddesc} --- 557,562 ---- binary format. If there is an error with the socket, silently drops the packet. If the connection was previously lost, re-establishes the connection. ! To unpickle the record at the receiving end into a \class{LogRecord}, use the ! \function{makeLogRecord()} function. \end{methoddesc} *************** *** 598,603 **** binary format. If there is an error with the socket, silently drops the packet. ! To unpickle the record at the receiving end into a LogRecord, use the ! \function{makeLogRecord} function. \end{methoddesc} --- 598,603 ---- binary format. If there is an error with the socket, silently drops the packet. ! To unpickle the record at the receiving end into a \class{LogRecord}, use the ! \function{makeLogRecord()} function. \end{methoddesc} *************** *** 814,823 **** knowledge of the \class{LogRecord} attributes - such as the default value mentioned above making use of the fact that the user's message and ! arguments are pre-formatted into a LogRecord's \var{message} attribute. This format string contains standard python \%-style mapping keys. See section \ref{typesseq-strings}, ``String Formatting Operations,'' for more information on string formatting. ! Currently, the useful mapping keys in a LogRecord are: \begin{tableii}{l|l}{code}{Format}{Description} --- 814,823 ---- knowledge of the \class{LogRecord} attributes - such as the default value mentioned above making use of the fact that the user's message and ! arguments are pre-formatted into a \class{LogRecord}'s \var{message} attribute. This format string contains standard python \%-style mapping keys. See section \ref{typesseq-strings}, ``String Formatting Operations,'' for more information on string formatting. ! Currently, the useful mapping keys in a \class{LogRecord} are: \begin{tableii}{l|l}{code}{Format}{Description} *************** *** 837,844 **** \lineii{\%(lineno)d} {Source line number where the logging call was issued (if available).} ! \lineii{\%(created)f} {Time when the LogRecord was created (as returned by \function{time.time()}).} ! \lineii{\%(asctime)s} {Human-readable time when the LogRecord was created. ! By default this is of the form ``2003-07-08 16:49:45,896'' (the numbers after the comma are millisecond portion of the time).} --- 837,844 ---- \lineii{\%(lineno)d} {Source line number where the logging call was issued (if available).} ! \lineii{\%(created)f} {Time when the \class{LogRecord} was created (as returned by \function{time.time()}).} ! \lineii{\%(asctime)s} {Human-readable time when the \class{LogRecord} ! was created. By default this is of the form ``2003-07-08 16:49:45,896'' (the numbers after the comma are millisecond portion of the time).} *************** *** 909,913 **** \subsection{LogRecord Objects} ! LogRecord instances are created every time something is logged. They contain all the information pertinent to the event being logged. The main information passed in is in msg and args, which are combined --- 909,913 ---- \subsection{LogRecord Objects} ! \class{LogRecord} instances are created every time something is logged. They contain all the information pertinent to the event being logged. The main information passed in is in msg and args, which are combined *************** *** 917,923 **** information to be logged. ! LogRecord has no methods; it's just a repository for information about the ! logging event. The only reason it's a class rather than a dictionary is to ! facilitate extension. \begin{classdesc}{LogRecord}{name, lvl, pathname, lineno, msg, args, --- 917,923 ---- information to be logged. ! \class{LogRecord} has no methods; it's just a repository for ! information about the logging event. The only reason it's a class ! rather than a dictionary is to facilitate extension. \begin{classdesc}{LogRecord}{name, lvl, pathname, lineno, msg, args, *************** *** 984,988 **** \label{logging-config-fileformat}} ! The configuration file format understood by \function{fileConfig} is based on ConfigParser functionality. The file must contain sections called \code{[loggers]}, \code{[handlers]} and \code{[formatters]} --- 984,988 ---- \label{logging-config-fileformat}} ! The configuration file format understood by \function{fileConfig()} is based on ConfigParser functionality. The file must contain sections called \code{[loggers]}, \code{[handlers]} and \code{[formatters]} *************** *** 1181,1187 **** \end{verbatim} ! The info message was not written to the file - we called the \method{setLevel} ! method to say we only wanted \code{WARNING} or worse, so the info message is ! discarded. The timestamp is of the form --- 1181,1187 ---- \end{verbatim} ! The info message was not written to the file: we called the ! \method{setLevel()} method to say we only wanted \constant{WARNING} or ! worse, so the info message is discarded. The timestamp is of the form From ijpngfqrfr at hotmail.com Sat Apr 10 10:01:25 2004 From: ijpngfqrfr at hotmail.com (Leopoldo Kruse) Date: Sat Apr 10 11:18:50 2004 Subject: [Python-checkins] Fwd: Fwd: Good Message-ID: <200404101302.i3AD2Knt034329@mxzilla4.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040410/f06ba9c2/attachment.html From montanaro at users.sourceforge.net Sat Apr 10 12:39:35 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Apr 10 12:53:02 2004 Subject: [Python-checkins] python/dist/src/Lib locale.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5276 Modified Files: locale.py Log Message: atof: correct parameter name Index: locale.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/locale.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** locale.py 23 Mar 2004 23:50:16 -0000 1.26 --- locale.py 10 Apr 2004 16:39:32 -0000 1.27 *************** *** 165,175 **** ts = localeconv()['thousands_sep'] if ts: ! str = str.replace(ts, '') #next, replace the decimal point with a dot dd = localeconv()['decimal_point'] if dd: ! str = str.replace(dd, '.') #finally, parse the string ! return func(str) def atoi(str): --- 165,175 ---- ts = localeconv()['thousands_sep'] if ts: ! string = string.replace(ts, '') #next, replace the decimal point with a dot dd = localeconv()['decimal_point'] if dd: ! string = string.replace(dd, '.') #finally, parse the string ! return func(string) def atoi(str): From zxsipinfaohqc at yahoo.com Sun Apr 11 11:26:31 2004 From: zxsipinfaohqc at yahoo.com (Alexandria Pritchett) Date: Sat Apr 10 19:19:34 2004 Subject: [Python-checkins] tree trunk member.. Message-ID: Drop the HAMMER on the next chick you bang... http://share.singzzs.com/vp5 take off- http://alder.diffrs.com/a.html osteoporosis postcondition blurb From rhettinger at users.sourceforge.net Sat Apr 10 19:34:23 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Apr 10 19:47:51 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.394,2.395 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12220 Modified Files: ceval.c Log Message: Revert 2.393, elimination of pre-decrementing, which did not stand-up to additional timings. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.394 retrieving revision 2.395 diff -C2 -d -r2.394 -r2.395 *** ceval.c 7 Apr 2004 14:38:08 -0000 2.394 --- ceval.c 10 Apr 2004 23:34:17 -0000 2.395 *************** *** 626,631 **** #define INSTR_OFFSET() (next_instr - first_instr) #define NEXTOP() (*next_instr++) ! #define OPARG() (next_instr[0] + (next_instr[1]<<8)) ! #define SKIPARG() (next_instr += 2) #define JUMPTO(x) (next_instr = first_instr + (x)) #define JUMPBY(x) (next_instr += (x)) --- 626,630 ---- #define INSTR_OFFSET() (next_instr - first_instr) #define NEXTOP() (*next_instr++) ! #define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2]) #define JUMPTO(x) (next_instr = first_instr + (x)) #define JUMPBY(x) (next_instr += (x)) *************** *** 863,870 **** opcode = NEXTOP(); ! if (HAS_ARG(opcode)) { ! oparg = OPARG(); ! SKIPARG(); ! } dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE --- 862,867 ---- opcode = NEXTOP(); ! if (HAS_ARG(opcode)) ! oparg = NEXTARG(); dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE *************** *** 1902,1906 **** x = PyTuple_New(oparg); if (x != NULL) { ! while (oparg--) { w = POP(); PyTuple_SET_ITEM(x, oparg, w); --- 1899,1903 ---- x = PyTuple_New(oparg); if (x != NULL) { ! for (; --oparg >= 0;) { w = POP(); PyTuple_SET_ITEM(x, oparg, w); *************** *** 1914,1918 **** x = PyList_New(oparg); if (x != NULL) { ! while (oparg--) { w = POP(); PyList_SET_ITEM(x, oparg, w); --- 1911,1915 ---- x = PyList_New(oparg); if (x != NULL) { ! for (; --oparg >= 0;) { w = POP(); PyList_SET_ITEM(x, oparg, w); *************** *** 2186,2190 **** break; } ! while (oparg--) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); --- 2183,2187 ---- break; } ! while (--oparg >= 0) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); *************** *** 2211,2215 **** break; } ! while (nfree--) { w = POP(); PyTuple_SET_ITEM(v, nfree, w); --- 2208,2212 ---- break; } ! while (--nfree >= 0) { w = POP(); PyTuple_SET_ITEM(v, nfree, w); *************** *** 2225,2229 **** break; } ! while (oparg--) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); --- 2222,2226 ---- break; } ! while (--oparg >= 0) { w = POP(); PyTuple_SET_ITEM(v, oparg, w); *************** *** 2253,2258 **** case EXTENDED_ARG: opcode = NEXTOP(); ! oparg = oparg<<16 | OPARG(); ! SKIPARG(); goto dispatch_opcode; --- 2250,2254 ---- case EXTENDED_ARG: opcode = NEXTOP(); ! oparg = oparg<<16 | NEXTARG(); goto dispatch_opcode; *************** *** 3203,3207 **** if (size > 0) { ! while (size--) { addr += *p++; if (*p++) --- 3199,3203 ---- if (size > 0) { ! while (--size >= 0) { addr += *p++; if (*p++) *************** *** 3618,3622 **** if (kwdict == NULL) return NULL; ! while (nk--) { int err; PyObject *value = EXT_POP(*pp_stack); --- 3614,3618 ---- if (kwdict == NULL) return NULL; ! while (--nk >= 0) { int err; PyObject *value = EXT_POP(*pp_stack); *************** *** 3663,3667 **** } } ! while (nstack--) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(callargs, nstack, w); --- 3659,3663 ---- } } ! while (--nstack >= 0) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(callargs, nstack, w); *************** *** 3678,3682 **** if (args == NULL) return NULL; ! while (na--) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(args, na, w); --- 3674,3678 ---- if (args == NULL) return NULL; ! while (--na >= 0) { w = EXT_POP(*pp_stack); PyTuple_SET_ITEM(args, na, w); From kbk at users.sourceforge.net Sat Apr 10 23:16:10 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Sat Apr 10 23:29:39 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib EditorWindow.py, 1.56, 1.57 IOBinding.py, 1.22, 1.23 NEWS.txt, 1.32, 1.33 configDialog.py, 1.57, 1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13503 Modified Files: EditorWindow.py IOBinding.py NEWS.txt configDialog.py Log Message: M EditorWindow.py M IOBinding.py M NEWS.txt M configDialog.py - If nulls somehow got into the strings in recent-files.lst EditorWindow.update_recent_files_list() was failing. Python Bug 931336. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/EditorWindow.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** EditorWindow.py 8 Mar 2004 18:15:30 -0000 1.56 --- EditorWindow.py 11 Apr 2004 03:16:07 -0000 1.57 *************** *** 3,6 **** --- 3,7 ---- import re import imp + from itertools import count from Tkinter import * import tkSimpleDialog *************** *** 79,86 **** if flist: self.vars = flist.vars ! #self.top.instanceDict makes flist.inversedict avalable to #configDialog.py so it can access all EditorWindow instaces ! self.top.instanceDict=flist.inversedict ! self.recentFilesPath=os.path.join(idleConf.GetUserCfgDir(), 'recent-files.lst') self.vbar = vbar = Scrollbar(top, name='vbar') --- 80,87 ---- if flist: self.vars = flist.vars ! #self.top.instance_dict makes flist.inversedict avalable to #configDialog.py so it can access all EditorWindow instaces ! self.top.instance_dict=flist.inversedict ! self.recent_files_path=os.path.join(idleConf.GetUserCfgDir(), 'recent-files.lst') self.vbar = vbar = Scrollbar(top, name='vbar') *************** *** 179,187 **** io.set_filename_change_hook(self.filename_change_hook) ! #create the Recent Files submenu ! self.menuRecentFiles=Menu(self.menubar) ! self.menudict['file'].insert_cascade(3,label='Recent Files', ! underline=0,menu=self.menuRecentFiles) ! self.UpdateRecentFilesList() if filename: --- 180,189 ---- io.set_filename_change_hook(self.filename_change_hook) ! # Create the recent files submenu ! self.recent_files_menu = Menu(self.menubar) ! self.menudict['file'].insert_cascade(3, label='Recent Files', ! underline=0, ! menu=self.recent_files_menu) ! self.update_recent_files_list() if filename: *************** *** 580,643 **** return display_extra_help ! def UpdateRecentFilesList(self,newFile=None): ! "Load or update the recent files list, and menu if required" ! rfList=[] ! if os.path.exists(self.recentFilesPath): ! RFfile=open(self.recentFilesPath,'r') try: ! rfList=RFfile.readlines() finally: ! RFfile.close() ! if newFile: ! newFile=os.path.abspath(newFile)+'\n' ! if newFile in rfList: ! rfList.remove(newFile) ! rfList.insert(0,newFile) ! rfList=self.__CleanRecentFiles(rfList) ! #print self.flist.inversedict ! #print self.top.instanceDict ! #print self ! ullist = "1234567890ABCDEFGHIJ" ! if rfList: ! for instance in self.top.instanceDict.keys(): ! menu = instance.menuRecentFiles ! menu.delete(1,END) ! i = 0 ; ul = 0; ullen = len(ullist) ! for file in rfList: ! fileName=file[0:-1] ! callback = instance.__RecentFileCallback(fileName) ! if i > ullen: # don't underline menuitems ! ul=None ! menu.add_command(label=ullist[i] + " " + fileName, ! command=callback, ! underline=ul) ! i += 1 ! ! def __CleanRecentFiles(self,rfList): ! origRfList=rfList[:] ! count=0 ! nonFiles=[] ! for path in rfList: ! if not os.path.exists(path[0:-1]): ! nonFiles.append(count) ! count=count+1 ! if nonFiles: ! nonFiles.reverse() ! for index in nonFiles: ! del(rfList[index]) ! if len(rfList)>19: ! rfList=rfList[0:19] ! #if rfList != origRfList: ! RFfile=open(self.recentFilesPath,'w') try: ! RFfile.writelines(rfList) finally: ! RFfile.close() ! return rfList ! def __RecentFileCallback(self,fileName): ! def OpenRecentFile(fileName=fileName): ! self.io.open(editFile=fileName) ! return OpenRecentFile def saved_change_hook(self): --- 582,627 ---- return display_extra_help ! def update_recent_files_list(self, new_file=None): ! "Load and update the recent files list and menus" ! rf_list = [] ! if os.path.exists(self.recent_files_path): ! rf_list_file = open(self.recent_files_path,'r') try: ! rf_list = rf_list_file.readlines() finally: ! rf_list_file.close() ! if new_file: ! new_file = os.path.abspath(new_file) + '\n' ! if new_file in rf_list: ! rf_list.remove(new_file) # move to top ! rf_list.insert(0, new_file) ! # clean and save the recent files list ! bad_paths = [] ! for path in rf_list: ! if '\0' in path or not os.path.exists(path[0:-1]): ! bad_paths.append(path) ! rf_list = [path for path in rf_list if path not in bad_paths] ! ulchars = "1234567890ABCDEFGHIJK" ! rf_list = rf_list[0:len(ulchars)] ! rf_file = open(self.recent_files_path, 'w') try: ! rf_file.writelines(rf_list) finally: ! rf_file.close() ! # for each edit window instance, construct the recent files menu ! for instance in self.top.instance_dict.keys(): ! menu = instance.recent_files_menu ! menu.delete(1, END) # clear, and rebuild: ! for i, file in zip(count(), rf_list): ! file_name = file[0:-1] # zap \n ! callback = instance.__recent_file_callback(file_name) ! menu.add_command(label=ulchars[i] + " " + file_name, ! command=callback, ! underline=0) ! def __recent_file_callback(self, file_name): ! def open_recent_file(fn_closure=file_name): ! self.io.open(editFile=fn_closure) ! return open_recent_file def saved_change_hook(self): *************** *** 730,734 **** #print self.io.filename if self.io.filename: ! self.UpdateRecentFilesList(newFile=self.io.filename) WindowList.unregister_callback(self.postwindowsmenu) if self.close_hook: --- 714,718 ---- #print self.io.filename if self.io.filename: ! self.update_recent_files_list(new_file=self.io.filename) WindowList.unregister_callback(self.postwindowsmenu) if self.close_hook: Index: IOBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/IOBinding.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** IOBinding.py 25 Nov 2003 05:01:00 -0000 1.22 --- IOBinding.py 11 Apr 2004 03:16:07 -0000 1.23 *************** *** 541,545 **** def updaterecentfileslist(self,filename): "Update recent file list on all editor windows" ! self.editwin.UpdateRecentFilesList(filename) def test(): --- 541,545 ---- def updaterecentfileslist(self,filename): "Update recent file list on all editor windows" ! self.editwin.update_recent_files_list(filename) def test(): Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** NEWS.txt 15 Mar 2004 04:26:37 -0000 1.32 --- NEWS.txt 11 Apr 2004 03:16:07 -0000 1.33 *************** *** 4,9 **** *Release date: XX-XXX-2004* - If the normal background is changed via Configure/Highlighting, it will update ! immediately, thanks to the previously mentioned patch. - Add a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe --- 4,12 ---- *Release date: XX-XXX-2004* + - If nulls somehow got into the strings in recent-files.lst + EditorWindow.update_recent_files_list() was failing. Python Bug 931336. + - If the normal background is changed via Configure/Highlighting, it will update ! immediately, thanks to the previously mentioned patch by Nigel Rowe. - Add a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe Index: configDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/configDialog.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** configDialog.py 8 Mar 2004 18:15:31 -0000 1.57 --- configDialog.py 11 Apr 2004 03:16:07 -0000 1.58 *************** *** 1158,1162 **** #update keybindings and re-bind #update user help sources menu ! winInstances=self.parent.instanceDict.keys() for instance in winInstances: instance.ResetColorizer() --- 1158,1162 ---- #update keybindings and re-bind #update user help sources menu ! winInstances=self.parent.instance_dict.keys() for instance in winInstances: instance.ResetColorizer() *************** *** 1184,1187 **** Button(root,text='Dialog', command=lambda:ConfigDialog(root,'Settings')).pack() ! root.instanceDict={} root.mainloop() --- 1184,1187 ---- Button(root,text='Dialog', command=lambda:ConfigDialog(root,'Settings')).pack() ! root.instance_dict={} root.mainloop() From aimacintyre at users.sourceforge.net Sun Apr 11 08:02:28 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 11 08:16:02 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.287, 1.288 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31650 Modified Files: socketmodule.c Log Message: Fixes for AF_UNIX support on OS/2: - return the full size of the sockaddr_un structure, without which bind() fails with EINVAL; - set test_socketserver to use a socket name that meets the form required by the underlying implementation; - don't bother exercising the forking AF_UNIX tests on EMX - its fork() can't handle the stress. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.287 retrieving revision 1.288 diff -C2 -d -r1.287 -r1.288 *** socketmodule.c 4 Apr 2004 07:13:49 -0000 1.287 --- socketmodule.c 11 Apr 2004 12:02:25 -0000 1.288 *************** *** 967,971 **** --- 967,975 ---- addr->sun_path[len] = 0; *addr_ret = (struct sockaddr *) addr; + #if defined(PYOS_OS2) + *len_ret = sizeof(*addr); + #else *len_ret = len + sizeof(*addr) - sizeof(addr->sun_path); + #endif return 1; } From aimacintyre at users.sourceforge.net Sun Apr 11 08:03:59 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 11 08:17:34 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_socketserver.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31902 Modified Files: test_socketserver.py Log Message: Fixes for AF_UNIX support on OS/2: - return the full size of the sockaddr_un structure, without which bind() fails with EINVAL; - set test_socketserver to use a socket name that meets the form required by the underlying implementation; - don't bother exercising the forking AF_UNIX tests on EMX - its fork() can't handle the stress. Index: test_socketserver.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socketserver.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_socketserver.py 12 Feb 2004 17:35:11 -0000 1.9 --- test_socketserver.py 11 Apr 2004 12:03:57 -0000 1.10 *************** *** 95,98 **** --- 95,111 ---- else: fn = TESTFN + str(pickport()) + if os.name == 'os2': + # AF_UNIX socket names on OS/2 require a specific prefix + # which can't include a drive letter and must also use + # backslashes as directory separators + if fn[1] == ':': + fn = fn[2:] + if fn[0] in (os.sep, os.altsep): + fn = fn[1:] + fn = os.path.join('\socket', fn) + if os.sep == '/': + fn = fn.replace(os.sep, os.altsep) + else: + fn = fn.replace(os.altsep, os.sep) testfiles.append(fn) return fn *************** *** 136,144 **** else: class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass ! streamservers = [UnixStreamServer, ThreadingUnixStreamServer, ! ForkingUnixStreamServer] class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass ! dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer, ! ForkingUnixDatagramServer] def testall(): --- 149,159 ---- else: class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass ! streamservers = [UnixStreamServer, ThreadingUnixStreamServer] ! if hasattr(os, 'fork') and os.name not in ('os2',): ! streamservers.append(ForkingUnixStreamServer) class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass ! dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer] ! if hasattr(os, 'fork') and os.name not in ('os2',): ! dgramservers.append(ForkingUnixDatagramServer) def testall(): From aimacintyre at users.sourceforge.net Sun Apr 11 08:05:30 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 11 08:19:04 2004 Subject: [Python-checkins] python/dist/src/PC/os2emx README.os2emx,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32094 Modified Files: README.os2emx Log Message: add AF_UNIX notes Index: README.os2emx =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2emx/README.os2emx,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** README.os2emx 2 Dec 2003 12:23:07 -0000 1.8 --- README.os2emx 11 Apr 2004 12:05:28 -0000 1.9 *************** *** 642,645 **** --- 642,653 ---- used in GNU Mailman. + 26. AF_UNIX sockets, otherwise known as Unix domain sockets, are now + supported. Unfortunately, there are some traps arising from the + implementation in IBM's TCP/IP stack:- + - the path name must start with '\\socket\\' ('/socket/' won't work!), + with the length of the full path name less than 108 characters; + - unlike Unix, the socket endpoints don't exist in the filesystem; + - by default, sockets are in binary mode. + ... probably other issues that I've not encountered, or don't remember :-( *************** *** 681,683 **** Web: http://www.andymac.org/ ! 2 December, 2003. --- 689,691 ---- Web: http://www.andymac.org/ ! 11 April, 2004. From aimacintyre at users.sourceforge.net Sun Apr 11 08:10:05 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 11 08:23:38 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.271.6.6, 1.271.6.7 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv589 Modified Files: Tag: release23-maint socketmodule.c Log Message: Backport to 2.3: Fixes for AF_UNIX support on OS/2: - return the full size of the sockaddr_un structure, without which bind() fails with EINVAL; - set test_socketserver to use a socket name that meets the form required by the underlying implementation; - don't bother exercising the forking AF_UNIX tests on EMX - its fork() can't handle the stress. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.271.6.6 retrieving revision 1.271.6.7 diff -C2 -d -r1.271.6.6 -r1.271.6.7 *** socketmodule.c 4 Apr 2004 07:19:27 -0000 1.271.6.6 --- socketmodule.c 11 Apr 2004 12:10:03 -0000 1.271.6.7 *************** *** 951,955 **** --- 951,959 ---- addr->sun_path[len] = 0; *addr_ret = (struct sockaddr *) addr; + #if defined(PYOS_OS2) + *len_ret = sizeof(*addr); + #else *len_ret = len + sizeof(*addr) - sizeof(addr->sun_path); + #endif return 1; } From aimacintyre at users.sourceforge.net Sun Apr 11 08:12:34 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 11 08:26:06 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_socketserver.py, 1.8, 1.8.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1136 Modified Files: Tag: release23-maint test_socketserver.py Log Message: Backport to 2.3: Fixes for AF_UNIX support on OS/2: - return the full size of the sockaddr_un structure, without which bind() fails with EINVAL; - set test_socketserver to use a socket name that meets the form required by the underlying implementation; - don't bother exercising the forking AF_UNIX tests on EMX - its fork() can't handle the stress. Index: test_socketserver.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socketserver.py,v retrieving revision 1.8 retrieving revision 1.8.14.1 diff -C2 -d -r1.8 -r1.8.14.1 *** test_socketserver.py 2 Jan 2003 12:49:00 -0000 1.8 --- test_socketserver.py 11 Apr 2004 12:12:31 -0000 1.8.14.1 *************** *** 95,98 **** --- 95,111 ---- else: fn = TESTFN + str(pickport()) + if os.name == 'os2': + # AF_UNIX socket names on OS/2 require a specific prefix + # which can't include a drive letter and must also use + # backslashes as directory separators + if fn[1] == ':': + fn = fn[2:] + if fn[0] in (os.sep, os.altsep): + fn = fn[1:] + fn = os.path.join('\socket', fn) + if os.sep == '/': + fn = fn.replace(os.sep, os.altsep) + else: + fn = fn.replace(os.altsep, os.sep) testfiles.append(fn) return fn *************** *** 136,144 **** else: class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass ! streamservers = [UnixStreamServer, ThreadingUnixStreamServer, ! ForkingUnixStreamServer] class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass ! dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer, ! ForkingUnixDatagramServer] def testall(): --- 149,159 ---- else: class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): pass ! streamservers = [UnixStreamServer, ThreadingUnixStreamServer] ! if hasattr(os, 'fork') and os.name not in ('os2',): ! streamservers.append(ForkingUnixStreamServer) class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): pass ! dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer] ! if hasattr(os, 'fork') and os.name not in ('os2',): ! dgramservers.append(ForkingUnixDatagramServer) def testall(): From aimacintyre at users.sourceforge.net Sun Apr 11 08:13:56 2004 From: aimacintyre at users.sourceforge.net (aimacintyre@users.sourceforge.net) Date: Sun Apr 11 08:27:28 2004 Subject: [Python-checkins] python/dist/src/PC/os2emx README.os2emx, 1.7.6.1, 1.7.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1379 Modified Files: Tag: release23-maint README.os2emx Log Message: add AF_UNIX notes Index: README.os2emx =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2emx/README.os2emx,v retrieving revision 1.7.6.1 retrieving revision 1.7.6.2 diff -C2 -d -r1.7.6.1 -r1.7.6.2 *** README.os2emx 2 Dec 2003 12:39:59 -0000 1.7.6.1 --- README.os2emx 11 Apr 2004 12:13:53 -0000 1.7.6.2 *************** *** 1,3 **** ! This is a port of Python 2.3.3 to OS/2 using the EMX development tools ========================================================================= --- 1,3 ---- ! This is a port of Python 2.3.4 to OS/2 using the EMX development tools ========================================================================= *************** *** 5,9 **** ------------------------------------- ! Another day, another version... --- 5,13 ---- ------------------------------------- ! - AF_UNIX (Unix domain, or local IPC) sockets now supported. ! - a core-dump causing bug associated with file buffers has been ! fixed. ! - added support for os.spawnvp(), os.spawnvpe(), os.spawnlp() ! and os.spawnlpe(). *************** *** 626,632 **** I've regretfully recommended that the person who reported the failure take this up with eCS support. Since this report, I have received a ! followup which suggests that the problem may have been a buggy network ! card driver. I think it suffices to say that BitTorrent is a fair stress ! test of a system's networking capability. ... probably other issues that I've not encountered, or don't remember :-( --- 630,645 ---- I've regretfully recommended that the person who reported the failure take this up with eCS support. Since this report, I have received a ! followup which suggests that the problem may be due to bugs in the ! 32bit TCP/IP stack (TCP/IP v4.1 and later, v4.3 in particular). ! I think it suffices to say that BitTorrent is a fair stress test of a ! system's networking capability. ! ! 25. AF_UNIX sockets, otherwise known as Unix domain sockets, are now ! supported. Unfortunately, there are some traps arising from the ! implementation in IBM's TCP/IP stack:- ! - the path name must start with '\\socket\\' ('/socket/' won't work!), ! with the length of the full path name less than 108 characters; ! - unlike Unix, the socket endpoints don't exist in the filesystem; ! - by default, sockets are in binary mode. ... probably other issues that I've not encountered, or don't remember :-( *************** *** 669,671 **** Web: http://www.andymac.org/ ! 2 December, 2003. --- 682,684 ---- Web: http://www.andymac.org/ ! 11 April, 2004. From rhettinger at users.sourceforge.net Sun Apr 11 10:59:35 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Apr 11 11:13:10 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.395,2.396 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28196 Modified Files: ceval.c Log Message: Some (but not all) of the why code bitfield tests ran faster as separate equality tests. Now, all are set to their best timing. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.395 retrieving revision 2.396 diff -C2 -d -r2.395 -r2.396 *** ceval.c 10 Apr 2004 23:34:17 -0000 2.395 --- ceval.c 11 Apr 2004 14:59:33 -0000 2.396 *************** *** 1651,1655 **** why = (enum why_code) PyInt_AS_LONG(v); assert(why != WHY_YIELD); ! if (why & (WHY_RETURN | WHY_CONTINUE)) retval = POP(); } --- 1651,1656 ---- why = (enum why_code) PyInt_AS_LONG(v); assert(why != WHY_YIELD); ! if (why == WHY_RETURN || ! why == WHY_CONTINUE) retval = POP(); } *************** *** 2290,2294 **** /* Double-check exception status */ ! if (why & (WHY_EXCEPTION | WHY_RERAISE)) { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_SystemError, --- 2291,2295 ---- /* Double-check exception status */ ! if (why == WHY_EXCEPTION || why == WHY_RERAISE) { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_SystemError, *************** *** 2412,2416 **** if (tstate->use_tracing) { if (tstate->c_tracefunc ! && (why & (WHY_RETURN | WHY_YIELD))) { if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, f, --- 2413,2417 ---- if (tstate->use_tracing) { if (tstate->c_tracefunc ! && (why == WHY_RETURN || why == WHY_YIELD)) { if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, f, From tim_one at users.sourceforge.net Sun Apr 11 13:29:14 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Apr 11 13:42:51 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21737/PCbuild Modified Files: readme.txt Log Message: Record Tcl and Tk test results for WinXP Pro. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** readme.txt 20 Mar 2004 21:00:26 -0000 1.49 --- readme.txt 11 Apr 2004 17:29:12 -0000 1.50 *************** *** 90,95 **** XXX Should we compile with OPTS=threads? ! XXX Some tests failed in "nmake -f makefile.vc test". On Win2K: ! XXX all.tcl Total 10480 Passed 9781 Skipped 698 Failed 1 Build Tk --- 90,100 ---- XXX Should we compile with OPTS=threads? ! Optional: run tests, via ! nmake -f makefile.vc test ! ! On WinXP Pro, wholly up to date as of 11-Apr-2004: ! all.tcl: Total 10564 Passed 9855 Skipped 708 Failed 1 ! Sourced 129 Test Files. ! Files with failing tests: httpold.test Build Tk *************** *** 101,111 **** XXX Should we compile with OPTS=threads? - XXX I have no idea whether "nmake -f makefile.vc test" passed or - XXX failed. It popped up tons of little windows, and did lots of - XXX stuff, and nothing blew up. - XXX Our installer copies a lot of stuff out of the Tcl/Tk install XXX directory. Is all of that really needed for Python use of Tcl/Tk? Make sure the installer matches ------------------------------- --- 106,121 ---- XXX Should we compile with OPTS=threads? XXX Our installer copies a lot of stuff out of the Tcl/Tk install XXX directory. Is all of that really needed for Python use of Tcl/Tk? + Optional: run tests, via + nmake -f makefile.vc TCLDIR=..\..\tcl8.4.5 test + + On WinXP Pro, wholly up to date as of 11-Apr-2004: + all.tcl: Total 8327 Passed 6717 Skipped 1579 Failed 31 + Sourced 182 Test Files. + Files with failing tests: canvImg.test scale.test scrollbar.test textWind.test winWm.test + + Make sure the installer matches ------------------------------- *************** *** 160,178 **** and download version 4.2.52. ! ! With or without strong cryptography? You can choose either with or ! without strong cryptography, as per the instructions below. By default, Python is built and distributed WITHOUT strong crypto XXX - is the above correct? ! Unpack into the dist\. directory, ensuring you expand with folder names. ! If you downloaded with strong crypto, this will create a dist\db-4.2.52 directory, and is ready to use. ! ! If you downloaded WITHOUT strong crypto, this will create a dist\db-4.2.52.NC directory - this directory should be renamed to dist\db-4.2.52 before use. ! Open dist\db-4.2.52\docs\index.html --- 170,188 ---- and download version 4.2.52. ! ! With or without strong cryptography? You can choose either with or ! without strong cryptography, as per the instructions below. By default, Python is built and distributed WITHOUT strong crypto XXX - is the above correct? ! Unpack into the dist\. directory, ensuring you expand with folder names. ! If you downloaded with strong crypto, this will create a dist\db-4.2.52 directory, and is ready to use. ! ! If you downloaded WITHOUT strong crypto, this will create a dist\db-4.2.52.NC directory - this directory should be renamed to dist\db-4.2.52 before use. ! Open dist\db-4.2.52\docs\index.html From tim_one at users.sourceforge.net Sun Apr 11 13:45:33 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Apr 11 13:59:09 2004 Subject: [Python-checkins] python/dist/src/PCbuild bz2.vcproj, 1.1, 1.2 readme.txt, 1.50, 1.51 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24033/PCbuild Modified Files: bz2.vcproj readme.txt Log Message: The native bz2 tests worked fine for me under WinXP Pro + VC7.1, so removed the comment saying they don't work, and changed the build step to run them. If they're failing for someone else, please give details about what failed. Index: bz2.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/bz2.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bz2.vcproj 2 Jan 2004 21:13:59 -0000 1.1 --- bz2.vcproj 11 Apr 2004 17:45:31 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- Version="7.10" Name="bz2" + RootNamespace="bz2" SccProjectName="bz2" SccLocalPath=".."> *************** *** 63,67 **** Name="VCPreLinkEventTool" CommandLine="cd ..\..\bzip2-1.0.2 ! nmake /nologo /f makefile.msc lib "/> Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30504/PCbuild Modified Files: readme.txt Log Message: Update the OpenSSL version example from c to d (the current stable one), Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** readme.txt 11 Apr 2004 17:45:31 -0000 1.51 --- readme.txt 11 Apr 2004 18:23:06 -0000 1.52 *************** *** 183,186 **** --- 183,191 ---- dist\db-4.2.52 before use. + As of 11-Apr-2004, you also need to download and manually apply two + patches before proceeding (and the sleepycat download page tells you + about this). Cygwin patch worked for me. cd to dist\db-4.2.52 and + use "patch -p0 < patchfile" once for each downloaded patchfile. + Open dist\db-4.2.52\docs\index.html *************** *** 244,250 **** You (probably) don't want the "engine" code. For example, get ! openssl-0.9.7c.tar.gz not ! openssl-engine-0.9.7c.tar.gz Unpack into the "dist" directory, retaining the folder name from --- 249,255 ---- You (probably) don't want the "engine" code. For example, get ! openssl-0.9.7d.tar.gz not ! openssl-engine-0.9.7d.tar.gz Unpack into the "dist" directory, retaining the folder name from From tim_one at users.sourceforge.net Sun Apr 11 15:03:02 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Apr 11 15:16:41 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4962/python/PCbuild Modified Files: readme.txt Log Message: Record test_bsddb3 test results on WinXP. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** readme.txt 11 Apr 2004 18:23:06 -0000 1.52 --- readme.txt 11 Apr 2004 19:02:59 -0000 1.53 *************** *** 241,244 **** --- 241,254 ---- XXX threads are invisible to unittest). + XXX 11-Apr-2004 tim + XXX On WinXP Pro, I got one failure from test_bsddb3: + XXX + XXX ERROR: test04_n_flag (bsddb.test.test_compat.CompatibilityTestCase) + XXX Traceback (most recent call last): + XXX File "C:\Code\python\lib\bsddb\test\test_compat.py", line 86, in test04_n_flag + XXX f = hashopen(self.filename, 'n') + XXX File "C:\Code\python\lib\bsddb\__init__.py", line 293, in hashopen + XXX d.open(file, db.DB_HASH, flags, mode) + XXX DBInvalidArgError: (22, 'Invalid argument -- DB_TRUNCATE illegal with locking specified') _ssl From rhettinger at users.sourceforge.net Mon Apr 12 09:05:12 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 12 09:18:57 2004 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.200,2.201 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16419 Modified Files: listobject.c Log Message: * Specialize ins1() into app1() for appends. Saves several unnecessary steps and further improves the speed of list append. * Add guards to the list iterator length method to handle corner cases. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.200 retrieving revision 2.201 diff -C2 -d -r2.200 -r2.201 *** listobject.c 20 Mar 2004 22:19:23 -0000 2.200 --- listobject.c 12 Apr 2004 13:05:09 -0000 2.201 *************** *** 181,184 **** --- 181,204 ---- } + static int + app1(PyListObject *self, PyObject *v) + { + int n = PyList_GET_SIZE(self); + + assert (v != NULL); + if (n == INT_MAX) { + PyErr_SetString(PyExc_OverflowError, + "cannot add more objects to list"); + return -1; + } + + if (list_resize(self, n+1) == -1) + return -1; + + Py_INCREF(v); + PyList_SET_ITEM(self, n, v); + return 0; + } + int PyList_Append(PyObject *op, PyObject *newitem) *************** *** 188,193 **** return -1; } ! return ins1((PyListObject *)op, ! (int) ((PyListObject *)op)->ob_size, newitem); } --- 208,216 ---- return -1; } ! if (newitem == NULL) { ! PyErr_BadInternalCall(); ! return -1; ! } ! return app1((PyListObject *)op, newitem); } *************** *** 727,731 **** PyList_SET_ITEM(self, i, item); /* steals ref */ else { ! int status = ins1(self, self->ob_size, item); Py_DECREF(item); /* append creates a new ref */ if (status < 0) --- 750,754 ---- PyList_SET_ITEM(self, i, item); /* steals ref */ else { ! int status = app1(self, item); Py_DECREF(item); /* append creates a new ref */ if (status < 0) *************** *** 2685,2690 **** listiter_len(listiterobject *it) { ! if (it->it_seq) ! return PyList_GET_SIZE(it->it_seq) - it->it_index; return 0; } --- 2708,2717 ---- listiter_len(listiterobject *it) { ! int len; ! if (it->it_seq) { ! len = PyList_GET_SIZE(it->it_seq) - it->it_index; ! if (len >= 0) ! return len; ! } return 0; } *************** *** 2800,2804 **** listreviter_len(listreviterobject *it) { ! return it->it_index + 1; } --- 2827,2834 ---- listreviter_len(listreviterobject *it) { ! int len = it->it_index + 1; ! if (it->it_seq == NULL || PyList_GET_SIZE(it->it_seq) < len) ! return 0; ! return len; } From rhettinger at users.sourceforge.net Mon Apr 12 10:01:23 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 12 10:15:09 2004 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.201,2.202 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27456 Modified Files: listobject.c Log Message: Small refactoring saving one function() and eliminating some indirection. * Applied app1() to listappend(). * Inlined ins() into its one remaining caller. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.201 retrieving revision 2.202 diff -C2 -d -r2.201 -r2.202 *** listobject.c 12 Apr 2004 13:05:09 -0000 2.201 --- listobject.c 12 Apr 2004 14:01:16 -0000 2.202 *************** *** 647,659 **** static PyObject * - ins(PyListObject *self, int where, PyObject *v) - { - if (ins1(self, where, v) != 0) - return NULL; - Py_INCREF(Py_None); - return Py_None; - } - - static PyObject * listinsert(PyListObject *self, PyObject *args) { --- 647,650 ---- *************** *** 662,666 **** if (!PyArg_ParseTuple(args, "iO:insert", &i, &v)) return NULL; ! return ins(self, i, v); } --- 653,661 ---- if (!PyArg_ParseTuple(args, "iO:insert", &i, &v)) return NULL; ! if (ins1(self, i, v) == 0) { ! Py_INCREF(Py_None); ! return Py_None; ! } ! return NULL; } *************** *** 668,672 **** listappend(PyListObject *self, PyObject *v) { ! return ins(self, (int) self->ob_size, v); } --- 663,671 ---- listappend(PyListObject *self, PyObject *v) { ! if (app1(self, v) == 0) { ! Py_INCREF(Py_None); ! return Py_None; ! } ! return NULL; } From hkejnh at msn.com Mon Apr 12 08:09:13 2004 From: hkejnh at msn.com (Simon Frye) Date: Mon Apr 12 11:09:15 2004 Subject: [Python-checkins] Re: this works Message-ID: <200404121116.i3CBG3kj034940@mxzilla4.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040412/a0c9dd74/attachment.html From ltelgk at yahoo.com Mon Apr 12 16:23:26 2004 From: ltelgk at yahoo.com (Cedric Mason) Date: Mon Apr 12 12:14:46 2004 Subject: [Python-checkins] super penile advancments Message-ID: Really lay the PIPE to the next girl you screw... http://marsupial.tachea.com/vp5 take off- http://commandeer.diffrs.com/a.html staple allegra arden From rhettinger at users.sourceforge.net Mon Apr 12 13:21:06 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 12 13:34:52 2004 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.202,2.203 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5675 Modified Files: listobject.c Log Message: Use Py_RETURN_NONE macro where applicable. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.202 retrieving revision 2.203 diff -C2 -d -r2.202 -r2.203 *** listobject.c 12 Apr 2004 14:01:16 -0000 2.202 --- listobject.c 12 Apr 2004 17:21:03 -0000 2.203 *************** *** 653,660 **** if (!PyArg_ParseTuple(args, "iO:insert", &i, &v)) return NULL; ! if (ins1(self, i, v) == 0) { ! Py_INCREF(Py_None); ! return Py_None; ! } return NULL; } --- 653,658 ---- if (!PyArg_ParseTuple(args, "iO:insert", &i, &v)) return NULL; ! if (ins1(self, i, v) == 0) ! Py_RETURN_NONE; return NULL; } *************** *** 663,670 **** listappend(PyListObject *self, PyObject *v) { ! if (app1(self, v) == 0) { ! Py_INCREF(Py_None); ! return Py_None; ! } return NULL; } --- 661,666 ---- listappend(PyListObject *self, PyObject *v) { ! if (app1(self, v) == 0) ! Py_RETURN_NONE; return NULL; } *************** *** 2090,2095 **** if (self->ob_size > 1) reverse_slice(self->ob_item, self->ob_item + self->ob_size); ! Py_INCREF(Py_None); ! return Py_None; } --- 2086,2090 ---- if (self->ob_size > 1) reverse_slice(self->ob_item, self->ob_item + self->ob_size); ! Py_RETURN_NONE; } *************** *** 2191,2198 **** if (cmp > 0) { if (list_ass_slice(self, i, i+1, ! (PyObject *)NULL) != 0) ! return NULL; ! Py_INCREF(Py_None); ! return Py_None; } else if (cmp < 0) --- 2186,2192 ---- if (cmp > 0) { if (list_ass_slice(self, i, i+1, ! (PyObject *)NULL) == 0) ! Py_RETURN_NONE; ! return NULL; } else if (cmp < 0) From rhettinger at users.sourceforge.net Mon Apr 12 14:10:03 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 12 14:23:50 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14740/Modules Modified Files: collectionsmodule.c Log Message: * Add unittests for iterators that report their length * Document the differences between them * Fix corner cases covered by the unittests * Use Py_RETURN_NONE where possible for dictionaries Index: collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** collectionsmodule.c 18 Mar 2004 11:04:57 -0000 1.12 --- collectionsmodule.c 12 Apr 2004 18:10:01 -0000 1.13 *************** *** 771,774 **** --- 771,775 ---- if (it->len != it->deque->len) { it->len = -1; /* Make this state sticky */ + it->counter = 0; PyErr_SetString(PyExc_RuntimeError, "deque changed size during iteration"); *************** *** 861,864 **** --- 862,866 ---- if (it->len != it->deque->len) { it->len = -1; /* Make this state sticky */ + it->counter = 0; PyErr_SetString(PyExc_RuntimeError, "deque changed size during iteration"); From rhettinger at users.sourceforge.net Mon Apr 12 14:10:03 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 12 14:23:53 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_iterlen.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14740/Lib/test Added Files: test_iterlen.py Log Message: * Add unittests for iterators that report their length * Document the differences between them * Fix corner cases covered by the unittests * Use Py_RETURN_NONE where possible for dictionaries --- NEW FILE: test_iterlen.py --- """ Test Iterator Length Transparency Some functions or methods which accept general iterable arguments have optional, more efficient code paths if they know how many items to expect. For instance, map(func, iterable), will pre-allocate the exact amount of space required whenever the iterable can report its length. The desired invariant is: len(it)==len(list(it)). A complication is that an iterable and iterator can be the same object. To maintain the invariant, an iterator needs to dynamically update its length. For instance, an iterable such as xrange(10) always reports its length as ten, but it=iter(xrange(10)) starts at ten, and then goes to nine after it.next(). Having this capability means that map() can ignore the distinction between map(func, iterable) and map(func, iter(iterable)). When the iterable is immutable, the implementation can straight-forwardly report the original length minus the cumulative number of calls to next(). This is the case for tuples, xrange objects, and itertools.repeat(). Some containers become temporarily immutable during iteration. This includes dicts, sets, and collections.deque. Their implementation is equally simple though they need to permantently set their length to zero whenever there is an attempt to iterate after a length mutation. The situation slightly more involved whenever an object allows length mutation during iteration. Lists and sequence iterators are dynanamically updatable. So, if a list is extended during iteration, the iterator will continue through the new items. If it shrinks to a point before the most recent iteration, then no further items are available and the length is reported at zero. Reversed objects can also be wrapped around mutable objects; however, any appends after the current position are ignored. Any other approach leads to confusion and possibly returning the same item more than once. The iterators not listed above, such as enumerate and the other itertools, are not length transparent because they have no way to distinguish between iterables that report static length and iterators whose length changes with each call (i.e. the difference between enumerate('abc') and enumerate(iter('abc')). """ import unittest from test import test_support from itertools import repeat, count from collections import deque from UserList import UserList n = 10 class TestInvariantWithoutMutations(unittest.TestCase): def test_invariant(self): it = self.it for i in reversed(xrange(1, n+1)): self.assertEqual(len(it), i) it.next() self.assertEqual(len(it), 0) self.assertRaises(StopIteration, it.next) self.assertEqual(len(it), 0) class TestTemporarilyImmutable(TestInvariantWithoutMutations): def test_immutable_during_iteration(self): # objects such as deques, sets, and dictionaries enforce # length immutability during iteration it = self.it self.assertEqual(len(it), n) it.next() self.assertEqual(len(it), n-1) self.mutate() self.assertRaises(RuntimeError, it.next) self.assertEqual(len(it), 0) ## ------- Concrete Type Tests ------- class TestRepeat(TestInvariantWithoutMutations): def setUp(self): self.it = repeat(None, n) def test_no_len_for_infinite_repeat(self): # The repeat() object can also be infinite self.assertRaises(TypeError, len, repeat(None)) class TestXrange(TestInvariantWithoutMutations): def setUp(self): self.it = iter(xrange(n)) class TestXrangeCustomReversed(TestInvariantWithoutMutations): def setUp(self): self.it = reversed(xrange(n)) class TestTuple(TestInvariantWithoutMutations): def setUp(self): self.it = iter(tuple(xrange(n))) ## ------- Types that should not be mutated during iteration ------- class TestDeque(TestTemporarilyImmutable): def setUp(self): d = deque(xrange(n)) self.it = iter(d) self.mutate = d.pop class TestDequeReversed(TestTemporarilyImmutable): def setUp(self): d = deque(xrange(n)) self.it = reversed(d) self.mutate = d.pop class TestDictKeys(TestTemporarilyImmutable): def setUp(self): d = dict.fromkeys(xrange(n)) self.it = iter(d) self.mutate = d.popitem class TestDictItems(TestTemporarilyImmutable): def setUp(self): d = dict.fromkeys(xrange(n)) self.it = d.iteritems() self.mutate = d.popitem class TestDictValues(TestTemporarilyImmutable): def setUp(self): d = dict.fromkeys(xrange(n)) self.it = d.itervalues() self.mutate = d.popitem class TestSet(TestTemporarilyImmutable): def setUp(self): d = set(xrange(n)) self.it = iter(d) self.mutate = d.pop ## ------- Types that can mutate during iteration ------- class TestList(TestInvariantWithoutMutations): def setUp(self): self.it = iter(range(n)) def test_mutation(self): d = range(n) it = iter(d) it.next() it.next() self.assertEqual(len(it), n-2) d.append(n) self.assertEqual(len(it), n-1) # grow with append d[1:] = [] self.assertEqual(len(it), 0) self.assertEqual(list(it), []) d.extend(xrange(20)) self.assertEqual(len(it), 0) class TestListReversed(TestInvariantWithoutMutations): def setUp(self): self.it = reversed(range(n)) def test_mutation(self): d = range(n) it = reversed(d) it.next() it.next() self.assertEqual(len(it), n-2) d.append(n) self.assertEqual(len(it), n-2) # ignore append d[1:] = [] self.assertEqual(len(it), 0) self.assertEqual(list(it), []) # confirm invariant d.extend(xrange(20)) self.assertEqual(len(it), 0) class TestSeqIter(TestInvariantWithoutMutations): def setUp(self): self.it = iter(UserList(range(n))) def test_mutation(self): d = UserList(range(n)) it = iter(d) it.next() it.next() self.assertEqual(len(it), n-2) d.append(n) self.assertEqual(len(it), n-1) # grow with append d[1:] = [] self.assertEqual(len(it), 0) self.assertEqual(list(it), []) d.extend(xrange(20)) self.assertEqual(len(it), 0) class TestSeqIterReversed(TestInvariantWithoutMutations): def setUp(self): self.it = reversed(UserList(range(n))) def test_mutation(self): d = UserList(range(n)) it = reversed(d) it.next() it.next() self.assertEqual(len(it), n-2) d.append(n) self.assertEqual(len(it), n-2) # ignore append d[1:] = [] self.assertEqual(len(it), 0) self.assertEqual(list(it), []) # confirm invariant d.extend(xrange(20)) self.assertEqual(len(it), 0) if __name__ == "__main__": unittests = [ TestRepeat, TestXrange, TestXrangeCustomReversed, TestTuple, TestDeque, TestDequeReversed, TestDictKeys, TestDictItems, TestDictValues, TestSet, TestList, TestListReversed, TestSeqIter, TestSeqIterReversed, ] test_support.run_unittest(*unittests) From rhettinger at users.sourceforge.net Mon Apr 12 14:10:04 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 12 14:23:55 2004 Subject: [Python-checkins] python/dist/src/Objects dictobject.c, 2.158, 2.159 enumobject.c, 1.15, 1.16 iterobject.c, 1.17, 1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14740/Objects Modified Files: dictobject.c enumobject.c iterobject.c Log Message: * Add unittests for iterators that report their length * Document the differences between them * Fix corner cases covered by the unittests * Use Py_RETURN_NONE where possible for dictionaries Index: dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.158 retrieving revision 2.159 diff -C2 -d -r2.158 -r2.159 *** dictobject.c 20 Mar 2004 19:11:58 -0000 2.158 --- dictobject.c 12 Apr 2004 18:10:01 -0000 2.159 *************** *** 1089,1096 **** dict_update(PyObject *self, PyObject *args, PyObject *kwds) { ! if (dict_update_common(self, args, kwds, "update") == -1) ! return NULL; ! Py_INCREF(Py_None); ! return Py_None; } --- 1089,1095 ---- dict_update(PyObject *self, PyObject *args, PyObject *kwds) { ! if (dict_update_common(self, args, kwds, "update") != -1) ! Py_RETURN_NONE; ! return NULL; } *************** *** 1594,1599 **** { PyDict_Clear((PyObject *)mp); ! Py_INCREF(Py_None); ! return Py_None; } --- 1593,1597 ---- { PyDict_Clear((PyObject *)mp); ! Py_RETURN_NONE; } *************** *** 2051,2055 **** dictiter_len(dictiterobject *di) { ! return di->len; } --- 2049,2055 ---- dictiter_len(dictiterobject *di) { ! if (di->di_dict != NULL && di->di_used == di->di_dict->ma_used) ! return di->len; ! return 0; } Index: enumobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/enumobject.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** enumobject.c 10 Mar 2004 10:10:42 -0000 1.15 --- enumobject.c 12 Apr 2004 18:10:01 -0000 1.16 *************** *** 226,229 **** --- 226,232 ---- return item; } + if (PyErr_ExceptionMatches(PyExc_IndexError) || + PyErr_ExceptionMatches(PyExc_StopIteration)) + PyErr_Clear(); } ro->index = -1; *************** *** 243,247 **** reversed_len(reversedobject *ro) { ! return ro->index + 1; } --- 246,258 ---- reversed_len(reversedobject *ro) { ! int position, seqsize; ! ! if (ro->seq == NULL) ! return 0; ! seqsize = PySequence_Size(ro->seq); ! if (seqsize == -1) ! return -1; ! position = ro->index + 1; ! return (seqsize < position) ? 0 : position; } Index: iterobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/iterobject.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** iterobject.c 18 Mar 2004 22:43:09 -0000 1.17 --- iterobject.c 12 Apr 2004 18:10:01 -0000 1.18 *************** *** 75,80 **** iter_len(seqiterobject *it) { ! if (it->it_seq) ! return PyObject_Size(it->it_seq) - it->it_index; return 0; } --- 75,88 ---- iter_len(seqiterobject *it) { ! int seqsize, len; ! ! if (it->it_seq) { ! seqsize = PySequence_Size(it->it_seq); ! if (seqsize == -1) ! return -1; ! len = seqsize - it->it_index; ! if (len >= 0) ! return len; ! } return 0; } From bcannon at users.sourceforge.net Mon Apr 12 22:43:56 2004 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Apr 12 22:57:46 2004 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.31, 1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16820/Modules Modified Files: itertoolsmodule.c Log Message: Change two instance of format strings for PyString_FromFormat() to use %ld instead of %d . Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** itertoolsmodule.c 8 Apr 2004 21:54:00 -0000 1.31 --- itertoolsmodule.c 13 Apr 2004 02:43:53 -0000 1.32 *************** *** 2055,2059 **** count_repr(countobject *lz) { ! return PyString_FromFormat("count(%d)", lz->cnt); } --- 2055,2059 ---- count_repr(countobject *lz) { ! return PyString_FromFormat("count(%ld)", lz->cnt); } *************** *** 2375,2379 **** PyString_AS_STRING(objrepr)); else ! result = PyString_FromFormat("repeat(%s, %d)", PyString_AS_STRING(objrepr), ro->cnt); Py_DECREF(objrepr); --- 2375,2379 ---- PyString_AS_STRING(objrepr)); else ! result = PyString_FromFormat("repeat(%s, %ld)", PyString_AS_STRING(objrepr), ro->cnt); Py_DECREF(objrepr); From jhylton at users.sourceforge.net Tue Apr 13 10:53:37 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:07:35 2004 Subject: [Python-checkins] python/dist/src/Parser asdl.py,1.1.2.1,1.1.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451/Parser Modified Files: Tag: ast-branch asdl.py Log Message: Fix Field repr(). Index: asdl.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/Attic/asdl.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** asdl.py 7 Jul 2002 17:34:44 -0000 1.1.2.1 --- asdl.py 13 Apr 2004 14:53:30 -0000 1.1.2.2 *************** *** 253,257 **** return "Field(%s%s)" % (self.type, extra) else: ! return "Field(%s, %s,%s)" % (self.type, self.name, extra) class Sum(AST): --- 253,257 ---- return "Field(%s%s)" % (self.type, extra) else: ! return "Field(%s, %s%s)" % (self.type, self.name, extra) class Sum(AST): From jhylton at users.sourceforge.net Tue Apr 13 10:54:46 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:08:42 2004 Subject: [Python-checkins] python/dist/src/Parser asdl_c.py,1.1.2.2,1.1.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15652/Parser Modified Files: Tag: ast-branch asdl_c.py Log Message: Add incomplete code generator for methods to free ast structures. Problems: - Generates free functions for simple types that don't need extra support. - Doesn't handle all builtin types correctly. Index: asdl_c.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/Attic/asdl_c.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** asdl_c.py 30 Aug 2002 19:11:39 -0000 1.1.2.2 --- asdl_c.py 13 Apr 2004 14:54:43 -0000 1.1.2.3 *************** *** 65,68 **** --- 65,81 ---- return lines + def is_simple(sum): + """Return true if a sum is a simple. + + A sum is simple if its types have no fields, e.g. + unaryop = Invert | Not | UAdd | USub + """ + simple = True + for t in sum.types: + if t.fields: + simple = False + break + return simple + class EmitVisitor(asdl.VisitorBase): """Visit that emits lines""" *************** *** 82,98 **** self.file.write(line) - def is_simple(self, sum): - """Return true if a sum is a simple. - - A sum is simple if its types have no fields, e.g. - unaryop = Invert | Not | UAdd | USub - """ - simple = 1 - for t in sum.types: - if t.fields: - simple = 0 - break - return simple - class TypeDefVisitor(EmitVisitor): def visitModule(self, mod): --- 95,98 ---- *************** *** 104,108 **** def visitSum(self, sum, name, depth): ! if self.is_simple(sum): self.simple_sum(sum, name, depth) else: --- 104,108 ---- def visitSum(self, sum, name, depth): ! if is_simple(sum): self.simple_sum(sum, name, depth) else: *************** *** 143,147 **** def visitSum(self, sum, name, depth): ! if not self.is_simple(sum): self.sum_with_constructors(sum, name, depth) --- 143,147 ---- def visitSum(self, sum, name, depth): ! if not is_simple(sum): self.sum_with_constructors(sum, name, depth) *************** *** 207,211 **** def visitSum(self, sum, name): ! if self.is_simple(sum): pass # XXX else: --- 207,211 ---- def visitSum(self, sum, name): ! if is_simple(sum): pass # XXX else: *************** *** 338,347 **** visitProduct = visitSum = prototype def find_sequence(fields): """Return True if any field uses a sequence.""" for f in fields: if f.seq: ! return 1 ! return 0 class MarshalFunctionVisitor(PickleVisitor): --- 338,431 ---- visitProduct = visitSum = prototype + class FreePrototypeVisitor(PickleVisitor): + + def prototype(self, sum, name): + ctype = get_c_type(name) + self.emit("void free_%s(%s);" % (name, ctype), 0) + + visitProduct = visitSum = prototype + def find_sequence(fields): """Return True if any field uses a sequence.""" for f in fields: if f.seq: ! return True ! return False ! ! def has_sequence(types): ! for t in types: ! if find_sequence(t.fields): ! return True ! return False ! ! class FreeVisitor(PickleVisitor): ! ! def func_begin(self, name, has_seq): ! ctype = get_c_type(name) ! self.emit("void", 0) ! self.emit("free_%s(%s o)" % (name, ctype), 0) ! self.emit("{", 0) ! if has_seq: ! self.emit("int i, n;", 1) ! self.emit("asdl_seq *seq;", 1) ! ! def func_end(self): ! self.emit("}", 0) ! self.emit("", 0) ! ! def visitSum(self, sum, name): ! has_seq = has_sequence(sum.types) ! self.func_begin(name, has_seq) ! if not is_simple(sum): ! self.emit("switch (o->kind) {", 1) ! for i in range(len(sum.types)): ! t = sum.types[i] ! self.visitConstructor(t, i + 1, name) ! self.emit("}", 1) ! self.func_end() ! ! def visitProduct(self, prod, name): ! self.func_begin(name, find_sequence(prod.fields)) ! for field in prod.fields: ! self.visitField(field, name, 1, True) ! self.func_end() ! ! def visitConstructor(self, cons, enum, name): ! self.emit("case %s_kind:" % cons.name, 1) ! for f in cons.fields: ! self.visitField(f, cons.name, 2, False) ! self.emit("break;", 2) ! ! def visitField(self, field, name, depth, product): ! def emit(s, d): ! self.emit(s, depth + d) ! if product: ! value = "o->%s" % field.name ! else: ! value = "o->v.%s.%s" % (name, field.name) ! if field.seq: ! emit("seq = %s;" % value, 0) ! emit("n = asdl_seq_LEN(seq);", 0) ! emit("for (i = 0; i < n; i++)", 0) ! self.free(field, "asdl_seq_GET(seq, i)", depth + 1) ! ! # XXX need to know the simple types in advance, so that we ! # don't call free_TYPE() for them. ! ! elif field.opt: ! emit("if (%s)" % value, 0) ! self.free(field, value, depth + 1) ! else: ! self.free(field, value, depth) ! ! def free(self, field, value, depth): ! if str(field.type) in ("identifier", "string"): ! self.emit("Py_DECREF(%s);" % value, depth) ! elif str(field.type) == "bool": ! return ! else: ! print >> sys.stderr, field.type ! self.emit("free_%s(%s);" % (field.type, value), depth) ! class MarshalFunctionVisitor(PickleVisitor): *************** *** 362,372 **** def visitSum(self, sum, name): ! has_seq = 0 ! for t in sum.types: ! if find_sequence(t.fields): ! has_seq = 1 ! break self.func_begin(name, has_seq) ! simple = self.is_simple(sum) if simple: self.emit("switch (o) {", 1) --- 446,452 ---- def visitSum(self, sum, name): ! has_seq = has_sequence(sum.types) self.func_begin(name, has_seq) ! simple = is_simple(sum) if simple: self.emit("switch (o) {", 1) *************** *** 443,446 **** --- 523,527 ---- StructVisitor(f), PrototypeVisitor(f), + FreePrototypeVisitor(f), MarshalPrototypeVisitor(f), ) *************** *** 458,461 **** --- 539,543 ---- print >> f v = ChainOfVisitors(FunctionVisitor(f), + FreeVisitor(f), MarshalFunctionVisitor(f), ) From jhylton at users.sourceforge.net Tue Apr 13 10:57:33 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:11:29 2004 Subject: [Python-checkins] python/dist/src/Include asdl.h,1.1.2.5,1.1.2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16222/Include Modified Files: Tag: ast-branch asdl.h Log Message: ifdef logic was backwards, so debug versions of asdl seq ops were not used with a debug build. Fix macros to avoid unexpected variable capture and to avoid evaluating index more than once. Index: asdl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Attic/asdl.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** asdl.h 15 Sep 2003 00:25:07 -0000 1.1.2.5 --- asdl.h 13 Apr 2004 14:57:30 -0000 1.1.2.6 *************** *** 27,40 **** void asdl_seq_free(asdl_seq *); - /* XXX: Normally should be Py_DEBUG, but asserts fail instantly at startup; - turned off for now */ - #define asdl_seq_GET(S, I) (S)->elements[(I)] #ifdef Py_DEBUG ! #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) ! #define asdl_seq_APPEND(S, V) (S)->elements[(S)->offset++] = (V) ! #else #define asdl_seq_SET(S, I, V) { \ ! assert((S) && (I) < (S)->size); \ ! (S)->elements[I] = (V); \ } #define asdl_seq_APPEND(S, V) { \ --- 27,36 ---- void asdl_seq_free(asdl_seq *); #ifdef Py_DEBUG ! #define asdl_seq_GET(S, I) (S)->elements[(I)] #define asdl_seq_SET(S, I, V) { \ ! int _asdl_i = (I); \ ! assert((S) && _asdl_i < (S)->size); \ ! (S)->elements[_asdl_i] = (V); \ } #define asdl_seq_APPEND(S, V) { \ *************** *** 42,45 **** --- 38,45 ---- (S)->elements[(S)->offset++] = (V); \ } + #else + #define asdl_seq_GET(S, I) (S)->elements[(I)] + #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) + #define asdl_seq_APPEND(S, V) (S)->elements[(S)->offset++] = (V) #endif #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) From jhylton at users.sourceforge.net Tue Apr 13 10:58:37 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:12:33 2004 Subject: [Python-checkins] python/dist/src/Include Python-ast.h, 1.1.2.7, 1.1.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16447/Include Modified Files: Tag: ast-branch Python-ast.h Log Message: New version of generated AST code to include free routines. The generated version was edited a little by hand to overcome the current limitations of asdl_c.py. Index: Python-ast.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Attic/Python-ast.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** Python-ast.h 28 Mar 2003 02:05:28 -0000 1.1.2.7 --- Python-ast.h 13 Apr 2004 14:58:35 -0000 1.1.2.8 *************** *** 1,3 **** ! /* File automatically generated by ../Parser/asdl_c.py */ #include "asdl.h" --- 1,3 ---- ! /* File automatically generated by Parser/asdl_c.py */ #include "asdl.h" *************** *** 380,383 **** --- 380,397 ---- keyword_ty keyword(identifier arg, expr_ty value); alias_ty alias(identifier name, identifier asname); + void free_mod(mod_ty); + void free_stmt(stmt_ty); + void free_expr(expr_ty); + void free_expr_context(expr_context_ty); + void free_slice(slice_ty); + void free_boolop(boolop_ty); + void free_operator(operator_ty); + void free_unaryop(unaryop_ty); + void free_cmpop(cmpop_ty); + void free_listcomp(listcomp_ty); + void free_excepthandler(excepthandler_ty); + void free_arguments(arguments_ty); + void free_keyword(keyword_ty); + void free_alias(alias_ty); int marshal_write_mod(PyObject **, int *, mod_ty); int marshal_write_stmt(PyObject **, int *, stmt_ty); From jhylton at users.sourceforge.net Tue Apr 13 10:58:38 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:12:38 2004 Subject: [Python-checkins] python/dist/src/Python Python-ast.c, 1.1.2.7, 1.1.2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16447/Python Modified Files: Tag: ast-branch Python-ast.c Log Message: New version of generated AST code to include free routines. The generated version was edited a little by hand to overcome the current limitations of asdl_c.py. Index: Python-ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/Python-ast.c,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** Python-ast.c 28 Mar 2003 02:05:28 -0000 1.1.2.7 --- Python-ast.c 13 Apr 2004 14:58:35 -0000 1.1.2.8 *************** *** 1,3 **** ! /* File automatically generated by ../Parser/asdl_c.py */ #include "Python.h" --- 1,3 ---- ! /* File automatically generated by Parser/asdl_c.py */ #include "Python.h" *************** *** 1041,1044 **** --- 1041,1468 ---- } + void + free_mod(mod_ty o) + { + int i, n; + asdl_seq *seq; + switch (o->kind) { + case Module_kind: + seq = o->v.Module.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case Interactive_kind: + seq = o->v.Interactive.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case Expression_kind: + free_expr(o->v.Expression.body); + break; + case Suite_kind: + seq = o->v.Suite.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + } + } + + void + free_stmt(stmt_ty o) + { + int i, n; + asdl_seq *seq; + switch (o->kind) { + case FunctionDef_kind: + Py_DECREF(o->v.FunctionDef.name); + free_arguments(o->v.FunctionDef.args); + seq = o->v.FunctionDef.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case ClassDef_kind: + Py_DECREF(o->v.ClassDef.name); + seq = o->v.ClassDef.bases; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + seq = o->v.ClassDef.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case Return_kind: + if (o->v.Return.value) + free_expr(o->v.Return.value); + break; + case Yield_kind: + free_expr(o->v.Yield.value); + break; + case Delete_kind: + seq = o->v.Delete.targets; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + break; + case Assign_kind: + seq = o->v.Assign.targets; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + free_expr(o->v.Assign.value); + break; + case AugAssign_kind: + free_expr(o->v.AugAssign.target); + free_operator(o->v.AugAssign.op); + free_expr(o->v.AugAssign.value); + break; + case Print_kind: + if (o->v.Print.dest) + free_expr(o->v.Print.dest); + seq = o->v.Print.values; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + break; + case For_kind: + free_expr(o->v.For.target); + free_expr(o->v.For.iter); + seq = o->v.For.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + seq = o->v.For.orelse; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case While_kind: + free_expr(o->v.While.test); + seq = o->v.While.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + seq = o->v.While.orelse; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case If_kind: + free_expr(o->v.If.test); + seq = o->v.If.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + seq = o->v.If.orelse; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case Raise_kind: + if (o->v.Raise.type) + free_expr(o->v.Raise.type); + if (o->v.Raise.inst) + free_expr(o->v.Raise.inst); + if (o->v.Raise.tback) + free_expr(o->v.Raise.tback); + break; + case TryExcept_kind: + seq = o->v.TryExcept.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + seq = o->v.TryExcept.handlers; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_excepthandler(asdl_seq_GET(seq, i)); + seq = o->v.TryExcept.orelse; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case TryFinally_kind: + seq = o->v.TryFinally.body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + seq = o->v.TryFinally.finalbody; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + break; + case Assert_kind: + free_expr(o->v.Assert.test); + if (o->v.Assert.msg) + free_expr(o->v.Assert.msg); + break; + case Import_kind: + seq = o->v.Import.names; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_alias(asdl_seq_GET(seq, i)); + break; + case ImportFrom_kind: + Py_DECREF(o->v.ImportFrom.module); + seq = o->v.ImportFrom.names; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_alias(asdl_seq_GET(seq, i)); + break; + case Exec_kind: + free_expr(o->v.Exec.body); + if (o->v.Exec.globals) + free_expr(o->v.Exec.globals); + if (o->v.Exec.locals) + free_expr(o->v.Exec.locals); + break; + case Global_kind: + seq = o->v.Global.names; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + Py_DECREF((identifier)asdl_seq_GET(seq, i)); + break; + case Expr_kind: + free_expr(o->v.Expr.value); + break; + case Pass_kind: + break; + case Break_kind: + break; + case Continue_kind: + break; + } + } + + void + free_expr(expr_ty o) + { + int i, n; + asdl_seq *seq; + switch (o->kind) { + case BoolOp_kind: + free_boolop(o->v.BoolOp.op); + seq = o->v.BoolOp.values; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + break; + case BinOp_kind: + free_expr(o->v.BinOp.left); + free_operator(o->v.BinOp.op); + free_expr(o->v.BinOp.right); + break; + case UnaryOp_kind: + free_unaryop(o->v.UnaryOp.op); + free_expr(o->v.UnaryOp.operand); + break; + case Lambda_kind: + free_arguments(o->v.Lambda.args); + free_expr(o->v.Lambda.body); + break; + case Dict_kind: + seq = o->v.Dict.keys; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + seq = o->v.Dict.values; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + break; + case ListComp_kind: + free_expr(o->v.ListComp.elt); + seq = o->v.ListComp.generators; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_listcomp(asdl_seq_GET(seq, i)); + break; + case Compare_kind: + free_expr(o->v.Compare.left); + seq = o->v.Compare.ops; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_cmpop((cmpop_ty)asdl_seq_GET(seq, i)); + seq = o->v.Compare.comparators; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + break; + case Call_kind: + free_expr(o->v.Call.func); + seq = o->v.Call.args; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + seq = o->v.Call.keywords; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_keyword(asdl_seq_GET(seq, i)); + if (o->v.Call.starargs) + free_expr(o->v.Call.starargs); + if (o->v.Call.kwargs) + free_expr(o->v.Call.kwargs); + break; + case Repr_kind: + free_expr(o->v.Repr.value); + break; + case Num_kind: + Py_DECREF(o->v.Num.n); + break; + case Str_kind: + Py_DECREF(o->v.Str.s); + break; + case Attribute_kind: + free_expr(o->v.Attribute.value); + Py_DECREF(o->v.Attribute.attr); + free_expr_context(o->v.Attribute.ctx); + break; + case Subscript_kind: + free_expr(o->v.Subscript.value); + free_slice(o->v.Subscript.slice); + free_expr_context(o->v.Subscript.ctx); + break; + case Name_kind: + Py_DECREF(o->v.Name.id); + free_expr_context(o->v.Name.ctx); + break; + case List_kind: + seq = o->v.List.elts; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + free_expr_context(o->v.List.ctx); + break; + case Tuple_kind: + seq = o->v.Tuple.elts; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + free_expr_context(o->v.Tuple.ctx); + break; + } + } + + void + free_expr_context(expr_context_ty o) + { + } + + void + free_slice(slice_ty o) + { + int i, n; + asdl_seq *seq; + switch (o->kind) { + case Ellipsis_kind: + break; + case Slice_kind: + if (o->v.Slice.lower) + free_expr(o->v.Slice.lower); + if (o->v.Slice.upper) + free_expr(o->v.Slice.upper); + if (o->v.Slice.step) + free_expr(o->v.Slice.step); + break; + case ExtSlice_kind: + seq = o->v.ExtSlice.dims; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_slice(asdl_seq_GET(seq, i)); + break; + case Index_kind: + free_expr(o->v.Index.value); + break; + } + } + + void + free_boolop(boolop_ty o) + { + } + + void + free_operator(operator_ty o) + { + } + + void + free_unaryop(unaryop_ty o) + { + } + + void + free_cmpop(cmpop_ty o) + { + } + + void + free_listcomp(listcomp_ty o) + { + int i, n; + asdl_seq *seq; + free_expr(o->target); + free_expr(o->iter); + seq = o->ifs; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + } + + void + free_excepthandler(excepthandler_ty o) + { + int i, n; + asdl_seq *seq; + if (o->type) + free_expr(o->type); + if (o->name) + free_expr(o->name); + seq = o->body; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_stmt(asdl_seq_GET(seq, i)); + } + + void + free_arguments(arguments_ty o) + { + int i, n; + asdl_seq *seq; + seq = o->args; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + if (o->vararg) { + Py_DECREF(o->vararg); + } + if (o->kwarg) { + Py_DECREF(o->kwarg); + } + seq = o->defaults; + n = asdl_seq_LEN(seq); + for (i = 0; i < n; i++) + free_expr(asdl_seq_GET(seq, i)); + } + + void + free_keyword(keyword_ty o) + { + Py_DECREF(o->arg); + free_expr(o->value); + } + + void + free_alias(alias_ty o) + { + Py_DECREF(o->name); + if (o->asname) { + Py_DECREF(o->asname); + } + } + int marshal_write_mod(PyObject **buf, int *off, mod_ty o) From jhylton at users.sourceforge.net Tue Apr 13 11:01:15 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:15:21 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.47,1.1.2.48 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17177/Python Modified Files: Tag: ast-branch ast.c Log Message: Fix a couple of wild writes caught by asdl seq debug macros. Add braces in a couple of places because of debug macros. Remove a bunch of commented out prints. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.47 retrieving revision 1.1.2.48 diff -C2 -d -r1.1.2.47 -r1.1.2.48 *** ast.c 8 Apr 2004 18:08:32 -0000 1.1.2.47 --- ast.c 13 Apr 2004 15:01:12 -0000 1.1.2.48 *************** *** 506,516 **** switch (TYPE(ch)) { case fpdef: ! if (NCH(ch) == 3) asdl_seq_APPEND(args, compiler_complex_args(CHILD(ch, 1))); ! else if (TYPE(CHILD(ch, 0)) == NAME) /* XXX check return value of Name call */ asdl_seq_APPEND(args, Name(NEW_IDENTIFIER(CHILD(ch, 0)), Param)); /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is anything other than EQUAL or a comma? */ --- 506,518 ---- switch (TYPE(ch)) { case fpdef: ! if (NCH(ch) == 3) { asdl_seq_APPEND(args, compiler_complex_args(CHILD(ch, 1))); ! } ! else if (TYPE(CHILD(ch, 0)) == NAME) { /* XXX check return value of Name call */ asdl_seq_APPEND(args, Name(NEW_IDENTIFIER(CHILD(ch, 0)), Param)); + } /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is anything other than EQUAL or a comma? */ *************** *** 671,676 **** node *ch; - fprintf(stderr, "listcomp at %d\n", n->n_lineno); - REQ(n, listmaker); assert(NCH(n) > 1); --- 673,676 ---- *************** *** 775,779 **** node *ch = CHILD(n, 0); - /* fprintf(stderr, "ast_for_atom((%d, %d))\n", TYPE(ch), NCH(ch)); */ switch (TYPE(ch)) { case NAME: --- 775,778 ---- *************** *** 1002,1006 **** int i; - /* fprintf(stderr, "ast_for_expr(%d, %d)\n", TYPE(n), NCH(n)); */ loop: switch (TYPE(n)) { --- 1001,1004 ---- *************** *** 1164,1168 **** int j; slice_ty slc; ! asdl_seq *slices = asdl_seq_new(NCH(ch) / 2); if (!slices) { /* XXX free(e); */ --- 1162,1166 ---- int j; slice_ty slc; ! asdl_seq *slices = asdl_seq_new((NCH(ch) + 1) / 2); if (!slices) { /* XXX free(e); */ *************** *** 1240,1244 **** nkeywords++; } ! args = asdl_seq_new(nargs); if (!args) --- 1238,1242 ---- nkeywords++; } ! args = asdl_seq_new(nargs); if (!args) *************** *** 1328,1332 **** */ - /* fprintf(stderr, "ast_for_expr_stmt(%d, %d)\n", TYPE(n), NCH(n)); */ if (NCH(n) == 1) { expr_ty e = ast_for_testlist(c, CHILD(n, 0)); --- 1326,1329 ---- *************** *** 1425,1429 **** expr_ty e; - /* fprintf(stderr, "ast_for_exprlist(%d, %d)\n", TYPE(n), context); */ REQ(n, exprlist); --- 1422,1425 ---- *************** *** 1756,1763 **** asdl_seq *seq = NULL; stmt_ty s; ! int i, total, num, pos = 0; node *ch; - /* fprintf(stderr, "ast_for_suite(%d) lineno=%d\n", TYPE(n), n->n_lineno); */ REQ(n, suite); --- 1752,1758 ---- asdl_seq *seq = NULL; stmt_ty s; ! int i, total, num, end, pos = 0; node *ch; REQ(n, suite); *************** *** 1768,1773 **** if (TYPE(CHILD(n, 0)) == simple_stmt) { n = CHILD(n, 0); /* loop by 2 to skip semi-colons */ ! for (i = 0; i < NCH(n); i += 2) { ch = CHILD(n, i); s = ast_for_stmt(c, ch); --- 1763,1774 ---- if (TYPE(CHILD(n, 0)) == simple_stmt) { n = CHILD(n, 0); + /* simple_stmt always ends with a NEWLINE, + and may have a trailing SEMI + */ + end = NCH(n) - 1; + if (TYPE(CHILD(n, end - 1)) == SEMI) + end--; /* loop by 2 to skip semi-colons */ ! for (i = 0; i < end; i += 2) { ch = CHILD(n, i); s = ast_for_stmt(c, ch); *************** *** 2157,2162 **** ast_for_stmt(struct compiling *c, const node *n) { - /* fprintf(stderr, "ast_for_stmt(%d) lineno=%d\n", - TYPE(n), n->n_lineno); */ if (TYPE(n) == stmt) { assert(NCH(n) == 1); --- 2158,2161 ---- *************** *** 2228,2232 **** } - static PyObject * parsenumber(const char *s) --- 2227,2230 ---- From jhylton at users.sourceforge.net Tue Apr 13 11:03:37 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:17:32 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.24, 2.10.8.25 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17774/Python Modified Files: Tag: ast-branch symtable.c Log Message: Missing DECREFs. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.24 retrieving revision 2.10.8.25 diff -C2 -d -r2.10.8.24 -r2.10.8.25 *** symtable.c 8 Apr 2004 18:00:46 -0000 2.10.8.24 --- symtable.c 13 Apr 2004 15:03:34 -0000 2.10.8.25 *************** *** 604,607 **** --- 604,608 ---- st->st_cur = (PySTEntryObject *)PyList_GET_ITEM(st->st_stack, end); + Py_INCREF(st->st_cur); if (PySequence_DelItem(st->st_stack, end) < 0) return 0; *************** *** 622,625 **** --- 623,627 ---- return 0; } + Py_DECREF(st->st_cur); } st->st_cur = PySTEntry_New(st, name, block, ast, lineno); From jhylton at users.sourceforge.net Tue Apr 13 11:04:15 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:18:11 2004 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.161.2.11, 2.161.2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17876/Python Modified Files: Tag: ast-branch pythonrun.c Log Message: Call free_mod() to free AST memory. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.161.2.11 retrieving revision 2.161.2.12 diff -C2 -d -r2.161.2.11 -r2.161.2.12 *** pythonrun.c 21 Mar 2004 19:34:11 -0000 2.161.2.11 --- pythonrun.c 13 Apr 2004 15:04:01 -0000 2.161.2.12 *************** *** 636,639 **** --- 636,640 ---- d = PyModule_GetDict(m); v = run_mod(mod, filename, d, d, flags); + free_mod(mod); if (v == NULL) { PyErr_Print(); *************** *** 1068,1076 **** PyObject *locals, int closeit, PyCompilerFlags *flags) { mod_ty mod = PyParser_ASTFromFile(fp, filename, start, 0, 0, flags, NULL); if (closeit) fclose(fp); ! return run_err_mod(mod, filename, globals, locals, flags); } --- 1069,1082 ---- PyObject *locals, int closeit, PyCompilerFlags *flags) { + PyObject *ret; mod_ty mod = PyParser_ASTFromFile(fp, filename, start, 0, 0, flags, NULL); + if (mod == NULL) + return NULL; if (closeit) fclose(fp); ! ret = run_err_mod(mod, filename, globals, locals, flags); ! free_mod(mod); ! return ret; } *************** *** 1140,1143 **** --- 1146,1150 ---- return NULL; co = PyAST_Compile(mod, filename, flags); + free_mod(mod); return (PyObject *)co; } *************** *** 1153,1156 **** --- 1160,1164 ---- return NULL; st = PySymtable_Build(mod, filename, 0); + free_mod(mod); return st; } *************** *** 1162,1170 **** { node *n; perrdetail err; n = PyParser_ParseStringFlags(s, &_PyParser_Grammar, start, &err, PARSER_FLAGS(flags)); ! if (n) ! return PyAST_FromNode(n, flags); else { err_input(&err); --- 1170,1182 ---- { node *n; + mod_ty mod; perrdetail err; n = PyParser_ParseStringFlags(s, &_PyParser_Grammar, start, &err, PARSER_FLAGS(flags)); ! if (n) { ! mod = PyAST_FromNode(n, flags); ! PyNode_Free(n); ! return mod; ! } else { err_input(&err); *************** *** 1178,1186 **** { node *n; perrdetail err; n = PyParser_ParseFileFlags(fp, filename, &_PyParser_Grammar, start, ps1, ps2, &err, PARSER_FLAGS(flags)); ! if (n) ! return PyAST_FromNode(n, flags); else { err_input(&err); --- 1190,1202 ---- { node *n; + mod_ty mod; perrdetail err; n = PyParser_ParseFileFlags(fp, filename, &_PyParser_Grammar, start, ps1, ps2, &err, PARSER_FLAGS(flags)); ! if (n) { ! mod = PyAST_FromNode(n, flags); ! PyNode_Free(n); ! return mod; ! } else { err_input(&err); From jhylton at users.sourceforge.net Tue Apr 13 11:04:56 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 11:18:51 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.88, 1.1.2.89 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18029/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Add missing DECREFs. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.88 retrieving revision 1.1.2.89 diff -C2 -d -r1.1.2.88 -r1.1.2.89 *** newcompile.c 8 Apr 2004 18:00:46 -0000 1.1.2.88 --- newcompile.c 13 Apr 2004 15:04:51 -0000 1.1.2.89 *************** *** 504,507 **** --- 504,508 ---- if (u->u_blocks) PyObject_Free((void *)u->u_blocks); + Py_XDECREF(u->u_ste); Py_XDECREF(u->u_name); Py_XDECREF(u->u_consts); *************** *** 510,513 **** --- 511,515 ---- Py_XDECREF(u->u_freevars); Py_XDECREF(u->u_cellvars); + Py_XDECREF(u->u_private); PyObject_Free(u); } From jhylton at users.sourceforge.net Tue Apr 13 13:11:46 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 13 13:25:42 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.48,1.1.2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13878 Modified Files: Tag: ast-branch ast.c Log Message: The value expression for a list comp is just a general expression, not a potential assignment target. So don't call set_context() for it. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.48 retrieving revision 1.1.2.49 diff -C2 -d -r1.1.2.48 -r1.1.2.49 *** ast.c 13 Apr 2004 15:01:12 -0000 1.1.2.48 --- ast.c 13 Apr 2004 17:11:43 -0000 1.1.2.49 *************** *** 308,311 **** --- 308,312 ---- Maybe there's a problem with nested list comps? */ + abort(); fprintf(stderr, "can't set context for %d\n", e->kind); return 0; *************** *** 680,688 **** return NULL; - if (set_context(elt, Load) == -1) { - fprintf(stderr, "XXX 2\n"); - return NULL; - } - n_fors = count_list_fors(n); if (n_fors == -1) --- 681,684 ---- From Dale67481 at programmer.net Tue Apr 13 19:17:30 2004 From: Dale67481 at programmer.net (Abhi Featherston) Date: Tue Apr 13 23:56:25 2004 Subject: [Python-checkins] Suspended Account Message-ID: <200404132219.i3DMJYt6020605@mxzilla8.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040413/19fe44b1/attachment.html From tlthepvkzzgmar at msn.com Wed Apr 14 07:07:12 2004 From: tlthepvkzzgmar at msn.com (Shelton Crowe) Date: Wed Apr 14 03:02:21 2004 Subject: [Python-checkins] shlong long? Message-ID: Drop the HAMMER on the next chick you bang... http://occipital.singzzs.com/vp5 take off- http://sullivan.diffrs.com/a.html bayport boar egotism From perky at users.sourceforge.net Wed Apr 14 03:55:33 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Wed Apr 14 03:55:37 2004 Subject: [Python-checkins] python/dist/src configure, 1.442, 1.443 configure.in, 1.453, 1.454 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4370 Modified Files: configure configure.in Log Message: Bug #934635: Fix a bug where the configure script couldn't detect getaddrinfo() properly if the KAME stack had SCTP support. (Submitted by SUZUKI Shinsuke) Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.442 retrieving revision 1.443 diff -C2 -d -r1.442 -r1.443 *** configure 21 Mar 2004 23:45:39 -0000 1.442 --- configure 14 Apr 2004 07:55:28 -0000 1.443 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.452 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.453 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 14152,14155 **** --- 14152,14156 ---- hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { (void)gai_strerror(gaierr); Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.453 retrieving revision 1.454 diff -C2 -d -r1.453 -r1.454 *** configure.in 21 Mar 2004 23:45:41 -0000 1.453 --- configure.in 14 Apr 2004 07:55:30 -0000 1.454 *************** *** 2215,2218 **** --- 2215,2219 ---- hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { (void)gai_strerror(gaierr); From perky at users.sourceforge.net Wed Apr 14 03:55:33 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Wed Apr 14 03:55:40 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.965,1.966 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4370/Misc Modified Files: NEWS Log Message: Bug #934635: Fix a bug where the configure script couldn't detect getaddrinfo() properly if the KAME stack had SCTP support. (Submitted by SUZUKI Shinsuke) Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.965 retrieving revision 1.966 diff -C2 -d -r1.965 -r1.966 *** NEWS 7 Apr 2004 16:03:02 -0000 1.965 --- NEWS 14 Apr 2004 07:55:31 -0000 1.966 *************** *** 446,449 **** --- 446,452 ---- ----- + - Bug #934635: Fixed a bug where the configure script couldn't detect + getaddrinfo() properly if the KAME stack had SCTP support. + - Support for missing ANSI C header files (limits.h, stddef.h, etc) was removed. From perky at users.sourceforge.net Wed Apr 14 04:11:34 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Wed Apr 14 04:11:37 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.98,1.831.4.99 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7255/Misc Modified Files: Tag: release23-maint NEWS Log Message: Backport checkin> Bug #934635: Fixed a bug where the configure script couldn't detect getaddrinfo() properly if the KAME stack had SCTP support. (Submitted by SUZUKI Shinsuke) Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.98 retrieving revision 1.831.4.99 diff -C2 -d -r1.831.4.98 -r1.831.4.99 *** NEWS 4 Apr 2004 07:08:20 -0000 1.831.4.98 --- NEWS 14 Apr 2004 08:11:31 -0000 1.831.4.99 *************** *** 161,164 **** --- 161,170 ---- - Bug #823328: urllib2's HTTP Digest Auth support works again. + Build + ----- + + - Bug #934635: Fixed a bug where the configure script couldn't detect + getaddrinfo() properly if the KAME stack had SCTP support. + What's New in Python 2.3.2 (final)? =================================== From perky at users.sourceforge.net Wed Apr 14 04:11:35 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Wed Apr 14 04:11:41 2004 Subject: [Python-checkins] python/dist/src configure, 1.416.4.12, 1.416.4.13 configure.in, 1.427.4.11, 1.427.4.12 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7255 Modified Files: Tag: release23-maint configure configure.in Log Message: Backport checkin> Bug #934635: Fixed a bug where the configure script couldn't detect getaddrinfo() properly if the KAME stack had SCTP support. (Submitted by SUZUKI Shinsuke) Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.416.4.12 retrieving revision 1.416.4.13 diff -C2 -d -r1.416.4.12 -r1.416.4.13 *** configure 22 Mar 2004 20:20:27 -0000 1.416.4.12 --- configure 14 Apr 2004 08:11:28 -0000 1.416.4.13 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.427.4.10 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.3. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.427.4.11 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.3. *************** *** 15002,15005 **** --- 15002,15006 ---- hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { (void)gai_strerror(gaierr); Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.427.4.11 retrieving revision 1.427.4.12 diff -C2 -d -r1.427.4.11 -r1.427.4.12 *** configure.in 22 Mar 2004 20:20:32 -0000 1.427.4.11 --- configure.in 14 Apr 2004 08:11:31 -0000 1.427.4.12 *************** *** 2299,2302 **** --- 2299,2303 ---- hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { (void)gai_strerror(gaierr); From farp6to at air.linkclub.or.jp Tue Apr 13 12:17:03 2004 From: farp6to at air.linkclub.or.jp (Gil Pitts) Date: Thu Apr 15 00:11:31 2004 Subject: [Python-checkins] Research that specializes in the fastest growth sectors jrshigzy Message-ID: LETH******LETH******LETH******LETH******LETH Maximum Financial Stock Alert Life Energy and Technology Holdings (OTCBB: LETH) Recent Price: 1.90 52 Week Range: 0.78 - 2.95 Avg. Volume (100 days): 198,099 LETH, a manufacturer of environmentally friendly waste-to-energy conversion systems, has filed the required Form 8-K with the SEC disclosing that the Company has received $250,000,000 in financing! This funding package translates into $8.62 per share in cash for major worldwide expansion. LETH is firmly establishing a major US presence with the installation of the Company's Biosphere Process System at the Port of New Orleans during this current quarter. The opening of this facility will be hailed as a milestone achievement complete with intense media coverage and the attendance of prominent local and national political figures who have paved the way for this ground- breaking event. Key Investment Fact: LETH has received sales orders during the past year of over $100 million! Since Jan. 1, 2004 the overall market value of our picks has increased by $Millions$! Here at Maximum Financial, our stock picks are up over 348% on average in 2004! 7-Day Target: 3.40 30-Day Target: 5.70 1YR Target: 12.50 Examining LETH - By The Numbers: Total Assets: 36.8 Million = 1.26 per share of assets Cash: 23.4 Million = .80 cents per share of cash Shares Outstanding: 29 million (down from 31.8 million) after 2.8 million shares retired in Feb. '04 Additional Shares to be Retired: 1.3 million per Company press release Estimated Shares in Float: 7 million Completed Biosphere Process Systems Now in Operation: 26 Potential Size of Market (US/Foreign): Too Large To Calculate (Unlimited) Solving a Dual Crisis - Waste and Energy: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega- watts per hour of electricity which is then sold to replenish the local or national grid. Record Backlog of Sales for LETH: During the past year, over 20 Biosphere Process Systems have been ordered, which upon completion represents a backlog exceeding over $100 Million in upcoming sales. Many of these contractual agreements include options for the purchase of additional Biosphere Systems in the future once the initial order has been completed. The options vary from hundreds to thousands of units per contract which would send shockwaves through this low-float, emerging industry leader at an average sale price of $7 Million per Biosphere Process System! Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that LETH trading at around $2.00, now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. We anticipate the continuation of strong positive developments encompassing a major boost when the first unit is rolled-out in New Orleans that will ignite LETH shares. LETH carries our highest rating for short-term trading profits followed by robust long-term capital gains for aggressive portfolios looking for homerun performance. Maximum Financial Stock Alert (MFSA) cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of MFSA. MFSA recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. MFSA is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. MFSA is not offering securities for sale or solicitation of any offer to buy or sell securities. MFSA has received forty thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. e fd From fdrake at users.sourceforge.net Thu Apr 15 02:18:31 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 15 02:18:36 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex, 1.12.8.4, 1.12.8.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv727 Modified Files: Tag: release23-maint liblogging.tex Log Message: remove bogus markup that caused the docs to be wrong Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.12.8.4 retrieving revision 1.12.8.5 diff -C2 -d -r1.12.8.4 -r1.12.8.5 *** liblogging.tex 8 Apr 2004 19:45:36 -0000 1.12.8.4 --- liblogging.tex 15 Apr 2004 06:18:28 -0000 1.12.8.5 *************** *** 809,813 **** base \class{Formatter} allows a formatting string to be specified. If none is ! supplied, the default value of \code{'\%(message)s\e'} is used. A Formatter can be initialized with a format string which makes use of --- 809,813 ---- base \class{Formatter} allows a formatting string to be specified. If none is ! supplied, the default value of \code{'\%(message)s'} is used. A Formatter can be initialized with a format string which makes use of From fdrake at users.sourceforge.net Thu Apr 15 02:18:50 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Apr 15 02:18:53 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv773 Modified Files: liblogging.tex Log Message: remove bogus markup that caused the docs to be wrong Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** liblogging.tex 9 Apr 2004 18:26:40 -0000 1.17 --- liblogging.tex 15 Apr 2004 06:18:48 -0000 1.18 *************** *** 809,813 **** base \class{Formatter} allows a formatting string to be specified. If none is ! supplied, the default value of \code{'\%(message)s\e'} is used. A Formatter can be initialized with a format string which makes use of --- 809,813 ---- base \class{Formatter} allows a formatting string to be specified. If none is ! supplied, the default value of \code{'\%(message)s'} is used. A Formatter can be initialized with a format string which makes use of From tj2pfvd at auschwitz.de Wed Apr 14 01:42:53 2004 From: tj2pfvd at auschwitz.de (Dewey Metcalf) Date: Thu Apr 15 02:36:55 2004 Subject: [Python-checkins] Our top picks triple in the very first week heixhj piawvr Message-ID: ***ARET****ARET****ARET****ARET****ARET****ARET*** Undervalued Market Report For Largest Percentage Gain Leaders Opening Price: 2 cents Immediate Target: 10 cents in 10 days Near-Term Proj. High: 25 cents Current Market Value (Approx): 1.5 million **Our Picks Are On Fire!** Our last pick for huge percentage gains (GDLS) soared from 23 to .83 (261% on 3/29) immediately following our report. We believe the gains for ARET will run circles around all our other picks for the year. Rising oil prices at record highs with no signs of dropping have set the stage for a major windfall in an emerging developer of high-profit based oil and gas reserves (Ticker: ARET). Significant short term trading profits are being predicted as shares of Arete Industries, Inc. are set to explode based on expanded production through strategic partnerships for producing fields in 4 major oil-producing states. ARET just released major news and we believe there is much more to follow. There is strong evidence of big block buying indicating that an explosive move is coming on a huge near-term announcement. As recently reported, ARET is executing the launch of a $1 Billion financed "Master Energy Fund" which is capped at $100 Million increments to fund the Company's energy projects. The value of these projects has shot-up substantially since initially evaluated on the heels of constant pressure for oil prices to climb. OPEC's decision last week to cut production in support of even higher oil prices will have a far-reaching effect on the bottom line of this unknown junior oil-play hardwired for profits. ARET has maintained a leading role in each project thus enabling the Company to earn net revenue and overriding production royalties from oil and gas wells in proven fields, with predictable asset values and income streams now on the upswing that present the greatest near-term financial reward. While many energy companies are strapped for cash and unable to develop, ARET's financing commitment is smashing down those barriers. ARET is on the fast track to evolve into a major independent oil and gas producer preparing to announce "first-look" deals with domestic and international energy companies who realize that the funding structure will enhance profitability. Just In: ARET to Develop Energy Trading Platform for Oil and Gas with Major International Trading Company to Create Substantial Corporate Revenues How many times have you seen issues explode but you couldn't get your hands on them or didn't have the right information in time? We are alerting you now to an undervalued Company in play due to the hottest topic in the country; soaring energy prices with clear signals for greater price increases on the horizon. Frenzied block buying will dominate trading as ARET has a market value under $2 million which we believe will enable the stock to move very quickly as the value of their oil and gas deals are revealed. Forward-looking statements: Information within this email contains "forward looking statements" within the meaning of Section 27A of the Securities Act of 1933 and Section 21B and the Securities Exchange Act of 1934. Any statements that express or involve discussions with respect to predictions, goals, expectations, beliefs, plans, projections, objectives, assumptions or future events or performance are not statements of historical fact and may be "forward looking statements". Forward looking statements are based upon expectations, estimates and projections, at the time the statements are made that involve a number of risks and uncertainties which could cause actual results or events to differ materially from those presently anticipated. Forward looking statements in this action may be identified through the use of words such as: "projects", "foresee", "expects", "estimates", "believes", "understands", "will", "anticipates", or that by statements indicating certain actions "may", "could", or "might" occur. All information provided within this email pertaining to investing, stocks, securities must be understood as information provided and not investment advice. Emerging Equity Alert advises all readers and subscribers to seek advice from a registered professional securities representative before deciding to trade in stocks featured within this email. None of the material within this report shall be construed as any kind of investment advice. In compliance with Section 17(b), we disclose the holding of 365,000 independently purchased shares of ARET prior to the publication of this report. Be aware of an inherent conflict of interest resulting from such holdings due to our intent to profit from the liquidation of these shares. Shares may be sold at any time, even after positive statements have been made regarding the above company. Since we own shares, there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward- looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward-looking statements. ej vfavdisucywxqqu rzcqojha From theller at users.sourceforge.net Thu Apr 15 13:50:45 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 15 13:50:50 2004 Subject: [Python-checkins] python/dist/src/PC/bdist_wininst install.c, 1.1, 1.1.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC/bdist_wininst In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10767 Modified Files: Tag: release23-maint install.c Log Message: When loading the Python dll to run the postinstall script, try to load it from the install directory (as reported by the registry) in case it is not found on the default Loadlibrary search path. Fixes SF 935091: bdist_winist post-install script fails on non-admin Python Will port to the trunk later. Index: install.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/install.c,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -C2 -d -r1.1 -r1.1.14.1 *** install.c 22 Nov 2002 20:39:33 -0000 1.1 --- install.c 15 Apr 2004 17:50:42 -0000 1.1.14.1 *************** *** 1353,1364 **** result = sscanf(pbuf, "Python Version %d.%d", &py_major, &py_minor); ! if (result == 2) #ifdef _DEBUG ! wsprintf(pythondll, "c:\\python22\\PCBuild\\python%d%d_d.dll", ! py_major, py_minor); #else ! wsprintf(pythondll, "python%d%d.dll", ! py_major, py_minor); #endif free(pbuf); } else --- 1353,1365 ---- result = sscanf(pbuf, "Python Version %d.%d", &py_major, &py_minor); ! if (result == 2) { #ifdef _DEBUG ! wsprintf(pythondll, "python%d%d_d.dll", ! py_major, py_minor); #else ! wsprintf(pythondll, "python%d%d.dll", ! py_major, py_minor); #endif + } free(pbuf); } else *************** *** 1524,1527 **** --- 1525,1544 ---- } + static HINSTANCE LoadPythonDll(char *fname) + { + char fullpath[_MAX_PATH]; + LONG size = sizeof(fullpath); + HINSTANCE h = LoadLibrary(fname); + if (h) + return h; + if (ERROR_SUCCESS != RegQueryValue(HKEY_CURRENT_USER, + "SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath", + fullpath, &size)) + return NULL; + strcat(fullpath, "\\"); + strcat(fullpath, fname); + return LoadLibrary(fullpath); + } + BOOL CALLBACK InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) *************** *** 1617,1621 **** SetDlgItemText(hDialog, IDC_INFO, "Loading python..."); ! hPython = LoadLibrary(pythondll); if (hPython) { errors = compile_filelist(hPython, FALSE); --- 1634,1638 ---- SetDlgItemText(hDialog, IDC_INFO, "Loading python..."); ! hPython = LoadPythonDll(pythondll); if (hPython) { errors = compile_filelist(hPython, FALSE); *************** *** 1636,1640 **** SetDlgItemText(hDialog, IDC_INFO, "Loading python..."); ! hPython = LoadLibrary(pythondll); if (hPython) { errors = compile_filelist(hPython, TRUE); --- 1653,1657 ---- SetDlgItemText(hDialog, IDC_INFO, "Loading python..."); ! hPython = LoadPythonDll(pythondll); if (hPython) { errors = compile_filelist(hPython, TRUE); *************** *** 1712,1716 **** argv[0] = fname; ! hPython = LoadLibrary(pythondll); if (hPython) { int result; --- 1729,1733 ---- argv[0] = fname; ! hPython = LoadPythonDll(pythondll); if (hPython) { int result; From theller at users.sourceforge.net Thu Apr 15 13:52:01 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 15 13:52:07 2004 Subject: [Python-checkins] python/dist/src/Lib/distutils/command wininst.exe, 1.1, 1.1.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11047 Modified Files: Tag: release23-maint wininst.exe Log Message: Recompiled the binary wininst.exe after this change: When loading the Python dll to run the postinstall script, try to load it from the install directory (as reported by the registry) in case it is not found on the default Loadlibrary search path. Fixes SF 935091: bdist_winist post-install script fails on non-admin Python Will port to the trunk later. Index: wininst.exe =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/Attic/wininst.exe,v retrieving revision 1.1 retrieving revision 1.1.16.1 diff -C2 -d -r1.1 -r1.1.16.1 Binary files /tmp/cvsJ5sigd and /tmp/cvsFubzow differ From theller at users.sourceforge.net Thu Apr 15 14:19:12 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 15 14:19:25 2004 Subject: [Python-checkins] python/dist/src/PC/bdist_wininst install.c, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC/bdist_wininst In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16451 Modified Files: install.c Log Message: Minor reformatting. Index: install.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/install.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install.c 20 Feb 2004 14:43:21 -0000 1.2 --- install.c 15 Apr 2004 18:19:02 -0000 1.3 *************** *** 1470,1481 **** result = sscanf(pbuf, "Python Version %d.%d", &py_major, &py_minor); ! if (result == 2) #ifdef _DEBUG wsprintf(pythondll, "python%d%d_d.dll", ! py_major, py_minor); #else ! wsprintf(pythondll, "python%d%d.dll", ! py_major, py_minor); #endif free(pbuf); } else --- 1470,1482 ---- result = sscanf(pbuf, "Python Version %d.%d", &py_major, &py_minor); ! if (result == 2) { #ifdef _DEBUG wsprintf(pythondll, "python%d%d_d.dll", ! py_major, py_minor); #else ! wsprintf(pythondll, "python%d%d.dll", ! py_major, py_minor); #endif + } free(pbuf); } else From montanaro at users.sourceforge.net Thu Apr 15 23:12:14 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu Apr 15 23:12:19 2004 Subject: [Python-checkins] python/dist/src/Tools/faqwiz faqw.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/faqwiz In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21706 Modified Files: faqw.py Log Message: delete timing output - it appears after the line. Index: faqw.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/faqwiz/faqw.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** faqw.py 3 Apr 1998 22:27:04 -0000 1.5 --- faqw.py 16 Apr 2004 03:12:12 -0000 1.6 *************** *** 32,36 **** import cgi cgi.print_exception(t, v, tb) - t2 = os.times() # If this doesn't work, get rid of this and what follows! - fmt = "
(times: user %.3g, sys %.3g, ch-user %.3g, ch-sys %.3g, real %.3g)" - print fmt % tuple(map(operator.sub, t2, t1)) --- 32,33 ---- From montanaro at users.sourceforge.net Thu Apr 15 23:21:04 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu Apr 15 23:21:07 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22996 Modified Files: libcsv.tex Log Message: bring description of optional and keyword args for DictReader and DictWriter classes into line with the actual code. I didn't see any obvious examples of latex formatting for *args and **kwds so I just guessed. Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libcsv.tex 17 Mar 2004 01:24:17 -0000 1.13 --- libcsv.tex 16 Apr 2004 03:21:01 -0000 1.14 *************** *** 123,127 **** restval=\constant{None}\optional{, dialect=\code{'excel'}\optional{, ! fmtparam}}}}}} Create an object which operates like a regular reader but maps the information read into a dict whose keys are given by the optional --- 123,127 ---- restval=\constant{None}\optional{, dialect=\code{'excel'}\optional{, ! *args, **kwds}}}}}} Create an object which operates like a regular reader but maps the information read into a dict whose keys are given by the optional *************** *** 134,139 **** added as a sequence keyed by the value of \var{restkey}. If the row read has fewer fields than the fieldnames sequence, the remaining keys take the ! value of the optional \var{restval} parameter. All other parameters are ! interpreted as for \class{reader} objects. \end{classdesc} --- 134,139 ---- added as a sequence keyed by the value of \var{restkey}. If the row read has fewer fields than the fieldnames sequence, the remaining keys take the ! value of the optional \var{restval} parameter. Any other optional or ! keyword arguments are passed to the underlying \class{reader} instance. \end{classdesc} *************** *** 142,146 **** restval=""\optional{, extrasaction=\code{'raise'}\optional{, ! dialect=\code{'excel'}\optional{, fmtparam}}}}} Create an object which operates like a regular writer but maps dictionaries onto output rows. The \var{fieldnames} parameter identifies the order in --- 142,147 ---- restval=""\optional{, extrasaction=\code{'raise'}\optional{, ! dialect=\code{'excel'}\optional{, ! *args, **kwds}}}}} Create an object which operates like a regular writer but maps dictionaries onto output rows. The \var{fieldnames} parameter identifies the order in *************** *** 152,157 **** \var{extrasaction} parameter indicates what action to take. If it is set to \code{'raise'} a \exception{ValueError} is raised. If it is set to ! \code{'ignore'}, extra values in the dictionary are ignored. All other ! parameters are interpreted as for \class{writer} objects. Note that unlike the \class{DictReader} class, the \var{fieldnames} --- 153,159 ---- \var{extrasaction} parameter indicates what action to take. If it is set to \code{'raise'} a \exception{ValueError} is raised. If it is set to ! \code{'ignore'}, extra values in the dictionary are ignored. Any other ! optional or keyword arguments are passed to the underlying \class{writer} ! instance. Note that unlike the \class{DictReader} class, the \var{fieldnames} From montanaro at users.sourceforge.net Thu Apr 15 23:28:21 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu Apr 15 23:28:24 2004 Subject: [Python-checkins] python/dist/src/Lib trace.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24026 Modified Files: trace.py Log Message: Open file in universal newline mode when passing to compile(). Solution from Felix Wiemann. Closes patch #934971. Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/trace.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** trace.py 10 Apr 2004 16:29:58 -0000 1.20 --- trace.py 16 Apr 2004 03:28:19 -0000 1.21 *************** *** 419,423 **** assert filename.endswith('.py') try: ! prog = open(filename).read() except IOError, err: print >> sys.stderr, ("Not printing coverage data for %r: %s" --- 419,423 ---- assert filename.endswith('.py') try: ! prog = open(filename, "rU").read() except IOError, err: print >> sys.stderr, ("Not printing coverage data for %r: %s" From montanaro at users.sourceforge.net Thu Apr 15 23:30:35 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Thu Apr 15 23:31:20 2004 Subject: [Python-checkins] python/dist/src/Lib trace.py,1.12.6.2,1.12.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24312 Modified Files: Tag: release23-maint trace.py Log Message: backport of patch #934971. Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/trace.py,v retrieving revision 1.12.6.2 retrieving revision 1.12.6.3 diff -C2 -d -r1.12.6.2 -r1.12.6.3 *** trace.py 19 Feb 2004 19:17:08 -0000 1.12.6.2 --- trace.py 16 Apr 2004 03:30:33 -0000 1.12.6.3 *************** *** 384,388 **** assert filename.endswith('.py') try: ! prog = open(filename).read() except IOError, err: print >> sys.stderr, ("Not printing coverage data for %r: %s" --- 384,388 ---- assert filename.endswith('.py') try: ! prog = open(filename, "rU").read() except IOError, err: print >> sys.stderr, ("Not printing coverage data for %r: %s" From xmvvbsoyd at hotmail.com Thu Apr 15 09:43:24 2004 From: xmvvbsoyd at hotmail.com (Gregorio Adair) Date: Fri Apr 16 01:24:35 2004 Subject: [Python-checkins] thanks for everything Message-ID: <200404151249.i3FCn79A077469@mxzilla6.xs4all.nl> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040415/a289d29d/attachment.html From fdrake at users.sourceforge.net Fri Apr 16 11:20:05 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Apr 16 11:20:12 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libos.tex,1.133,1.134 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24722 Modified Files: libos.tex Log Message: really scream out that people should use the file objects instead of file descriptor operations for normal applications Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** libos.tex 31 Dec 2003 18:37:28 -0000 1.133 --- libos.tex 16 Apr 2004 15:20:01 -0000 1.134 *************** *** 400,408 **** Availability: Macintosh, \UNIX, Windows. ! Note: this function is intended for low-level I/O and must be applied to a file descriptor as returned by \function{open()} or \function{pipe()}. To close a ``file object'' returned by the built-in function \function{open()} or by \function{popen()} or \function{fdopen()}, use its \method{close()} method. \end{funcdesc} --- 400,410 ---- Availability: Macintosh, \UNIX, Windows. ! \begin{notice} ! This function is intended for low-level I/O and must be applied to a file descriptor as returned by \function{open()} or \function{pipe()}. To close a ``file object'' returned by the built-in function \function{open()} or by \function{popen()} or \function{fdopen()}, use its \method{close()} method. + \end{notice} \end{funcdesc} *************** *** 499,506 **** \constant{O_WRONLY}) are defined in this module too (see below). ! Note: this function is intended for low-level I/O. For normal usage, use the built-in function \function{open()}, which returns a ``file object'' with \method{read()} and \method{write()} methods (and many more). \end{funcdesc} --- 501,510 ---- \constant{O_WRONLY}) are defined in this module too (see below). ! \begin{notice} ! This function is intended for low-level I/O. For normal usage, use the built-in function \function{open()}, which returns a ``file object'' with \method{read()} and \method{write()} methods (and many more). + \end{notice} \end{funcdesc} *************** *** 526,530 **** Availability: Macintosh, \UNIX, Windows. ! Note: this function is intended for low-level I/O and must be applied to a file descriptor as returned by \function{open()} or \function{pipe()}. To read a ``file object'' returned by the --- 530,535 ---- Availability: Macintosh, \UNIX, Windows. ! \begin{notice} ! This function is intended for low-level I/O and must be applied to a file descriptor as returned by \function{open()} or \function{pipe()}. To read a ``file object'' returned by the *************** *** 532,535 **** --- 537,541 ---- \function{fdopen()}, or \code{sys.stdin}, use its \method{read()} or \method{readline()} methods. + \end{notice} \end{funcdesc} *************** *** 559,563 **** Availability: Macintosh, \UNIX, Windows. ! Note: this function is intended for low-level I/O and must be applied to a file descriptor as returned by \function{open()} or \function{pipe()}. To write a ``file object'' returned by the --- 565,570 ---- Availability: Macintosh, \UNIX, Windows. ! \begin{notice} ! This function is intended for low-level I/O and must be applied to a file descriptor as returned by \function{open()} or \function{pipe()}. To write a ``file object'' returned by the *************** *** 565,568 **** --- 572,576 ---- \function{fdopen()}, or \code{sys.stdout} or \code{sys.stderr}, use its \method{write()} method. + \end{notice} \end{funcdesc} *************** *** 875,882 **** After the rename, directories corresponding to rightmost path segments of the old name will be pruned away using \function{removedirs()}. ! Note: this function can fail with the new directory structure made if you lack permissions needed to remove the leaf directory or file. ! \versionadded{1.5.2} \end{funcdesc} --- 883,892 ---- After the rename, directories corresponding to rightmost path segments of the old name will be pruned away using \function{removedirs()}. + \versionadded{1.5.2} ! \begin{notice} ! This function can fail with the new directory structure made if you lack permissions needed to remove the leaf directory or file. ! \end{notice} \end{funcdesc} *************** *** 1229,1235 **** Availability: \UNIX, Windows. ! Note: the standard way to exit is \code{sys.exit(\var{n})}. \function{_exit()} should normally only be used in the child process after a \function{fork()}. \end{funcdesc} --- 1239,1247 ---- Availability: \UNIX, Windows. ! \begin{notice} ! The standard way to exit is \code{sys.exit(\var{n})}. \function{_exit()} should normally only be used in the child process after a \function{fork()}. + \end{notice} \end{funcdesc} From theller at users.sourceforge.net Fri Apr 16 14:47:53 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Apr 16 14:47:57 2004 Subject: [Python-checkins] python/dist/src/PC/bdist_wininst wininst-7.1.vcproj, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/PC/bdist_wininst In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6149 Modified Files: wininst-7.1.vcproj Log Message: The wininst-7.1.exe template binary for bdist_wininst is now linked with zlib-1.2.1. UPX needs the --force flag to be able to compress it. Index: wininst-7.1.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/wininst-7.1.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wininst-7.1.vcproj 20 Feb 2004 18:23:47 -0000 1.1 --- wininst-7.1.vcproj 16 Apr 2004 18:47:50 -0000 1.2 *************** *** 25,29 **** Optimization="1" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="..\..\Include,..\..\..\zlib-1.1.4" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" --- 25,29 ---- Optimization="1" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="..\..\Include,..\..\..\zlib-1.2.1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" *************** *** 42,46 **** --- 60,64 ---- *************** *** 91,95 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\Include,..\..\..\zlib-1.1.4" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" RuntimeLibrary="2" --- 91,95 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\..\Include,..\..\..\zlib-1.2.1" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" RuntimeLibrary="2" *************** *** 108,112 **** Update of /cvsroot/python/python/dist/src/PC/bdist_wininst In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6701 Modified Files: wininst.dsp Log Message: The wininst-6.exe template binary for bdist_wininst is now linked with zlib-1.2.1. Index: wininst.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/bdist_wininst/wininst.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wininst.dsp 20 Feb 2004 18:05:13 -0000 1.3 --- wininst.dsp 16 Apr 2004 18:49:35 -0000 1.4 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /O1 /I "..\..\Include" /I "..\..\..\zlib-1.1.4" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /O1 /I "..\..\Include" /I "..\..\..\zlib-1.2.1" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 54,58 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 ! # ADD LINK32 ..\..\..\zlib-1.1.4\zlib.lib imagehlp.lib comdlg32.lib ole32.lib comctl32.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\lib\distutils\command/wininst-6.exe" # Begin Special Build Tool TargetPath=\sf\python\dist\src\lib\distutils\command\wininst-6.exe --- 54,58 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 ! # ADD LINK32 ..\..\..\zlib-1.2.1\zlib.lib imagehlp.lib comdlg32.lib ole32.lib comctl32.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\lib\distutils\command/wininst-6.exe" # Begin Special Build Tool TargetPath=\sf\python\dist\src\lib\distutils\command\wininst-6.exe From theller at users.sourceforge.net Fri Apr 16 16:09:59 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Apr 16 16:10:03 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt, 1.43.8.1, 1.43.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25116 Modified Files: Tag: release23-maint readme.txt Log Message: Add tcl test results on Windows XP. Add instructions how to build tix - will probably be included in Python 2.3.4. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.43.8.1 retrieving revision 1.43.8.2 diff -C2 -d -r1.43.8.1 -r1.43.8.2 *** readme.txt 23 Sep 2003 07:14:39 -0000 1.43.8.1 --- readme.txt 16 Apr 2004 20:09:57 -0000 1.43.8.2 *************** *** 105,108 **** --- 105,111 ---- XXX That was on Win98SE. On Win2K: XXX all.tcl Total 10480 Passed 9781 Skipped 698 Failed 1 + XXX + XXX On WinXP: + XXX all.tcl: Total 10480 Passed 9768 Skipped 710 Failed 2 Build Tk *************** *** 128,131 **** --- 131,171 ---- files into the Python distribution. + tix + Tix, the Tk Interface eXtension, is a powerful set of user + interface components that expands the capabilities of your Tcl/Tk + and Python applications. + + Get source + ---------- + Go to + http://tix.sourceforge.net/ + and download tix-8.1.4.tar.gz from the files section. + Unpack into + dist\tix-8.1.4 + + Edit win\common.mak in this directory, to set the following variables: + TCL_VER=8.4 + INSTALLDIR=..\..\tix-8.1.4 + TCL_PATCH=3 + RMDIR=$(TKDIR)\win\rmd.bat + MKDIR=$(TKDIR)\win\mkd.bat + + Edit win\makefile.vc: + TOOLS32 = + TOOLS32_rc = + + Edit win\tk8.4\pkgindex.tcl, to replace + lappend dirs ../../Dlls + with + lappend dirs [file join [file dirname [info nameofexe]] DLLs] + + nmake -f makefile.vc + nmake -f makefile.vc install + + The tix8184.dll goes to DLLs, the tix8.1 subdirectory goes to + tcl. It differs from the standard tix8.1 subdirectory only in + fixing the path to the DLLs directory. + + To test whether this works, execute Demo/tix/tixwidgets.py. zlib *************** *** 309,313 **** HTML Help --------- - The compiled HTML help file is built from the HTML pages by the script Doc/tools/prechm.py. This creates project files which must be compiled --- 349,352 ---- From theller at users.sourceforge.net Fri Apr 16 16:14:00 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Apr 16 16:14:07 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.99,1.831.4.100 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26027 Modified Files: Tag: release23-maint NEWS Log Message: The Windows installer for Python 2.3.4 will include tix. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.99 retrieving revision 1.831.4.100 diff -C2 -d -r1.831.4.99 -r1.831.4.100 *** NEWS 14 Apr 2004 08:11:31 -0000 1.831.4.99 --- NEWS 16 Apr 2004 20:13:57 -0000 1.831.4.100 *************** *** 58,61 **** --- 58,69 ---- - Patch 711838: Support non-anonymous ftp URLs in urllib2. + Windows + ------- + + - The Windows installer now includes tix, the Tk Interface eXtension, + a powerful set of user interface components that expands the capabilities + of your Tcl/Tk and Python applications. + + What's New in Python 2.3.3 (final)? =================================== From theller at users.sourceforge.net Fri Apr 16 16:15:35 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Fri Apr 16 16:15:38 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt, 1.43.8.2, 1.43.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26431 Modified Files: Tag: release23-maint readme.txt Log Message: Whitespace cleanup. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.43.8.2 retrieving revision 1.43.8.3 diff -C2 -d -r1.43.8.2 -r1.43.8.3 *** readme.txt 16 Apr 2004 20:09:57 -0000 1.43.8.2 --- readme.txt 16 Apr 2004 20:15:33 -0000 1.43.8.3 *************** *** 146,162 **** Edit win\common.mak in this directory, to set the following variables: TCL_VER=8.4 ! INSTALLDIR=..\..\tix-8.1.4 ! TCL_PATCH=3 ! RMDIR=$(TKDIR)\win\rmd.bat ! MKDIR=$(TKDIR)\win\mkd.bat Edit win\makefile.vc: TOOLS32 = ! TOOLS32_rc = Edit win\tk8.4\pkgindex.tcl, to replace lappend dirs ../../Dlls with ! lappend dirs [file join [file dirname [info nameofexe]] DLLs] nmake -f makefile.vc --- 146,162 ---- Edit win\common.mak in this directory, to set the following variables: TCL_VER=8.4 ! INSTALLDIR=..\..\tix-8.1.4 ! TCL_PATCH=3 ! RMDIR=$(TKDIR)\win\rmd.bat ! MKDIR=$(TKDIR)\win\mkd.bat Edit win\makefile.vc: TOOLS32 = ! TOOLS32_rc = Edit win\tk8.4\pkgindex.tcl, to replace lappend dirs ../../Dlls with ! lappend dirs [file join [file dirname [info nameofexe]] DLLs] nmake -f makefile.vc From rhettinger at users.sourceforge.net Sat Apr 17 07:57:42 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Apr 17 07:57:46 2004 Subject: [Python-checkins] python/dist/src/Doc/api abstract.tex,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13532 Modified Files: abstract.tex Log Message: SF bug #936827: PyNumber_And() 's description Fix typo. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** abstract.tex 12 Mar 2004 08:03:39 -0000 1.31 --- abstract.tex 17 Apr 2004 11:57:40 -0000 1.32 *************** *** 518,522 **** \begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise and'' of \var{o2} and \var{o2} on success and \NULL{} on failure. This is the equivalent of the Python expression \samp{\var{o1} \&\ \var{o2}}. --- 518,522 ---- \begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise and'' of \var{o1} and \var{o2} on success and \NULL{} on failure. This is the equivalent of the Python expression \samp{\var{o1} \&\ \var{o2}}. From rhettinger at users.sourceforge.net Sat Apr 17 07:59:58 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Apr 17 08:00:01 2004 Subject: [Python-checkins] python/dist/src/Doc/api abstract.tex, 1.26.12.4, 1.26.12.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13841 Modified Files: Tag: release23-maint abstract.tex Log Message: SF bug #936827: PyNumber_And() 's description Fix typo. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.26.12.4 retrieving revision 1.26.12.5 diff -C2 -d -r1.26.12.4 -r1.26.12.5 *** abstract.tex 4 Jan 2004 03:12:46 -0000 1.26.12.4 --- abstract.tex 17 Apr 2004 11:59:55 -0000 1.26.12.5 *************** *** 518,522 **** \begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise and'' of \var{o2} and \var{o2} on success and \NULL{} on failure. This is the equivalent of the Python expression \samp{\var{o1} \&\ \var{o2}}. --- 518,522 ---- \begin{cfuncdesc}{PyObject*}{PyNumber_And}{PyObject *o1, PyObject *o2} ! Returns the ``bitwise and'' of \var{o1} and \var{o2} on success and \NULL{} on failure. This is the equivalent of the Python expression \samp{\var{o1} \&\ \var{o2}}. From loewis at users.sourceforge.net Sat Apr 17 15:36:15 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Apr 17 15:36:20 2004 Subject: [Python-checkins] python/dist/src/Modules unicodedata.c, 2.28.10.1, 2.28.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31435/Modules Modified Files: Tag: release23-maint unicodedata.c Log Message: Special case normalization of empty strings. Fixes #924361. Index: unicodedata.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v retrieving revision 2.28.10.1 retrieving revision 2.28.10.2 diff -C2 -d -r2.28.10.1 -r2.28.10.2 *** unicodedata.c 6 Nov 2003 20:47:43 -0000 2.28.10.1 --- unicodedata.c 17 Apr 2004 19:36:13 -0000 2.28.10.2 *************** *** 516,519 **** --- 516,526 ---- return NULL; + if (PyUnicode_GetSize(input) == 0) { + /* Special case empty input strings, since resizing + them later would cause internal errors. */ + Py_INCREF(input); + return input; + } + if (strcmp(form, "NFC") == 0) return nfc_nfkc(input, 0); From loewis at users.sourceforge.net Sat Apr 17 15:36:15 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Apr 17 15:36:23 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS, 1.831.4.100, 1.831.4.101 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31435/Misc Modified Files: Tag: release23-maint NEWS Log Message: Special case normalization of empty strings. Fixes #924361. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.100 retrieving revision 1.831.4.101 diff -C2 -d -r1.831.4.100 -r1.831.4.101 *** NEWS 16 Apr 2004 20:13:57 -0000 1.831.4.100 --- NEWS 17 Apr 2004 19:36:11 -0000 1.831.4.101 *************** *** 43,46 **** --- 43,48 ---- ------- + - Bug #924361: Properly support normalization of empty unicode strings. + - Fixed a caching bug in platform.platform() where the argument of 'terse' was not taken into consideration when caching value. From loewis at users.sourceforge.net Sat Apr 17 15:36:51 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Apr 17 15:36:54 2004 Subject: [Python-checkins] python/dist/src/Modules unicodedata.c,2.29,2.30 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31584/Modules Modified Files: unicodedata.c Log Message: Special case normalization of empty strings. Fixes #924361. Backported to 2.3. Index: unicodedata.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** unicodedata.c 6 Nov 2003 20:47:57 -0000 2.29 --- unicodedata.c 17 Apr 2004 19:36:48 -0000 2.30 *************** *** 516,519 **** --- 516,526 ---- return NULL; + if (PyUnicode_GetSize(input) == 0) { + /* Special case empty input strings, since resizing + them later would cause internal errors. */ + Py_INCREF(input); + return input; + } + if (strcmp(form, "NFC") == 0) return nfc_nfkc(input, 0); From loewis at users.sourceforge.net Sat Apr 17 15:36:51 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Apr 17 15:36:57 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_unicodedata.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31584/Lib/test Modified Files: test_unicodedata.py Log Message: Special case normalization of empty strings. Fixes #924361. Backported to 2.3. Index: test_unicodedata.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicodedata.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_unicodedata.py 1 May 2003 17:45:53 -0000 1.9 --- test_unicodedata.py 17 Apr 2004 19:36:48 -0000 1.10 *************** *** 171,174 **** --- 171,175 ---- self.assertRaises(TypeError, self.db.normalize) self.assertRaises(ValueError, self.db.normalize, 'unknown', u'xx') + self.assertEqual(self.db.normalize('NFKC', u''), u'') # The rest can be found in test_normalization.py # which requires an external file. From by860a at math.s.chiba-u.ac.jp Sat Apr 17 03:42:14 2004 From: by860a at math.s.chiba-u.ac.jp (Adolfo Putnam) Date: Sat Apr 17 16:37:13 2004 Subject: [Python-checkins] Stay ahead of the market with this portfolio strategy i ylugs uf Message-ID: <91ffjx-j83w7-ukkj8$$2g8mw6-2$7@pc4qfjxdpi6> LETH******LETH******LETH******LETH******LETH Maximum Financial Stock Alert Life Energy and Technology Holdings (OTCBB: LETH) Recent Price: 1.90 52 Week Range: 0.78 - 2.95 Avg. Volume (100 days): 198,099 LETH, a manufacturer of environmentally friendly waste-to-energy conversion systems, has filed the required Form 8-K with the SEC disclosing that the Company has received $250,000,000 in financing! This funding package translates into $8.62 per share in cash for major worldwide expansion. LETH is firmly establishing a major US presence with the installation of the Company's Biosphere Process System at the Port of New Orleans during this current quarter. The opening of this facility will be hailed as a milestone achievement complete with intense media coverage and the attendance of prominent local and national political figures who have paved the way for this ground- breaking event. Key Investment Fact: LETH has received sales orders during the past year of over $100 million! Since Jan. 1, 2004 the overall market value of our picks has increased by $Millions$! Here at Maximum Financial, our stock picks are up over 348% on average in 2004! 7-Day Target: 3.40 30-Day Target: 5.70 1YR Target: 12.50 Examining LETH - By The Numbers: Total Assets: 36.8 Million = 1.26 per share of assets Cash: 23.4 Million = .80 cents per share of cash Shares Outstanding: 29 million (down from 31.8 million) after 2.8 million shares retired in Feb. '04 Additional Shares to be Retired: 1.3 million per Company press release Estimated Shares in Float: 7 million Completed Biosphere Process Systems Now in Operation: 26 Potential Size of Market (US/Foreign): Too Large To Calculate (Unlimited) Solving a Dual Crisis - Waste and Energy: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega- watts per hour of electricity which is then sold to replenish the local or national grid. Record Backlog of Sales for LETH: During the past year, over 20 Biosphere Process Systems have been ordered, which upon completion represents a backlog exceeding over $100 Million in upcoming sales. Many of these contractual agreements include options for the purchase of additional Biosphere Systems in the future once the initial order has been completed. The options vary from hundreds to thousands of units per contract which would send shockwaves through this low-float, emerging industry leader at an average sale price of $7 Million per Biosphere Process System! Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that LETH trading at around $2.00, now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. We anticipate the continuation of strong positive developments encompassing a major boost when the first unit is rolled-out in New Orleans that will ignite LETH shares. LETH carries our highest rating for short-term trading profits followed by robust long-term capital gains for aggressive portfolios looking for homerun performance. Maximum Financial Stock Alert (MFSA) cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of MFSA. MFSA recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. MFSA is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. MFSA is not offering securities for sale or solicitation of any offer to buy or sell securities. MFSA has received forty thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. wzyxcf w j vtasnyvizppgkobram x From Moses at meetingamateonline.com Mon Apr 19 03:02:34 2004 From: Moses at meetingamateonline.com (Lynn Griffin) Date: Sun Apr 18 22:57:43 2004 Subject: [Python-checkins] tree trunk? Message-ID: Interested in a blind-date that has been pre-arranged by a mutual friend? Click here to accept the invitation: http://lovingchatter.com/confirm/?oc=50793636 Click here if you do not wish to be invited again: http://lovingchatter.com/remove/?oc=50793636 wcockleprofundity cranny milwaukee certificate shadbush hornmouth depot parentage deafen demean gibraltar degum prescribe warren highway hugh supercilious installation irresolvable buff cdc aristocracy pageant ruckus convent quilt mycenae vindicate vhobokenbelmont spectra registry amos callisto aforementioned beechwood documentation rotund boatswain respire ms archive peabody cartographer venereal bijective vain extensible muzo codebreak southwest ginmill ammunition approximant bugging breath admixture mailmen clog cartel collet hildebrand mustn't From rhettinger at users.sourceforge.net Mon Apr 19 00:08:02 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 19 00:08:07 2004 Subject: [Python-checkins] python/nondist/peps pep-0329.txt, NONE, 1.1 pep-0000.txt, 1.269, 1.270 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13373 Modified Files: pep-0000.txt Added Files: pep-0329.txt Log Message: Checkin pep for constant binding. --- NEW FILE: pep-0329.txt --- PEP: 329 Title: Treating Builtins as Constants in the Standard Library Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/04/19 04:07:59 $ Author: Raymond Hettinger Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 18-Apr-2004 Python-Version: 2.4 Post-History: 18-Apr-2004 Abstract ======== The proposal is to add a function for treating builtin references as constants and to apply that function throughout the standard library. Motivation ========== The library contains code such as ``_len=len`` which is intended to create fast local references instead of slower global lookups. Though necessary for performance, these constructs clutter the code and are usually incomplete (missing many opportunities). If the proposal is adopted, those constructs could be eliminated from the code base and at the same time improve upon their results in terms of performance. There are currently over a hundred instances of ``while 1`` in the library. They were not replaced with the more readable ``while True`` because of performance reasons (the compiler cannot eliminate the test because `True` is not known to always be a constant). Conversion of True to a constant will clarify the code while retaining performance. Many other basic Python operations run much slower because of global lookups. In try/except statements, the trapped exceptions are dynamically looked up before testing whether they match. Similarly, simple identity tests such as ``while x is not None`` require the `None` variable to be re-looked up on every pass. Builtin lookups are especially egregious because the enclosing global scope must be checked first. These lookup chains devour cache space that is best used elsewhere. In short, if the proposal is adopted, the code will become cleaner and performance will improve across the board. Proposal ======== Add a module called codetweaks.py which contains two functions, `bind_constants()` and `bind_all()`. The first function performs constant binding and the second recursively applies it to every function and class in a target module. For most modules in the standard library, add a pair of lines near the end of the script:: import codetweaks, sys codetweaks.bind_all(sys.modules[__name__]) In addition to binding builtins, there are some modules (like `sre_compile`) where it also makes sense to bind module variables as well as builtins into constants. Questions and Answers ===================== 1. Will this make everyone divert their attention to optimization issues? Because it is done automatically, it reduces the need to think about optimizations. 2. In a nutshell, how does it work? Every function has attributes with its bytecodes (the language of the Python virtual machine) and a table of constants. The bind function scans the bytecodes for a `LOAD_GLOBAL` instruction and checks to see whether the value is already known. If so, it adds that value to the constants table and replaces the opcode with `LOAD_CONSTANT`. 3. When does it work? When a module is imported for the first time, python compiles the bytecode and runs the binding optimization. Subsequent imports just re-use the previous work. Each session repeats this process (the results are not saved in `pyc` files). 4. How do you know this works? I implemented it, applied it to every module in library, and the test suite ran without exception. 5. What if the module defines a variable shadowing a builtin? This does happen. For instance, True can be redefined at the module level as `True = (1==1)`. The sample implementation below detects the shadowing and leaves the global lookup unchanged. 6. Are you the first person to recognize that most global lookups are for values that never change? No, this has long been known. Skip Montanaro provides an eloquent explanation in [1]_. 7. What if I want to replace the builtins module and supply my own implementations? Either do this before importing a module, or just reload the module, or disable `codetweaks.py` (it will have a disable flag). 8. How susceptible is this module to changes in Python's byte coding? It imports `opcode.py` to protect against renumbering. Also, it uses `LOAD_CONST` and `LOAD_GLOBAL` which are fundamental and have been around forever. That notwithstanding, the coding scheme could change and this implementation would have to change along with modules like `dis` which also rely on the current coding scheme. 9. What is the effect on startup time? I could not measure a difference. None of the startup modules are bound except for warnings.py. Also, the binding function is very fast, making just a single pass over the code string in search of the `LOAD_GLOBAL` opcode. Sample Implementation ===================== Here is a sample implementation for codetweaks.py:: from types import ClassType, FunctionType from opcode import opmap, HAVE_ARGUMENT, EXTENDED_ARG LOAD_GLOBAL, LOAD_CONST = opmap['LOAD_GLOBAL'], opmap['LOAD_CONST'] ABORT_CODES = (EXTENDED_ARG, opmap['STORE_GLOBAL']) def bind_constants(f, builtin_only=False, stoplist=[], verbose=False): """ Return a new function with optimized global references. Replaces global references with their currently defined values. If not defined, the dynamic (runtime) global lookup is left undisturbed. If builtin_only is True, then only builtins are optimized. Variable names in the stoplist are also left undisturbed. If verbose is True, prints each substitution as is occurs. """ import __builtin__ env = vars(__builtin__).copy() if builtin_only: stoplist.extend(f.func_globals) else: env.update(f.func_globals) co = f.func_code newcode = map(ord, co.co_code) newconsts = list(co.co_consts) codelen = len(newcode) i = 0 while i < codelen: opcode = newcode[i] if opcode in ABORT_CODES: return f # for simplicity, only optimize common cases if opcode == LOAD_GLOBAL: oparg = newcode[i+1] + (newcode[i+2] << 8) name = co.co_names[oparg] if name in env and name not in stoplist: value = env[name] try: pos = newconsts.index(value) except ValueError: pos = len(newconsts) newconsts.append(value) newcode[i] = LOAD_CONST newcode[i+1] = pos & 0xFF newcode[i+2] = pos >> 8 if verbose: print name, '-->', value i += 1 if opcode >= HAVE_ARGUMENT: i += 2 codestr = ''.join(map(chr, newcode)) codeobj = type(co)(co.co_argcount, co.co_nlocals, co.co_stacksize, co.co_flags, codestr, tuple(newconsts), co.co_names, co.co_varnames, co.co_filename, co.co_name, co.co_firstlineno, co.co_lnotab, co.co_freevars, co.co_cellvars) return type(f)(codeobj, f.func_globals, f.func_name, f.func_defaults, f.func_closure) def bind_all(mc, builtin_only=False, stoplist=[], verbose=False): """Recursively apply bind_constants() to functions in a module or class. Use as the last line of the module (after everything is defined, but before test code). In modules that need modifiable globals, set builtin_only to True. """ for k, v in vars(mc).items(): if type(v) is FunctionType: newv = bind_constants(v, builtin_only, stoplist, verbose) setattr(mc, k, newv) elif type(v) in (type, ClassType): bind_all(v, builtin_only, stoplist, verbose) import sys bind_all(sys.modules[__name__]) # Optimizer, optimize thyself! The final code should have some minor embellishments: * Automatic detection of a non-CPython environment that does not have bytecodes [3]_. In that situation, the bind functions would simply return the original function unchanged. This assures that the two line additions to library modules do not impact other implementations. * Add a flag to make it easy to disable binding. References ========== .. [1] Optimizing Global Variable/Attribute Access http://www.python.org/peps/pep-0266.html .. [2] ASPN Recipe for a non-private implementation http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 .. [3] Differences between CPython and Jython http://www.jython.org/cgi-bin/faqw.py?req=show&file=faq01.003.htp Copyright ========= This document has been placed in the public domain. .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.269 retrieving revision 1.270 diff -C2 -d -r1.269 -r1.270 *** pep-0000.txt 4 Apr 2004 02:39:23 -0000 1.269 --- pep-0000.txt 19 Apr 2004 04:07:59 -0000 1.270 *************** *** 124,127 **** --- 124,128 ---- S 325 Resource-Release Support for Generators Pedroni S 327 Decimal Data Type Batista + S 329 Treating Builtins as Constants in the Standard Library Hettinger S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 350,353 **** --- 351,355 ---- S 327 Decimal Data Type Batista SA 328 Imports: Multi-Line and Absolute/Relative Aahz + S 329 Treating Builtins as Constants in the Standard Library Hettinger SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes From vw764vq at ctcinternet.cl Mon Apr 19 03:51:00 2004 From: vw764vq at ctcinternet.cl (Reggie Rush) Date: Mon Apr 19 07:59:53 2004 Subject: [Python-checkins] subscribers get our featured profiles before they are publicly available pzhwfkop Message-ID: <3$45-$fg61i5@fvmp00er0> LETH******LETH******LETH******LETH******LETH Maximum Financial Stock Alert Life Energy and Technology Holdings (OTCBB: LETH) Recent Price: 1.90 52 Week Range: 0.78 - 2.95 Avg. Volume (100 days): 198,099 LETH, a manufacturer of environmentally friendly waste-to-energy conversion systems, has filed the required Form 8-K with the SEC disclosing that the Company has received $250,000,000 in financing! This funding package translates into $8.62 per share in cash for major worldwide expansion. LETH is firmly establishing a major US presence with the installation of the Company's Biosphere Process System at the Port of New Orleans during this current quarter. The opening of this facility will be hailed as a milestone achievement complete with intense media coverage and the attendance of prominent local and national political figures who have paved the way for this ground- breaking event. Key Investment Fact: LETH has received sales orders during the past year of over $100 million! Since Jan. 1, 2004 the overall market value of our picks has increased by $Millions$! Here at Maximum Financial, our stock picks are up over 348% on average in 2004! 7-Day Target: 3.40 30-Day Target: 5.70 1YR Target: 12.50 Examining LETH - By The Numbers: Total Assets: 36.8 Million = 1.26 per share of assets Cash: 23.4 Million = .80 cents per share of cash Shares Outstanding: 29 million (down from 31.8 million) after 2.8 million shares retired in Feb. '04 Additional Shares to be Retired: 1.3 million per Company press release Estimated Shares in Float: 7 million Completed Biosphere Process Systems Now in Operation: 26 Potential Size of Market (US/Foreign): Too Large To Calculate (Unlimited) Solving a Dual Crisis - Waste and Energy: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega- watts per hour of electricity which is then sold to replenish the local or national grid. Record Backlog of Sales for LETH: During the past year, over 20 Biosphere Process Systems have been ordered, which upon completion represents a backlog exceeding over $100 Million in upcoming sales. Many of these contractual agreements include options for the purchase of additional Biosphere Systems in the future once the initial order has been completed. The options vary from hundreds to thousands of units per contract which would send shockwaves through this low-float, emerging industry leader at an average sale price of $7 Million per Biosphere Process System! Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that LETH trading at around $2.00, now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. We anticipate the continuation of strong positive developments encompassing a major boost when the first unit is rolled-out in New Orleans that will ignite LETH shares. LETH carries our highest rating for short-term trading profits followed by robust long-term capital gains for aggressive portfolios looking for homerun performance. Maximum Financial Stock Alert (MFSA) cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of MFSA. MFSA recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. MFSA is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. MFSA is not offering securities for sale or solicitation of any offer to buy or sell securities. MFSA has received forty thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. usmvwka xgtliirfit z z la l opcipvazv d erxdaiv inx p xyhhp yoi z gj blp From rhettinger at users.sourceforge.net Mon Apr 19 15:06:22 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 19 15:06:27 2004 Subject: [Python-checkins] python/dist/src setup.py,1.185,1.186 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17665 Modified Files: setup.py Log Message: * Restore the pure python version of heapq.py. * Mark the C version as private and only use when available. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** setup.py 21 Mar 2004 18:59:46 -0000 1.185 --- setup.py 19 Apr 2004 19:06:19 -0000 1.186 *************** *** 328,332 **** exts.append( Extension("_bisect", ["_bisectmodule.c"]) ) # heapq ! exts.append( Extension("heapq", ["heapqmodule.c"]) ) # operator.add() and similar goodies exts.append( Extension('operator', ['operator.c']) ) --- 328,332 ---- exts.append( Extension("_bisect", ["_bisectmodule.c"]) ) # heapq ! exts.append( Extension("_heapq", ["_heapqmodule.c"]) ) # operator.add() and similar goodies exts.append( Extension('operator', ['operator.c']) ) From rhettinger at users.sourceforge.net Mon Apr 19 15:06:23 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 19 15:06:31 2004 Subject: [Python-checkins] python/dist/src/PC config.c,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17665/pc Modified Files: config.c Log Message: * Restore the pure python version of heapq.py. * Mark the C version as private and only use when available. Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** config.c 29 Jan 2004 06:37:52 -0000 1.44 --- config.c 19 Apr 2004 19:06:20 -0000 1.45 *************** *** 48,52 **** extern void inititertools(void); extern void initcollections(void); ! extern void initheapq(void); extern void init_bisect(void); extern void init_symtable(void); --- 48,52 ---- extern void inititertools(void); extern void initcollections(void); ! extern void init_heapq(void); extern void init_bisect(void); extern void init_symtable(void); *************** *** 136,140 **** {"_random", init_random}, {"_bisect", init_bisect}, ! {"heapq", initheapq}, {"itertools", inititertools}, {"collections", initcollections}, --- 136,140 ---- {"_random", init_random}, {"_bisect", init_bisect}, ! {"_heapq", init_heapq}, {"itertools", inititertools}, {"collections", initcollections}, From rhettinger at users.sourceforge.net Mon Apr 19 15:06:23 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 19 15:06:33 2004 Subject: [Python-checkins] python/dist/src/Modules _heapmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17665/modules Added Files: _heapmodule.c Log Message: * Restore the pure python version of heapq.py. * Mark the C version as private and only use when available. --- NEW FILE: _heapmodule.c --- (This appears to be a binary file; contents omitted.) From rhettinger at users.sourceforge.net Mon Apr 19 15:06:25 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 19 15:06:38 2004 Subject: [Python-checkins] python/dist/src/Lib heapq.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17665/lib Added Files: heapq.py Log Message: * Restore the pure python version of heapq.py. * Mark the C version as private and only use when available. From rhettinger at users.sourceforge.net Mon Apr 19 15:21:46 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Apr 19 15:21:52 2004 Subject: [Python-checkins] python/dist/src/Modules heapqmodule.c,1.4,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20399 Removed Files: heapqmodule.c Log Message: * Restore the pure python version of heapq.py. * Mark the C version as private and only use when available. --- heapqmodule.c DELETED --- From rhettinger at users.sourceforge.net Tue Apr 20 07:01:38 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Apr 20 07:01:41 2004 Subject: [Python-checkins] python/nondist/peps pep-0329.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30621 Modified Files: pep-0329.txt Log Message: * Protect the stoplist from mutation (suggested by JvR). * Replace the comment on non-CPython implementations with working code. Should help those who could not comprehend the efforts that were made to support non-CPython environments automatically, with no performance penalty. Index: pep-0329.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0329.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0329.txt 19 Apr 2004 04:07:59 -0000 1.1 --- pep-0329.txt 20 Apr 2004 11:01:35 -0000 1.2 *************** *** 155,160 **** import __builtin__ env = vars(__builtin__).copy() if builtin_only: ! stoplist.extend(f.func_globals) else: env.update(f.func_globals) --- 155,161 ---- import __builtin__ env = vars(__builtin__).copy() + stoplist = dict.fromkeys(stoplist) if builtin_only: ! stoplist.update(f.func_globals) else: env.update(f.func_globals) *************** *** 215,231 **** bind_all(v, builtin_only, stoplist, verbose) import sys bind_all(sys.modules[__name__]) # Optimizer, optimize thyself! - ! The final code should have some minor embellishments: ! * Automatic detection of a non-CPython environment that does not have ! bytecodes [3]_. In that situation, the bind functions would simply ! return the original function unchanged. This assures that the two ! line additions to library modules do not impact other implementations. - * Add a flag to make it easy to disable binding. --- 216,238 ---- bind_all(v, builtin_only, stoplist, verbose) + + def f(): pass + try: + f.func_code.code + except AttributeError: # detect non-CPython environments + bind_all = lambda *args, **kwds: 0 + del f + import sys bind_all(sys.modules[__name__]) # Optimizer, optimize thyself! ! Note the automatic detection of a non-CPython environment that does not ! have bytecodes [3]_. In that situation, the bind functions would simply ! return the original function unchanged. This assures that the two ! line additions to library modules do not impact other implementations. ! The final code should add a flag to make it easy to disable binding. From rhettinger at users.sourceforge.net Tue Apr 20 08:07:36 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Apr 20 08:07:40 2004 Subject: [Python-checkins] python/nondist/peps pep-0329.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10445 Modified Files: pep-0329.txt Log Message: Adopt Jack Diederich's suggested module name. Index: pep-0329.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0329.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0329.txt 20 Apr 2004 11:01:35 -0000 1.2 --- pep-0329.txt 20 Apr 2004 12:07:33 -0000 1.3 *************** *** 53,57 **** ======== ! Add a module called codetweaks.py which contains two functions, `bind_constants()` and `bind_all()`. The first function performs constant binding and the second recursively applies it to every --- 53,57 ---- ======== ! Add a module called pragma.py which contains two functions, `bind_constants()` and `bind_all()`. The first function performs constant binding and the second recursively applies it to every *************** *** 61,66 **** the end of the script:: ! import codetweaks, sys ! codetweaks.bind_all(sys.modules[__name__]) In addition to binding builtins, there are some modules (like --- 61,66 ---- the end of the script:: ! import pragma, sys ! pragma.bind_all(sys.modules[__name__]) In addition to binding builtins, there are some modules (like *************** *** 115,119 **** Either do this before importing a module, or just reload the ! module, or disable `codetweaks.py` (it will have a disable flag). 8. How susceptible is this module to changes in Python's byte coding? --- 115,119 ---- Either do this before importing a module, or just reload the ! module, or disable `pragma.py` (it will have a disable flag). 8. How susceptible is this module to changes in Python's byte coding? *************** *** 136,140 **** ===================== ! Here is a sample implementation for codetweaks.py:: from types import ClassType, FunctionType --- 136,140 ---- ===================== ! Here is a sample implementation for pragma.py:: from types import ClassType, FunctionType From p2mjrjlak at arcs.ac.at Mon Apr 19 03:17:39 2004 From: p2mjrjlak at arcs.ac.at (Shelia Moreno) Date: Tue Apr 20 12:12:01 2004 Subject: [Python-checkins] Hot pick sets the stage for major windfall apmg f Message-ID: <260-6$$30-b-jj@wg0.0g3> LETH******LETH******LETH******LETH******LETH Maximum Financial Stock Alert Life Energy and Technology Holdings (OTCBB: LETH) Recent Price: 1.90 52 Week Range: 0.78 - 2.95 Avg. Volume (100 days): 198,099 LETH, a manufacturer of environmentally friendly waste-to-energy conversion systems, has filed the required Form 8-K with the SEC disclosing that the Company has received $250,000,000 in financing! This funding package translates into $8.62 per share in cash for major worldwide expansion. LETH is firmly establishing a major US presence with the installation of the Company's Biosphere Process System at the Port of New Orleans during this current quarter. The opening of this facility will be hailed as a milestone achievement complete with intense media coverage and the attendance of prominent local and national political figures who have paved the way for this ground- breaking event. Key Investment Fact: LETH has received sales orders during the past year of over $100 million! Since Jan. 1, 2004 the overall market value of our picks has increased by $Millions$! Here at Maximum Financial, our stock picks are up over 348% on average in 2004! 7-Day Target: 3.40 30-Day Target: 5.70 1YR Target: 12.50 Examining LETH - By The Numbers: Total Assets: 36.8 Million = 1.26 per share of assets Cash: 23.4 Million = .80 cents per share of cash Shares Outstanding: 29 million (down from 31.8 million) after 2.8 million shares retired in Feb. '04 Additional Shares to be Retired: 1.3 million per Company press release Estimated Shares in Float: 7 million Completed Biosphere Process Systems Now in Operation: 26 Potential Size of Market (US/Foreign): Too Large To Calculate (Unlimited) Solving a Dual Crisis - Waste and Energy: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega- watts per hour of electricity which is then sold to replenish the local or national grid. Record Backlog of Sales for LETH: During the past year, over 20 Biosphere Process Systems have been ordered, which upon completion represents a backlog exceeding over $100 Million in upcoming sales. Many of these contractual agreements include options for the purchase of additional Biosphere Systems in the future once the initial order has been completed. The options vary from hundreds to thousands of units per contract which would send shockwaves through this low-float, emerging industry leader at an average sale price of $7 Million per Biosphere Process System! Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that LETH trading at around $2.00, now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. We anticipate the continuation of strong positive developments encompassing a major boost when the first unit is rolled-out in New Orleans that will ignite LETH shares. LETH carries our highest rating for short-term trading profits followed by robust long-term capital gains for aggressive portfolios looking for homerun performance. Maximum Financial Stock Alert (MFSA) cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of MFSA. MFSA recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. MFSA is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. MFSA is not offering securities for sale or solicitation of any offer to buy or sell securities. MFSA has received forty thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. zphguejndilugufa From rhettinger at users.sourceforge.net Tue Apr 20 13:51:46 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Apr 20 13:51:50 2004 Subject: [Python-checkins] python/nondist/peps pep-0000.txt, 1.270, 1.271 pep-0329.txt, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16729 Modified Files: pep-0000.txt pep-0329.txt Log Message: Self reject PEP 329. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.270 retrieving revision 1.271 diff -C2 -d -r1.270 -r1.271 *** pep-0000.txt 19 Apr 2004 04:07:59 -0000 1.270 --- pep-0000.txt 20 Apr 2004 17:50:52 -0000 1.271 *************** *** 124,128 **** S 325 Resource-Release Support for Generators Pedroni S 327 Decimal Data Type Batista - S 329 Treating Builtins as Constants in the Standard Library Hettinger S 754 IEEE 754 Floating Point Special Values Warnes --- 124,127 ---- *************** *** 196,199 **** --- 195,199 ---- SR 317 Eliminate Implicit Exception Instantiation Taschuk SR 326 A Case for Top and Bottom Values Carlson, Reedy + SR 329 Treating Builtins as Constants in the Standard Library Hettinger SR 666 Reject Foolish Indentation Creighton *************** *** 351,355 **** S 327 Decimal Data Type Batista SA 328 Imports: Multi-Line and Absolute/Relative Aahz ! S 329 Treating Builtins as Constants in the Standard Library Hettinger SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes --- 351,355 ---- S 327 Decimal Data Type Batista SA 328 Imports: Multi-Line and Absolute/Relative Aahz ! SR 329 Treating Builtins as Constants in the Standard Library Hettinger SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes Index: pep-0329.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0329.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0329.txt 20 Apr 2004 12:07:33 -0000 1.3 --- pep-0329.txt 20 Apr 2004 17:51:11 -0000 1.4 *************** *** 4,8 **** Last-Modified: $Date$ Author: Raymond Hettinger ! Status: Draft Type: Standards Track Content-Type: text/x-rst --- 4,8 ---- Last-Modified: $Date$ Author: Raymond Hettinger ! Status: Rejected Type: Standards Track Content-Type: text/x-rst *************** *** 12,15 **** --- 12,22 ---- + Status + ====== + + The PEP is self rejected by the author due to the unprecedented + level of enmity it generated from developers. + + Abstract ======== *************** *** 53,57 **** ======== ! Add a module called pragma.py which contains two functions, `bind_constants()` and `bind_all()`. The first function performs constant binding and the second recursively applies it to every --- 60,64 ---- ======== ! Add a module called codetweaks.py which contains two functions, `bind_constants()` and `bind_all()`. The first function performs constant binding and the second recursively applies it to every *************** *** 61,66 **** the end of the script:: ! import pragma, sys ! pragma.bind_all(sys.modules[__name__]) In addition to binding builtins, there are some modules (like --- 68,73 ---- the end of the script:: ! import codetweaks, sys ! codetweaks.bind_all(sys.modules[__name__]) In addition to binding builtins, there are some modules (like *************** *** 115,119 **** Either do this before importing a module, or just reload the ! module, or disable `pragma.py` (it will have a disable flag). 8. How susceptible is this module to changes in Python's byte coding? --- 122,126 ---- Either do this before importing a module, or just reload the ! module, or disable `codetweaks.py` (it will have a disable flag). 8. How susceptible is this module to changes in Python's byte coding? *************** *** 136,140 **** ===================== ! Here is a sample implementation for pragma.py:: from types import ClassType, FunctionType --- 143,147 ---- ===================== ! Here is a sample implementation for codetweaks.py:: from types import ClassType, FunctionType From perky at users.sourceforge.net Tue Apr 20 17:11:32 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 20 17:11:37 2004 Subject: [Python-checkins] python/dist/src/Lib sre.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24492/Lib Modified Files: sre.py Log Message: SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. Index: sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** sre.py 2 Jul 2003 21:37:16 -0000 1.47 --- sre.py 20 Apr 2004 21:11:11 -0000 1.48 *************** *** 216,220 **** def _compile(*key): # internal: compile pattern ! p = _cache.get(key) if p is not None: return p --- 216,221 ---- def _compile(*key): # internal: compile pattern ! cachekey = (type(key[0]),) + key ! p = _cache.get(cachekey) if p is not None: return p *************** *** 230,234 **** if len(_cache) >= _MAXCACHE: _cache.clear() ! _cache[key] = p return p --- 231,235 ---- if len(_cache) >= _MAXCACHE: _cache.clear() ! _cache[cachekey] = p return p From perky at users.sourceforge.net Tue Apr 20 17:11:43 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 20 17:11:47 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.966,1.967 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24492/Misc Modified Files: NEWS Log Message: SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.966 retrieving revision 1.967 diff -C2 -d -r1.966 -r1.967 *** NEWS 14 Apr 2004 07:55:31 -0000 1.966 --- NEWS 20 Apr 2004 21:10:26 -0000 1.967 *************** *** 304,307 **** --- 304,311 ---- ------- + - Bug #926075: Fixed a bug that returns a wrong pattern object + for a string or unicode object in sre.compile() when a different + type pattern with the same value exists. + - Added countcallers arg to trace.Trace class (--trackcalls command line arg when run from the command prompt). From perky at users.sourceforge.net Tue Apr 20 17:16:27 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 20 17:16:30 2004 Subject: [Python-checkins] python/dist/src/Lib sre.py,1.47,1.47.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26270/Lib Modified Files: Tag: release23-maint sre.py Log Message: SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. Index: sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre.py,v retrieving revision 1.47 retrieving revision 1.47.6.1 diff -C2 -d -r1.47 -r1.47.6.1 *** sre.py 2 Jul 2003 21:37:16 -0000 1.47 --- sre.py 20 Apr 2004 21:16:06 -0000 1.47.6.1 *************** *** 216,220 **** def _compile(*key): # internal: compile pattern ! p = _cache.get(key) if p is not None: return p --- 216,221 ---- def _compile(*key): # internal: compile pattern ! cachekey = (type(key[0]),) + key ! p = _cache.get(cachekey) if p is not None: return p *************** *** 230,234 **** if len(_cache) >= _MAXCACHE: _cache.clear() ! _cache[key] = p return p --- 231,235 ---- if len(_cache) >= _MAXCACHE: _cache.clear() ! _cache[cachekey] = p return p From perky at users.sourceforge.net Tue Apr 20 17:16:38 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 20 17:16:44 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS, 1.831.4.101, 1.831.4.102 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26270/Misc Modified Files: Tag: release23-maint NEWS Log Message: SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.101 retrieving revision 1.831.4.102 diff -C2 -d -r1.831.4.101 -r1.831.4.102 *** NEWS 17 Apr 2004 19:36:11 -0000 1.831.4.101 --- NEWS 20 Apr 2004 21:15:54 -0000 1.831.4.102 *************** *** 43,46 **** --- 43,50 ---- ------- + - Bug #926075: Fixed a bug that returns a wrong pattern object + for a string or unicode object in sre.compile() when a different + type pattern with the same value exists. + - Bug #924361: Properly support normalization of empty unicode strings. From perky at users.sourceforge.net Tue Apr 20 17:30:27 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 20 17:30:30 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_re.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29180/Lib/test Modified Files: test_re.py Log Message: SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. Index: test_re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_re.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** test_re.py 18 Jan 2004 20:29:55 -0000 1.47 --- test_re.py 20 Apr 2004 21:30:07 -0000 1.48 *************** *** 490,493 **** --- 490,501 ---- [":", "::", ":::"]) + def test_bug_926075(self): + try: + unicode + except NameError: + return # no problem if we have no unicode + self.assert_(re.compile('bug_926075') is not + re.compile(eval("u'bug_926075'"))) + def run_re_tests(): from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR From perky at users.sourceforge.net Tue Apr 20 17:32:38 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Apr 20 17:32:41 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_re.py, 1.45.6.2, 1.45.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30092/Lib/test Modified Files: Tag: release23-maint test_re.py Log Message: SF #926075: Fixed the bug that returns a wrong pattern object for a string or unicode object in sre.compile() when a different type pattern with the same value exists. Index: test_re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_re.py,v retrieving revision 1.45.6.2 retrieving revision 1.45.6.3 diff -C2 -d -r1.45.6.2 -r1.45.6.3 *** test_re.py 22 Nov 2003 03:25:40 -0000 1.45.6.2 --- test_re.py 20 Apr 2004 21:32:33 -0000 1.45.6.3 *************** *** 490,493 **** --- 490,501 ---- [":", "::", ":::"]) + def test_bug_926075(self): + try: + unicode + except NameError: + return # no problem if we have no unicode + self.assert_(re.compile('bug_926075') is not + re.compile(eval("u'bug_926075'"))) + def run_re_tests(): from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR From evctnvlk at msn.com Mon Apr 19 08:14:38 2004 From: evctnvlk at msn.com (Ruth Rios) Date: Tue Apr 20 20:52:47 2004 Subject: [Python-checkins] Online Privacy Risk? Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040419/aa06c296/attachment-0001.html From jhylton at users.sourceforge.net Tue Apr 20 22:16:06 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Tue Apr 20 22:16:10 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.89, 1.1.2.90 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18328 Modified Files: Tag: ast-branch newcompile.c Log Message: Generate code for module docstrings. Extract the common code for modules and classes into compiler_body(). Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.89 retrieving revision 1.1.2.90 diff -C2 -d -r1.1.2.89 -r1.1.2.90 *** newcompile.c 13 Apr 2004 15:04:51 -0000 1.1.2.89 --- newcompile.c 21 Apr 2004 02:16:01 -0000 1.1.2.90 *************** *** 1071,1074 **** --- 1071,1103 ---- } + static int + compiler_isdocstring(stmt_ty s) + { + if (s->kind != Expr_kind) + return 0; + return s->v.Expr.value->kind == Str_kind; + } + + /* Compile a sequence of statements, checking for a docstring. */ + + static int + compiler_body(struct compiler *c, asdl_seq *stmts) + { + int i = 0; + stmt_ty st; + + st = asdl_seq_GET(stmts, 0); + printf("is_docstring? %d\n", compiler_isdocstring(st)); + if (compiler_isdocstring(st)) { + i = 1; + VISIT(c, expr, st->v.Expr.value); + if (!compiler_nameop(c, __doc__, Store)) + return 0; + } + for (; i < asdl_seq_LEN(stmts); i++) + VISIT(c, stmt, asdl_seq_GET(stmts, i)); + return 1; + } + static PyCodeObject * compiler_mod(struct compiler *c, mod_ty mod) *************** *** 1085,1090 **** return NULL; switch (mod->kind) { ! case Module_kind: ! VISIT_SEQ(c, stmt, mod->v.Module.body); break; case Interactive_kind: --- 1114,1120 ---- return NULL; switch (mod->kind) { ! case Module_kind: ! if (!compiler_body(c, mod->v.Module.body)) ! return 0; break; case Interactive_kind: *************** *** 1195,1206 **** static int - compiler_isdocstring(stmt_ty s) - { - if (s->kind != Expr_kind) - return 0; - return s->v.Expr.value->kind == Str_kind; - } - - static int compiler_function(struct compiler *c, stmt_ty s) { --- 1225,1228 ---- *************** *** 1257,1261 **** compiler_class(struct compiler *c, stmt_ty s) { ! int n, i; PyCodeObject *co; PyObject *str; --- 1279,1283 ---- compiler_class(struct compiler *c, stmt_ty s) { ! int n; PyCodeObject *co; PyObject *str; *************** *** 1285,1299 **** Py_DECREF(str); ! stmt_ty st = asdl_seq_GET(s->v.ClassDef.body, 0); ! i = 0; ! if (compiler_isdocstring(st)) { ! i = 1; ! VISIT(c, expr, st->v.Expr.value); ! if (!compiler_nameop(c, __doc__, Store)) ! return 0; ! } ! ! for (; i < asdl_seq_LEN(s->v.ClassDef.body); i++) ! VISIT(c, stmt, asdl_seq_GET(s->v.ClassDef.body, i)); ADDOP(c, LOAD_LOCALS); --- 1307,1312 ---- Py_DECREF(str); ! if (!compiler_body(c, s->v.ClassDef.body)) ! return 0; ADDOP(c, LOAD_LOCALS); From jhylton at users.sourceforge.net Wed Apr 21 00:29:32 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 00:29:38 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.90, 1.1.2.91 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6649 Modified Files: Tag: ast-branch newcompile.c Log Message: Remove debugging print. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.90 retrieving revision 1.1.2.91 diff -C2 -d -r1.1.2.90 -r1.1.2.91 *** newcompile.c 21 Apr 2004 02:16:01 -0000 1.1.2.90 --- newcompile.c 21 Apr 2004 04:29:27 -0000 1.1.2.91 *************** *** 1088,1092 **** st = asdl_seq_GET(stmts, 0); - printf("is_docstring? %d\n", compiler_isdocstring(st)); if (compiler_isdocstring(st)) { i = 1; --- 1088,1091 ---- From jhylton at users.sourceforge.net Wed Apr 21 01:28:09 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 01:28:13 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.91, 1.1.2.92 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14966 Modified Files: Tag: ast-branch newcompile.c Log Message: Check for an empty body and exit immediately. This must guard the GET(..., 0) which blows up on an empty sequence. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.91 retrieving revision 1.1.2.92 diff -C2 -d -r1.1.2.91 -r1.1.2.92 *** newcompile.c 21 Apr 2004 04:29:27 -0000 1.1.2.91 --- newcompile.c 21 Apr 2004 05:28:06 -0000 1.1.2.92 *************** *** 1087,1090 **** --- 1087,1092 ---- stmt_ty st; + if (!asdl_seq_LEN(stmts)) + return 1; st = asdl_seq_GET(stmts, 0); if (compiler_isdocstring(st)) { From jhylton at users.sourceforge.net Wed Apr 21 01:58:25 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 01:58:29 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c, 2.314.2.4, 2.314.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19105 Modified Files: Tag: ast-branch ceval.c Log Message: Simplify hairy code to initialize cell variables. The old code depended on the order in which the old compiler put names into co_cellvars. The order is different with the new compiler, which caused a bunch of test failures (e.g. test_userdict) when an argument was also a cell variable. In comment, note that it might be a good idea for the compiler to generate names in a certain order. On the other hand, it's hard to imagine a practical case where this would make a difference. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.314.2.4 retrieving revision 2.314.2.5 diff -C2 -d -r2.314.2.4 -r2.314.2.5 *** ceval.c 26 Mar 2004 18:17:31 -0000 2.314.2.4 --- ceval.c 21 Apr 2004 05:58:08 -0000 2.314.2.5 *************** *** 2574,2583 **** nargs++; ! /* Check for cells that shadow args */ ! for (i = 0; i < f->f_ncells && j < nargs; ++i) { cellname = PyString_AS_STRING( PyTuple_GET_ITEM(co->co_cellvars, i)); found = 0; ! while (j < nargs) { argname = PyString_AS_STRING( PyTuple_GET_ITEM(co->co_varnames, j)); --- 2574,2589 ---- nargs++; ! /* Initialize each cell var, taking into account ! cell vars that are initialized from arguments. ! ! Should arrange for the compiler to put cellvars ! that are arguments at the beginning of the cellvars ! list so that we can march over it more efficiently? ! */ ! for (i = 0; i < f->f_ncells; ++i) { cellname = PyString_AS_STRING( PyTuple_GET_ITEM(co->co_cellvars, i)); found = 0; ! for (j = 0; j < nargs; j++) { argname = PyString_AS_STRING( PyTuple_GET_ITEM(co->co_varnames, j)); *************** *** 2590,2594 **** break; } - j++; } if (found == 0) { --- 2596,2599 ---- *************** *** 2599,2610 **** } } - /* Initialize any that are left */ - while (i < f->f_ncells) { - c = PyCell_New(NULL); - if (c == NULL) - goto fail; - SETLOCAL(f->f_nlocals + i, c); - i++; - } } if (f->f_nfreevars) { --- 2604,2607 ---- From jhylton at users.sourceforge.net Wed Apr 21 10:42:24 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 10:42:32 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.92, 1.1.2.93 future.c, 2.12.2.6, 2.12.2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7573 Modified Files: Tag: ast-branch newcompile.c future.c Log Message: Catch illegal future statements. Also add XXX comment about how macros like ADDOP_O() don't allow the caller to cleanup (DECREF) locals before returning. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.92 retrieving revision 1.1.2.93 diff -C2 -d -r1.1.2.92 -r1.1.2.93 *** newcompile.c 21 Apr 2004 05:28:06 -0000 1.1.2.92 --- newcompile.c 21 Apr 2004 14:41:24 -0000 1.1.2.93 *************** *** 1006,1009 **** --- 1006,1013 ---- */ + /* XXX The returns inside these macros make it impossible to decref + objects created in the local function. + */ + #define NEW_BLOCK(C) { \ *************** *** 1718,1724 **** --- 1722,1740 ---- for (i = 0; i < n; i++) { alias_ty alias = asdl_seq_GET(s->v.ImportFrom.names, i); + Py_INCREF(alias->name); PyTuple_SET_ITEM(names, i, alias->name); } + if (s->lineno > c->c_future->ff_lineno) { + if (!strcmp(PyString_AS_STRING(s->v.ImportFrom.module), + "__future__")) { + Py_DECREF(names); + return compiler_error(c, + "from __future__ imports must occur " + "at the beginning of the file"); + + } + } + ADDOP_O(c, LOAD_CONST, names, consts); ADDOP_NAME(c, IMPORT_NAME, s->v.ImportFrom.module, names); *************** *** 1739,1744 **** store_name = alias->asname; ! if (!compiler_nameop(c, store_name, Store)) return 0; } if (!star) --- 1755,1762 ---- store_name = alias->asname; ! if (!compiler_nameop(c, store_name, Store)) { ! Py_DECREF(names); return 0; + } } if (!star) Index: future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.12.2.6 retrieving revision 2.12.2.7 diff -C2 -d -r2.12.2.6 -r2.12.2.7 *** future.c 21 Mar 2004 19:34:11 -0000 2.12.2.6 --- future.c 21 Apr 2004 14:41:49 -0000 2.12.2.7 *************** *** 50,54 **** future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename) { ! int i; static PyObject *future; --- 50,54 ---- future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename) { ! int i, found_docstring = 0, done = 0, prev_line = 0; static PyObject *future; *************** *** 61,67 **** --- 61,81 ---- if (!(mod->kind == Module_kind || mod->kind == Interactive_kind)) return 1; + + /* A subsequent pass will detect future imports that don't + appear at the beginning of the file. There's one case, + however, that is easier to handl here: A series of imports + joined by semi-colons, where the first import is a future + statement but some subsequent import has the future form + but is preceded by a regular import. + */ + + for (i = 0; i < asdl_seq_LEN(mod->v.Module.body); i++) { stmt_ty s = asdl_seq_GET(mod->v.Module.body, i); + if (done && s->lineno > prev_line) + return 1; + prev_line = s->lineno; + /* The tests below will return from this function unless it is still possible to find a future statement. The only things *************** *** 72,88 **** if (s->kind == ImportFrom_kind) { if (s->v.ImportFrom.module == future) { if (!future_check_features(ff, s, filename)) return 0; } else ! return 1; } ! else if (s->kind == Expr_kind) { expr_ty e = s->v.Expr.value; if (e->kind != Str_kind) ! return 1; } else ! return 1; } return 1; --- 86,112 ---- if (s->kind == ImportFrom_kind) { if (s->v.ImportFrom.module == future) { + if (done) { + PyErr_SetString(PyExc_SyntaxError, + ERR_LATE_FUTURE); + PyErr_SyntaxLocation(filename, + s->lineno); + return 0; + } if (!future_check_features(ff, s, filename)) return 0; + ff->ff_lineno = s->lineno; } else ! done = 1; } ! else if (s->kind == Expr_kind && !found_docstring) { expr_ty e = s->v.Expr.value; if (e->kind != Str_kind) ! done = 1; ! else ! found_docstring = 1; } else ! done = 1; } return 1; *************** *** 98,104 **** if (ff == NULL) return NULL; - ff->ff_found_docstring = 0; - ff->ff_last_lineno = -1; ff->ff_features = 0; if (!future_parse(ff, mod, filename)) { --- 122,127 ---- if (ff == NULL) return NULL; ff->ff_features = 0; + ff->ff_lineno = -1; if (!future_parse(ff, mod, filename)) { From jhylton at users.sourceforge.net Wed Apr 21 10:44:35 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 10:44:37 2004 Subject: [Python-checkins] python/dist/src/Include compile.h, 2.37.2.9, 2.37.2.10 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8169 Modified Files: Tag: ast-branch compile.h Log Message: Catch illegal future statements. Remove ff_found_docstring; it's only need in one function. Shorten name of ff_last_lineno. Define ERR_LATE_FUTURE so that same string can be used in future.c and newcompile.c. Index: compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.37.2.9 retrieving revision 2.37.2.10 diff -C2 -d -r2.37.2.9 -r2.37.2.10 *** compile.h 26 Mar 2004 15:34:10 -0000 2.37.2.9 --- compile.h 21 Apr 2004 14:44:09 -0000 2.37.2.10 *************** *** 21,27 **** typedef struct { ! int ff_found_docstring; ! int ff_last_lineno; ! int ff_features; } PyFutureFeatures; --- 21,26 ---- typedef struct { ! int ff_features; /* flags set by future statements */ ! int ff_lineno; /* line number of last future statement */ } PyFutureFeatures; *************** *** 35,38 **** --- 34,39 ---- DL_IMPORT(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *); + #define ERR_LATE_FUTURE \ + "from __future__ imports must occur at the beginning of the file" #ifdef __cplusplus From jhylton at users.sourceforge.net Wed Apr 21 13:45:14 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 13:45:25 2004 Subject: [Python-checkins] python/dist/src/Python ast.c, 1.1.2.49, 1.1.2.50 pythonrun.c, 2.161.2.12, 2.161.2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5803/Python Modified Files: Tag: ast-branch ast.c pythonrun.c Log Message: Improved error handling inside ast.c; fixes test_syntax. Add ast_error() that captures line number of error and ast_finish_error() to assign filename and location. It's a little complicated this way, but less intrusive than passing the filename to every ast function that might raise an exception. Need to pass filename to PyAST_FromNode() for error handling. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.49 retrieving revision 1.1.2.50 diff -C2 -d -r1.1.2.49 -r1.1.2.50 *** ast.c 13 Apr 2004 17:11:43 -0000 1.1.2.49 --- ast.c 21 Apr 2004 17:45:09 -0000 1.1.2.50 *************** *** 42,45 **** --- 42,103 ---- extern grammar _PyParser_Grammar; /* From graminit.c */ + #ifndef LINENO + #define LINENO(n) ((n)->n_lineno) + #endif + + #define NEW_IDENTIFIER(n) PyString_InternFromString(STR(n)) + + /* This routine provides an invalid object for the syntax error. + The outermost routine must unpack this error and create the + proper object. We do this so that we don't have to pass + the filename to everything function. + + XXX Maybe we should just pass the filename... + */ + + static int + ast_error(const node *n, const char *errstr) + { + PyObject *u = Py_BuildValue("zi", errstr, LINENO(n)); + if (!u) + return 0; + PyErr_SetObject(PyExc_SyntaxError, u); + Py_DECREF(u); + return 0; + } + + static void + ast_error_finish(const char *filename) + { + PyObject *type, *value, *tback, *errstr, *loc, *tmp; + int lineno; + + assert(PyErr_Occurred()); + PyErr_Fetch(&type, &value, &tback); + errstr = PyTuple_GetItem(value, 0); + if (!errstr) + return; + Py_INCREF(errstr); + lineno = PyInt_AsLong(PyTuple_GetItem(value, 1)); + if (lineno == -1) + return; + Py_DECREF(value); + + loc = PyErr_ProgramText(filename, lineno); + if (!loc) { + Py_INCREF(Py_None); + loc = Py_None; + } + tmp = Py_BuildValue("(ziOO)", filename, lineno, Py_None, loc); + Py_DECREF(loc); + if (!tmp) + return; + value = Py_BuildValue("(OO)", errstr, tmp); + Py_DECREF(errstr); + Py_DECREF(tmp); + if (!value) + return; + PyErr_Restore(type, value, tback); + } /* num_stmts() returns number of contained statements. *************** *** 108,112 **** mod_ty ! PyAST_FromNode(const node *n, PyCompilerFlags *flags) { int i, j, num; --- 166,170 ---- mod_ty ! PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename) { int i, j, num; *************** *** 125,129 **** } - switch (TYPE(n)) { case file_input: --- 183,186 ---- *************** *** 167,171 **** stmts = asdl_seq_new(1); if (!stmts) ! return NULL; asdl_seq_SET(stmts, 0, Pass(n->n_lineno)); return Interactive(stmts); --- 224,228 ---- stmts = asdl_seq_new(1); if (!stmts) ! goto error; asdl_seq_SET(stmts, 0, Pass(n->n_lineno)); return Interactive(stmts); *************** *** 176,182 **** stmts = asdl_seq_new(num); if (!stmts) ! return NULL; if (num == 1) { ! asdl_seq_SET(stmts, 0, ast_for_stmt(&c, n)); } else { --- 233,242 ---- stmts = asdl_seq_new(num); if (!stmts) ! goto error; if (num == 1) { ! stmt_ty s = ast_for_stmt(&c, n); ! if (!s) ! goto error; ! asdl_seq_SET(stmts, 0, s); } else { *************** *** 202,216 **** if (stmts) asdl_seq_free(stmts); ! fprintf(stderr, "error in PyAST_FromNode() exc? %c\n", ! PyErr_Occurred() ? 'Y': 'N'); return NULL; } - #ifndef LINENO - #define LINENO(n) ((n)->n_lineno) - #endif - - #define NEW_IDENTIFIER(n) PyString_InternFromString(STR(n)) - /* Return the AST repr. of the operator represented as syntax (|, ^, etc.) */ --- 262,269 ---- if (stmts) asdl_seq_free(stmts); ! ast_error_finish(filename); return NULL; } /* Return the AST repr. of the operator represented as syntax (|, ^, etc.) */ *************** *** 275,279 **** static int ! set_context(expr_ty e, expr_context_ty ctx) { asdl_seq *s = NULL; --- 328,332 ---- static int ! set_context(expr_ty e, expr_context_ty ctx, const node *n) { asdl_seq *s = NULL; *************** *** 281,314 **** switch (e->kind) { case Attribute_kind: ! e->v.Attribute.ctx = ctx; ! break; case Subscript_kind: ! e->v.Subscript.ctx = ctx; ! break; case Name_kind: ! e->v.Name.ctx = ctx; ! break; case List_kind: ! e->v.List.ctx = ctx; ! s = e->v.List.elts; ! break; case Tuple_kind: ! e->v.Tuple.ctx = ctx; ! s = e->v.Tuple.elts; ! break; default: ! /* XXX It's not clear why were't getting into this code, ! although list comps seem like one possibility. ! ! This occurs in at least 2 cases: ! [x(i) for i in range(3)] # Call_kind (8) ! [i*2 for i in range(3)] # BinOp_kind (2) ! ! The byte code generated seems to work fine. ! Maybe there's a problem with nested list comps? ! */ ! abort(); ! fprintf(stderr, "can't set context for %d\n", e->kind); ! return 0; } if (s) { --- 334,364 ---- switch (e->kind) { case Attribute_kind: ! e->v.Attribute.ctx = ctx; ! break; case Subscript_kind: ! e->v.Subscript.ctx = ctx; ! break; case Name_kind: ! e->v.Name.ctx = ctx; ! break; case List_kind: ! e->v.List.ctx = ctx; ! s = e->v.List.elts; ! break; case Tuple_kind: ! e->v.Tuple.ctx = ctx; ! s = e->v.Tuple.elts; ! break; ! case Call_kind: ! if (ctx == Store) ! return ast_error(n, "can't assign to function call"); ! else if (ctx == Del) ! return ast_error(n, "can't delete function call"); ! else ! return ast_error(n, "unexpected operation on function call"); ! break; default: ! return ast_error(n, "unexpected node in assignment"); ! break; } if (s) { *************** *** 316,324 **** for (i = 0; i < asdl_seq_LEN(s); i++) { ! if (set_context(asdl_seq_GET(s, i), ctx) < 0) ! return -1; } } ! return 0; } --- 366,374 ---- for (i = 0; i < asdl_seq_LEN(s); i++) { ! if (!set_context(asdl_seq_GET(s, i), ctx, n)) ! return 0; } } ! return 1; } *************** *** 1348,1352 **** } else { ! int i, tmp; asdl_seq *targets; expr_ty expression; --- 1398,1402 ---- } else { ! int i; asdl_seq *targets; expr_ty expression; *************** *** 1364,1369 **** return NULL; } ! tmp = set_context(e, Store); ! if (tmp == -1) { asdl_seq_free(targets); return NULL; --- 1414,1418 ---- return NULL; } ! if (!set_context(e, Store, CHILD(n, i))) { asdl_seq_free(targets); return NULL; *************** *** 1430,1435 **** } if (context) { ! int context_result = set_context(e, context); ! if (context_result == -1) return NULL; } --- 1479,1483 ---- } if (context) { ! if (!set_context(e, context, CHILD(n, i))) return NULL; } *************** *** 2037,2041 **** if (!e) return NULL; ! if (set_context(e, Store) == -1) return NULL; expression = ast_for_expr(c, CHILD(exc, 1)); --- 2085,2089 ---- if (!e) return NULL; ! if (!set_context(e, Store, CHILD(exc, 3))) return NULL; expression = ast_for_expr(c, CHILD(exc, 1)); Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.161.2.12 retrieving revision 2.161.2.13 diff -C2 -d -r2.161.2.12 -r2.161.2.13 *** pythonrun.c 13 Apr 2004 15:04:01 -0000 2.161.2.12 --- pythonrun.c 21 Apr 2004 17:45:10 -0000 2.161.2.13 *************** *** 1175,1179 **** PARSER_FLAGS(flags)); if (n) { ! mod = PyAST_FromNode(n, flags); PyNode_Free(n); return mod; --- 1175,1179 ---- PARSER_FLAGS(flags)); if (n) { ! mod = PyAST_FromNode(n, flags, filename); PyNode_Free(n); return mod; *************** *** 1195,1199 **** ps1, ps2, &err, PARSER_FLAGS(flags)); if (n) { ! mod = PyAST_FromNode(n, flags); PyNode_Free(n); return mod; --- 1195,1199 ---- ps1, ps2, &err, PARSER_FLAGS(flags)); if (n) { ! mod = PyAST_FromNode(n, flags, filename); PyNode_Free(n); return mod; From jhylton at users.sourceforge.net Wed Apr 21 13:45:47 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Apr 21 13:45:59 2004 Subject: [Python-checkins] python/dist/src/Include ast.h,1.1.2.3,1.1.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5803/Include Modified Files: Tag: ast-branch ast.h Log Message: Improved error handling inside ast.c; fixes test_syntax. Add ast_error() that captures line number of error and ast_finish_error() to assign filename and location. It's a little complicated this way, but less intrusive than passing the filename to every ast function that might raise an exception. Need to pass filename to PyAST_FromNode() for error handling. Index: ast.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Attic/ast.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** ast.h 20 Mar 2004 21:28:22 -0000 1.1.2.3 --- ast.h 21 Apr 2004 17:45:08 -0000 1.1.2.4 *************** *** 5,9 **** #endif ! extern DL_IMPORT(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags); #ifdef __cplusplus --- 5,10 ---- #endif ! extern DL_IMPORT(mod_ty) PyAST_FromNode(const node *, PyCompilerFlags *flags, ! const char *); #ifdef __cplusplus From kbk at users.sourceforge.net Wed Apr 21 16:07:31 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Wed Apr 21 16:07:36 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib CodeContext.py, NONE, 1.1 NEWS.txt, 1.33, 1.34 config-extensions.def, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3845 Modified Files: NEWS.txt config-extensions.def Added Files: CodeContext.py Log Message: - New Extension: CodeContext. Provides block structuring hints for code which has scrolled above an edit window. Patch 936169 Noam Raphael. A CodeContext.py M NEWS.txt M config-extensions.def --- NEW FILE: CodeContext.py --- """CodeContext - Display the block context of code at top of edit window Once code has scolled off the top of the screen, it can be difficult to determine which block you are in. This extension implements a pane at the top of each IDLE edit window which provides block structure hints. These hints are the lines which contain the block opening keywords, e.g. 'if', for the enclosing block. The number of hint lines is determined by the numlines variable in the CodeContext section of config-extensions.def. Lines which do not open blocks are not shown in the context hints pane. """ import Tkinter from configHandler import idleConf from PyShell import PyShell from string import whitespace import re BLOCKOPENERS = dict([(x, None) for x in ("class", "def", "elif", "else", "except", "finally", "for", "if", "try", "while")]) INFINITY = 1 << 30 UPDATEINTERVAL = 100 #ms FONTUPDATEINTERVAL = 1000 #ms getspacesfirstword = lambda s, c=re.compile(r"^(\s*)(\w*)"): c.match(s).groups() class CodeContext: menudefs = [] numlines = idleConf.GetOption("extensions", "CodeContext", "numlines", type="int", default=3) bgcolor = idleConf.GetOption("extensions", "CodeContext", "bgcolor", type="str", default="LightGray") fgcolor = idleConf.GetOption("extensions", "CodeContext", "fgcolor", type="str", default="Black") def __init__(self, editwin): if isinstance(editwin, PyShell): return self.editwin = editwin self.text = editwin.text self.textfont = self.text["font"] self.label = Tkinter.Label(self.editwin.top, text="\n" * (self.numlines - 1), anchor="w", justify="left", font=self.textfont, bg=self.bgcolor, fg=self.fgcolor, relief="sunken", width=1, # Don't request more than we get ) self.label.pack(side="top", fill="x", expand=0, after=self.editwin.status_bar) # Dummy line, which starts the "block" of the whole document: self.info = list(self.interesting_lines(1)) self.lastfirstline = 1 # Start two update cycles, one for context lines, one for font changes. self.text.after(UPDATEINTERVAL, self.timer_event) self.text.after(FONTUPDATEINTERVAL, self.font_timer_event) def get_line_info(self, linenum): """Get the line indent value, text, and any block start keyword If the line does not start a block, the keyword value is False. The indentation of empty lines (or comment lines) is INFINITY. There is a dummy block start, with indentation -1 and text "". Return the indent level, text (including leading whitespace), and the block opening keyword. """ if linenum == 0: return -1, "", True text = self.text.get("%d.0" % linenum, "%d.end" % linenum) spaces, firstword = getspacesfirstword(text) opener = firstword in BLOCKOPENERS and firstword if len(text) == len(spaces) or text[len(spaces)] == '#': indent = INFINITY else: indent = len(spaces) return indent, text, opener def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(firstline, -1, -1): indent, text, opener = self.get_line_info(line_index) if indent < lastindent: lastindent = indent if opener == "else" or "elif": # We also show the if statement lastindent += 1 if opener and line_index < firstline: yield line_index, text def update_label(self): firstline = int(self.text.index("@0,0").split('.')[0]) if self.lastfirstline == firstline: return self.lastfirstline = firstline tmpstack = [] for line_index, text in self.interesting_lines(firstline): # Remove irrelevant self.info items, and when we reach a relevant # item (which must happen because of the dummy element), break. while self.info[-1][0] > line_index: del self.info[-1] if self.info[-1][0] == line_index: break # Add the block starting line info to tmpstack tmpstack.append((line_index, text)) while tmpstack: self.info.append(tmpstack.pop()) lines = [""] * max(0, self.numlines - len(self.info)) + \ [x[1] for x in self.info[-self.numlines:]] self.label["text"] = '\n'.join(lines) def timer_event(self): self.update_label() self.text.after(UPDATEINTERVAL, self.timer_event) def font_timer_event(self): newtextfont = self.text["font"] if newtextfont != self.textfont: self.textfont = newtextfont self.label["font"] = self.textfont self.text.after(FONTUPDATEINTERVAL, self.font_timer_event) Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** NEWS.txt 11 Apr 2004 03:16:07 -0000 1.33 --- NEWS.txt 21 Apr 2004 20:06:22 -0000 1.34 *************** *** 4,7 **** --- 4,10 ---- *Release date: XX-XXX-2004* + - New Extension: CodeContext. Provides block structuring hints for code + which has scrolled above an edit window. Patch 936169 Noam Raphael. + - If nulls somehow got into the strings in recent-files.lst EditorWindow.update_recent_files_list() was failing. Python Bug 931336. Index: config-extensions.def =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/config-extensions.def,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** config-extensions.def 16 Jul 2003 03:10:43 -0000 1.12 --- config-extensions.def 21 Apr 2004 20:06:26 -0000 1.13 *************** *** 4,8 **** # Each extension must have at least one section, named after the extension # module. This section must contain an 'enable' item (=1 to enable the ! # extension, =0 to disable it) and also contains any other general # configuration items for the extension. Each extension may also define up to # two optional sections named ExtensionName_bindings and --- 4,8 ---- # Each extension must have at least one section, named after the extension # module. This section must contain an 'enable' item (=1 to enable the ! # extension, =0 to disable it) and also contain any other general # configuration items for the extension. Each extension may also define up to # two optional sections named ExtensionName_bindings and *************** *** 13,20 **** # Currently it is necessary to manually modify this file to change extension ! # key bindings. Note: If a keybinding is already in use when the extension is # loaded, the extension's virtual event's keybinding will be set to ''. ! # See config-keys.def for notes on specifying keys. [FormatParagraph] --- 13,25 ---- # Currently it is necessary to manually modify this file to change extension ! # key bindings and default values. To customize, create ! # ~/.idlerc/config-extensions.cfg and append the appropriate customized ! # section(s). Those sections will override the defaults in this file. ! ! # Note: If a keybinding is already in use when the extension is # loaded, the extension's virtual event's keybinding will be set to ''. ! # See config-keys.def for notes on specifying keys and extend.txt for ! # information on creating IDLE extensions. [FormatParagraph] *************** *** 57,58 **** --- 62,69 ---- flash-open-paren= check-restore= + + [CodeContext] + enable=1 + numlines=3 + bgcolor=LightGray + fgcolor=Black From Dorothea at lovingchatter.com Wed Apr 21 19:36:02 2004 From: Dorothea at lovingchatter.com (Bettie Kline) Date: Wed Apr 21 23:49:52 2004 Subject: [Python-checkins] confident? Message-ID: Interested in a blind-date that has been pre-arranged by a mutual friend? Click here to accept the invitation: http://meetingalove.com/confirm/?oc=50796666 Click here if you do not wish to be invited again: http://meetingalove.com/remove/?oc=50796666 dbefittingcollide consequential negligent cowl chrysolite attribution desolate coattail corruptible dahl pretentious sanders remonstrate boatload jason elk dennis family vfaulknerdisseminate hardbake harelip cyril boa caper referential battalion enjoinder avoid eloquent mynheer arabesque raft antiquary caret ammo shipwreck From Augustus at lovingchatter.com Thu Apr 22 16:26:39 2004 From: Augustus at lovingchatter.com (Liza Maher) Date: Thu Apr 22 09:56:52 2004 Subject: [Python-checkins] shlong long? Message-ID: Interested in a blind-date that has been pre-arranged by a mutual friend? Click here to accept the invitation: http://lovingbetteronline.com/confirm/?oc=50795556 Click here if you do not wish to be invited again: http://findingsite.com/remove/?oc=50795556 From jhylton at users.sourceforge.net Thu Apr 22 12:11:18 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Thu Apr 22 12:11:24 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.93, 1.1.2.94 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24660 Modified Files: Tag: ast-branch newcompile.c Log Message: Fix code generation for extended slices. The AST should probably be changed for slices, because an ExtendedSlice is sufficiently unlike any of the other cases. In particular, an ExtSlice can contain any of the other slice types, and it is the only slice type that can do this. Also, fix stack depth calculation for STORE+n opcodes. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.93 retrieving revision 1.1.2.94 diff -C2 -d -r1.1.2.93 -r1.1.2.94 *** newcompile.c 21 Apr 2004 14:41:24 -0000 1.1.2.93 --- newcompile.c 22 Apr 2004 16:11:15 -0000 1.1.2.94 *************** *** 700,710 **** case SLICE+0: ! return 0; case SLICE+1: ! return -1; case SLICE+2: ! return -1; case SLICE+3: ! return -2; case STORE_SLICE+0: --- 700,710 ---- case SLICE+0: ! return 1; case SLICE+1: ! return 0; case SLICE+2: ! return 0; case SLICE+3: ! return -1; case STORE_SLICE+0: *************** *** 2573,2576 **** --- 2573,2577 ---- int op; + /* XXX this code is duplicated */ switch (ctx) { case AugLoad: /* fall through to Load */ *************** *** 2579,2583 **** case Store: op = STORE_SUBSCR; break; case Del: op = DELETE_SUBSCR; break; ! default: fprintf(stderr, "invalid %s kind %d in compiler_visit_slice\n", kind, ctx); --- 2580,2584 ---- case Store: op = STORE_SUBSCR; break; case Del: op = DELETE_SUBSCR; break; ! case Param: fprintf(stderr, "invalid %s kind %d in compiler_visit_slice\n", kind, ctx); *************** *** 2595,2650 **** static int ! compiler_slice(struct compiler *c, slice_ty s, int op, expr_context_ty ctx) { ! int slice_offset = 0, stack_count = 0; assert(s->kind == Slice_kind); ! /* XXX: is this right? is ExtSlice ever used? */ ! if (s->v.Slice.step) { ! if (s->v.Slice.lower) { VISIT(c, expr, s->v.Slice.lower); ! } ! else { ADDOP_O(c, LOAD_CONST, Py_None, consts); ! } ! if (s->v.Slice.upper) { VISIT(c, expr, s->v.Slice.upper); ! } ! else { ADDOP_O(c, LOAD_CONST, Py_None, consts); ! } ! VISIT(c, expr, s->v.Slice.step); ! ADDOP_I(c, BUILD_SLICE, 3); /* XXX: always 3? remove arg? */ ! return compiler_handle_subscr(c, "extended slice", ctx); ! } if (s->v.Slice.lower) { stack_count++; ! slice_offset |= 1; ! if (ctx != AugStore) VISIT(c, expr, s->v.Slice.lower); } if (s->v.Slice.upper) { stack_count++; ! slice_offset |= 2; ! if (ctx != AugStore) VISIT(c, expr, s->v.Slice.upper); } ! if (ctx == AugLoad) { ! switch (stack_count) { ! case 0: ADDOP(c, DUP_TOP); break; ! case 1: ADDOP_I(c, DUP_TOPX, 2); break; ! case 2: ADDOP_I(c, DUP_TOPX, 3); break; ! } ! } ! else if (ctx == AugStore) { ! switch (stack_count) { ! case 0: ADDOP(c, ROT_TWO); break; ! case 1: ADDOP(c, ROT_THREE); break; ! case 2: ADDOP(c, ROT_FOUR); break; ! } } --- 2596,2670 ---- static int ! compiler_slice(struct compiler *c, slice_ty s, expr_context_ty ctx) { ! int n = 2; assert(s->kind == Slice_kind); ! /* only handles the cases where BUILD_SLICE is emitted */ ! if (s->v.Slice.lower) { VISIT(c, expr, s->v.Slice.lower); ! } ! else { ADDOP_O(c, LOAD_CONST, Py_None, consts); ! } ! if (s->v.Slice.upper) { VISIT(c, expr, s->v.Slice.upper); ! } ! else { ADDOP_O(c, LOAD_CONST, Py_None, consts); ! } ! if (s->v.Slice.step) { ! n++; ! VISIT(c, expr, s->v.Slice.step); ! } ! ADDOP_I(c, BUILD_SLICE, n); ! return 1; ! } ! ! static int ! compiler_simple_slice(struct compiler *c, slice_ty s, expr_context_ty ctx) ! { ! int op, slice_offset = 0, stack_count = 0; + assert(s->v.Slice.step == NULL); if (s->v.Slice.lower) { + slice_offset++; stack_count++; ! if (ctx != AugStore) VISIT(c, expr, s->v.Slice.lower); } if (s->v.Slice.upper) { + slice_offset += 2; stack_count++; ! if (ctx != AugStore) VISIT(c, expr, s->v.Slice.upper); } ! if (ctx == AugLoad) { ! switch (stack_count) { ! case 0: ADDOP(c, DUP_TOP); break; ! case 1: ADDOP_I(c, DUP_TOPX, 2); break; ! case 2: ADDOP_I(c, DUP_TOPX, 3); break; ! } ! } ! else if (ctx == AugStore) { ! switch (stack_count) { ! case 0: ADDOP(c, ROT_TWO); break; ! case 1: ADDOP(c, ROT_THREE); break; ! case 2: ADDOP(c, ROT_FOUR); break; ! } ! } ! ! switch (ctx) { ! case AugLoad: /* fall through to Load */ ! case Load: op = SLICE; break; ! case AugStore:/* fall through to Store */ ! case Store: op = STORE_SLICE; break; ! case Del: op = DELETE_SLICE; break; ! case Param: /* XXX impossible? */ ! fprintf(stderr, "param invalid\n"); ! assert(0); } *************** *** 2654,2660 **** static int compiler_visit_slice(struct compiler *c, slice_ty s, expr_context_ty ctx) { - int op; switch (s->kind) { case Ellipsis_kind: --- 2674,2701 ---- static int + compiler_visit_nested_slice(struct compiler *c, slice_ty s, + expr_context_ty ctx) + { + switch (s->kind) { + case Ellipsis_kind: + ADDOP_O(c, LOAD_CONST, Py_Ellipsis, consts); + break; + case Slice_kind: + return compiler_slice(c, s, ctx); + break; + case Index_kind: + VISIT(c, expr, s->v.Index.value); + break; + case ExtSlice_kind: + assert(0); + break; + } + return 1; + } + + + static int compiler_visit_slice(struct compiler *c, slice_ty s, expr_context_ty ctx) { switch (s->kind) { case Ellipsis_kind: *************** *** 2662,2680 **** break; case Slice_kind: ! switch (ctx) { ! case AugLoad: /* fall through to Load */ ! case Load: op = SLICE; break; ! case AugStore:/* fall through to Store */ ! case Store: op = STORE_SLICE; break; ! case Del: op = DELETE_SLICE; break; ! default: ! fprintf(stderr, "invalid slice kind %d " ! "in compiler_visit_slice\n", ctx); return 0; } ! return compiler_slice(c, s, op, ctx); ! case ExtSlice_kind: ! /* XXX: do we need to do anything? should this be removed? */ break; case Index_kind: if (ctx != AugStore) --- 2703,2729 ---- break; case Slice_kind: ! if (!s->v.Slice.step) ! return compiler_simple_slice(c, s, ctx); ! if (!compiler_slice(c, s, ctx)) return 0; + if (ctx == AugLoad) { + ADDOP_I(c, DUP_TOPX, 2); } ! else if (ctx == AugStore) { ! ADDOP(c, ROT_THREE); ! } ! return compiler_handle_subscr(c, "slice", ctx); break; + case ExtSlice_kind: { + int i, n = asdl_seq_LEN(s->v.ExtSlice.dims); + for (i = 0; i < n; i++) { + slice_ty sub = asdl_seq_GET(s->v.ExtSlice.dims, i); + if (!compiler_visit_nested_slice(c, sub, ctx)) + return 0; + } + ADDOP_I(c, BUILD_TUPLE, n); + return compiler_handle_subscr(c, "extended slice", ctx); + break; + } case Index_kind: if (ctx != AugStore) *************** *** 2729,2736 **** instr = &b->b_instr[i]; depth += opcode_stack_effect(instr->i_opcode, instr->i_oparg); - assert(depth >= 0); /* invalid code or bug in stackdepth() */ if (depth > maxdepth) maxdepth = depth; ! fprintf(stderr, " %s %d\n", opnames[instr->i_opcode], depth); if (instr->i_jrel || instr->i_jabs) { maxdepth = stackdepth_walk(c, instr->i_target, --- 2778,2787 ---- instr = &b->b_instr[i]; depth += opcode_stack_effect(instr->i_opcode, instr->i_oparg); if (depth > maxdepth) maxdepth = depth; ! fprintf(stderr, " %14s %3d %3d (%d)\n", ! opnames[instr->i_opcode], depth, maxdepth, ! instr->i_lineno); ! assert(depth >= 0); /* invalid code or bug in stackdepth() */ if (instr->i_jrel || instr->i_jabs) { maxdepth = stackdepth_walk(c, instr->i_target, From theller at users.sourceforge.net Thu Apr 22 13:03:36 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 13:03:42 2004 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.vcproj, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3488 Modified Files: pythoncore.vcproj Log Message: Modules/heapqmodule.c removed. Modules/_heapmodule.c added. Index: pythoncore.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pythoncore.vcproj 1 Feb 2004 18:02:48 -0000 1.5 --- pythoncore.vcproj 22 Apr 2004 17:03:33 -0000 1.6 *************** *** 208,211 **** --- 208,214 ---- + + - - - - - - - - Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5345 Modified Files: .cvsignore Log Message: cvs ignore the user options files *.suo Index: .cvsignore =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 24 Apr 2000 13:32:05 -0000 1.3 --- .cvsignore 22 Apr 2004 17:11:49 -0000 1.4 *************** *** 13,14 **** --- 13,15 ---- *.pyd *-temp-* + *.suo From theller at users.sourceforge.net Thu Apr 22 13:23:24 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 13:23:31 2004 Subject: [Python-checkins] python/dist/src/Doc/api refcounting.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7973 Modified Files: refcounting.tex Log Message: Two new public API functions, Py_IncRef and Py_DecRef. Useful for dynamic embedders of Python. Index: refcounting.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounting.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** refcounting.tex 12 Oct 2001 19:01:43 -0000 1.1 --- refcounting.tex 22 Apr 2004 17:23:21 -0000 1.2 *************** *** 43,46 **** --- 43,51 ---- \end{cfuncdesc} + The following functions are for runtime dynamic embedding of Python: + \cfunction{Py_IncRef(PyObject *o)}, \cfunction{Py_DecRef(PyObject *o)}. + They are simply exported function versions of \cfunction{Py_XINCREF()} and + \cfunction{Py_XDECREF()}, respectively. + The following functions or macros are only for use within the interpreter core: \cfunction{_Py_Dealloc()}, From theller at users.sourceforge.net Thu Apr 22 13:23:32 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 13:23:38 2004 Subject: [Python-checkins] python/dist/src/Include object.h,2.125,2.126 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8016 Modified Files: object.h Log Message: Two new public API functions, Py_IncRef and Py_DecRef. Useful for dynamic embedders of Python. Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.125 retrieving revision 2.126 diff -C2 -d -r2.125 -r2.126 *** object.h 9 Nov 2003 16:38:39 -0000 2.125 --- object.h 22 Apr 2004 17:23:30 -0000 2.126 *************** *** 626,629 **** --- 626,636 ---- /* + These are provided as conveniences to Python runtime embedders, so that + they can have object code that is not dependent on Python compilation flags. + */ + PyAPI_FUNC(void) Py_IncRef(PyObject *); + PyAPI_FUNC(void) Py_DecRef(PyObject *); + + /* _Py_NoneStruct is an object of undefined type which can be used in contexts where NULL (nil) is not suitable (since NULL often means 'error'). From theller at users.sourceforge.net Thu Apr 22 13:23:42 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 13:23:49 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.967,1.968 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8049 Modified Files: NEWS Log Message: Two new public API functions, Py_IncRef and Py_DecRef. Useful for dynamic embedders of Python. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.967 retrieving revision 1.968 diff -C2 -d -r1.967 -r1.968 *** NEWS 20 Apr 2004 21:10:26 -0000 1.967 --- NEWS 22 Apr 2004 17:23:39 -0000 1.968 *************** *** 472,475 **** --- 472,479 ---- ----- + - New public functions Py_IncRef() and Py_DecRef(), exposing the + functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for + runtime dynamic embedding of Python. + - Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's underlying array of PyObject pointers. Useful for high speed looping. From theller at users.sourceforge.net Thu Apr 22 13:23:52 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 13:23:57 2004 Subject: [Python-checkins] python/dist/src/Objects object.c,2.216,2.217 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8091 Modified Files: object.c Log Message: Two new public API functions, Py_IncRef and Py_DecRef. Useful for dynamic embedders of Python. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.216 retrieving revision 2.217 diff -C2 -d -r2.216 -r2.217 *** object.c 21 Mar 2004 17:35:06 -0000 2.216 --- object.c 22 Apr 2004 17:23:49 -0000 2.217 *************** *** 147,150 **** --- 147,162 ---- #endif /* Py_REF_DEBUG */ + void + Py_IncRef(PyObject *o) + { + Py_XINCREF(o); + } + + void + Py_DecRef(PyObject *o) + { + Py_XDECREF(o); + } + PyObject * PyObject_Init(PyObject *op, PyTypeObject *tp) From theller at users.sourceforge.net Thu Apr 22 13:28:28 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 13:28:34 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.968,1.969 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9043 Modified Files: NEWS Log Message: Forgot to mention the SF number, and that Bob Ippolito provided the patch. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.968 retrieving revision 1.969 diff -C2 -d -r1.968 -r1.969 *** NEWS 22 Apr 2004 17:23:39 -0000 1.968 --- NEWS 22 Apr 2004 17:28:25 -0000 1.969 *************** *** 474,478 **** - New public functions Py_IncRef() and Py_DecRef(), exposing the functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for ! runtime dynamic embedding of Python. - Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's --- 474,479 ---- - New public functions Py_IncRef() and Py_DecRef(), exposing the functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for ! runtime dynamic embedding of Python. See patch #938302, by Bob ! Ippolito. - Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's From theller at users.sourceforge.net Thu Apr 22 14:24:33 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 14:24:37 2004 Subject: [Python-checkins] python/dist/src/PCbuild pydebug.iss,NONE,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21986 Added Files: Tag: release23-maint pydebug.iss Log Message: As discussed on python-dev, a script for the free Inno Setup tool which will create a windows installer containing only the Python debugging binaries. They will be installed alongside an existing Python installation, the location is read from the registry. This allows easy building and debugging of own compiled extensions. --- NEW FILE: pydebug.iss --- ; This script for Inno Setup (http://www.jrsoftware.org/isinfo.php) ; creates a windows installer for the debugging binaries of Python. ; ; It installs a debug python exe, a debug python dll, debug versions ; of the Python extensions, and debug libraries. ; ; An existing standard Python installation is required, the debug ; files are copied alongside the standard python files, the ; installation directory is read from the registry. ; ; XXX The python dll is copied to the installation directory, *not* ; into the system directory. [Setup] AppName=Python Debug Runtime AppVerName=Python 2.3 Debug Runtime DisableDirPage=yes DefaultGroupName={reg:HKLM\SOFTWARE\Python\PythonCore\2.3\InstallPath\InstallGroup,|} DisableProgramGroupPage=yes SourceDir=. OutputDir=. OutputBaseFilename=Python-Debug-2.3.3 DefaultDirName={reg:HKLM\SOFTWARE\Python\PythonCore\2.3\InstallPath,|} [Code] function InitializeSetup(): Boolean; begin Result := RegKeyExists(HKLM,'SOFTWARE\Python\PythonCore\2.3\InstallPath'); if Result = False then MsgBox('Error: Python 2.3 not installed.', mbInformation, MB_OK); end; [Icons] Name: "{group}\Python Debug (command line)"; Filename: "{app}\python_d.exe" [Files] ; exe-files Source: "python_d.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "w9xpopen_d.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "python_d.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "pythonw_d.exe"; DestDir: "{app}"; Flags: ignoreversion ; dlls Source: "python23_d.dll"; DestDir: "{app}"; Flags: ignoreversion ; extension modules Source: "zlib_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_bsddb_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_csv_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_socket_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_sre_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_ssl_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_symtable_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_testcapi_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_tkinter_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "_winreg_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "bz2_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "datetime_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "mmap_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "parser_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "pyexpat_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "select_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "unicodedata_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion Source: "winsound_d.pyd"; DestDir: "{app}\DLLs"; Flags: ignoreversion ; libraries Source: "zlib_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_bsddb_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_csv_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_socket_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_sre_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_ssl_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_symtable_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_testcapi_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_tkinter_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "_winreg_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "bz2_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "datetime_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "mmap_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "parser_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "pyexpat_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "python23_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "select_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "unicodedata_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion Source: "winsound_d.lib"; DestDir: "{app}\libs"; Flags: ignoreversion From theller at users.sourceforge.net Thu Apr 22 14:30:20 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Thu Apr 22 14:30:24 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 pythoncore.dsp,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23246 Modified Files: pythoncore.dsp Log Message: Remove the Modules/heaqmodule.c, and add Modules/_heapmodule.c, so that the project compiles again with VC6. Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pythoncore.dsp 29 Jan 2004 06:37:52 -0000 1.6 --- pythoncore.dsp 22 Apr 2004 18:30:17 -0000 1.7 *************** *** 146,149 **** --- 146,153 ---- # Begin Source File + SOURCE=..\..\Modules\_heapmodule.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_hotshot.c # End Source File *************** *** 403,410 **** # Begin Source File - SOURCE=..\..\Modules\heapqmodule.c - # End Source File - # Begin Source File - SOURCE=..\..\Modules\imageop.c # End Source File --- 407,410 ---- From jhylton at users.sourceforge.net Thu Apr 22 23:29:47 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Thu Apr 22 23:29:56 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_code.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5181/test Added Files: Tag: ast-branch test_code.py Log Message: A simple doctest that looks at the guts of a code object. --- NEW FILE: test_code.py --- """This module includes tests of the code object representation. >>> def f(x): ... def g(y): ... return x + y ... return g ... >>> dump(f.func_code) name: f argcount: 1 names: () varnames: ('x', 'g') cellvars: ('x',) freevars: () nlocals: 2 flags: 3 consts: ('None', '') >>> dump(f(4).func_code) name: g argcount: 1 names: () varnames: ('y',) cellvars: () freevars: ('x',) nlocals: 1 flags: 19 consts: ('None',) >>> def h(x, y): ... a = x + y ... b = x - y ... c = a * b ... return c ... >>> dump(h.func_code) name: h argcount: 2 names: () varnames: ('x', 'y', 'a', 'b', 'c') cellvars: () freevars: () nlocals: 5 flags: 67 consts: ('None',) >>> def attrs(obj): ... print obj.attr1 ... print obj.attr2 ... print obj.attr3 >>> dump(attrs.func_code) name: attrs argcount: 1 names: ('attr1', 'attr2', 'attr3') varnames: ('obj',) cellvars: () freevars: () nlocals: 1 flags: 67 consts: ('None',) """ def consts(t): """Yield a doctest-safe sequence of object reprs.""" for elt in t: r = repr(elt) if r.startswith("" % elt.co_name else: yield r def dump(co): """Print out a text representation of a code object.""" for attr in ["name", "argcount", "names", "varnames", "cellvars", "freevars", "nlocals", "flags"]: print "%s: %s" % (attr, getattr(co, "co_" + attr)) print "consts:", tuple(consts(co.co_consts)) def test_main(verbose=None): from test.test_support import run_doctest from test import test_code run_doctest(test_code, verbose) From jhylton at users.sourceforge.net Fri Apr 23 00:11:54 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:11:56 2004 Subject: [Python-checkins] python/dist/src/Python pythonrun.c, 2.161.2.13, 2.161.2.14 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11130 Modified Files: Tag: ast-branch pythonrun.c Log Message: Pass the filename to the parser, so it gets included in syntax errors. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.161.2.13 retrieving revision 2.161.2.14 diff -C2 -d -r2.161.2.13 -r2.161.2.14 *** pythonrun.c 21 Apr 2004 17:45:10 -0000 2.161.2.13 --- pythonrun.c 23 Apr 2004 04:11:51 -0000 2.161.2.14 *************** *** 1172,1177 **** mod_ty mod; perrdetail err; ! n = PyParser_ParseStringFlags(s, &_PyParser_Grammar, start, &err, ! PARSER_FLAGS(flags)); if (n) { mod = PyAST_FromNode(n, flags, filename); --- 1172,1178 ---- mod_ty mod; perrdetail err; ! n = PyParser_ParseStringFlagsFilename(s, filename, &_PyParser_Grammar, ! start, &err, ! PARSER_FLAGS(flags)); if (n) { mod = PyAST_FromNode(n, flags, filename); From jhylton at users.sourceforge.net Fri Apr 23 00:12:31 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:12:34 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.94, 1.1.2.95 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11235 Modified Files: Tag: ast-branch newcompile.c Log Message: Disallow assignment to __debug__. This version happens to catch more cases than standard Python. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.94 retrieving revision 1.1.2.95 diff -C2 -d -r1.1.2.94 -r1.1.2.95 *** newcompile.c 22 Apr 2004 16:11:15 -0000 1.1.2.94 --- newcompile.c 23 Apr 2004 04:12:28 -0000 1.1.2.95 *************** *** 2037,2040 **** --- 2037,2047 ---- PyObject *dict = c->u->u_names; /* XXX AugStore isn't used anywhere! */ + + /* First check for assignment to __debug__. Param? */ + if ((ctx == Store || ctx == AugStore || ctx == Del) + && !strcmp(PyString_AS_STRING(name), "__debug__")) { + return compiler_error(c, "can not assign to __debug__"); + } + op = 0; optype = OP_NAME; From jhylton at users.sourceforge.net Fri Apr 23 00:14:10 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:14:13 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_compile.py, 1.10.10.1, 1.10.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11430/test Modified Files: Tag: ast-branch test_compile.py Log Message: Change most of test_compile to a doctest. Index: test_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v retrieving revision 1.10.10.1 retrieving revision 1.10.10.2 diff -C2 -d -r1.10.10.1 -r1.10.10.2 *** test_compile.py 28 Apr 2003 17:28:59 -0000 1.10.10.1 --- test_compile.py 23 Apr 2004 04:14:07 -0000 1.10.10.2 *************** *** 1,80 **** ! from test.test_support import verbose, TestFailed ! if verbose: ! print "Testing whether compiler catches assignment to __debug__" ! try: ! compile('__debug__ = 1', '?', 'single') ! except SyntaxError: ! pass ! import __builtin__ ! prev = __builtin__.__debug__ ! setattr(__builtin__, '__debug__', 'sure') ! setattr(__builtin__, '__debug__', prev) ! if verbose: ! print 'Running tests on argument handling' ! try: ! exec 'def f(a, a): pass' ! raise TestFailed, "duplicate arguments" ! except SyntaxError: ! pass ! if verbose: ! print "compiling string with syntax error" ! try: ! compile("1+*3", "filename", "exec") ! except SyntaxError, detail: ! if not detail.filename == "filename": ! raise TestFailed, "expected 'filename', got %r" % detail.filename ! try: ! exec 'def f(a = 0, a = 1): pass' ! raise TestFailed, "duplicate keyword arguments" ! except SyntaxError: ! pass ! try: ! exec 'def f(a): global a; a = 1' ! raise TestFailed, "variable is global and local" ! except SyntaxError: ! pass ! if verbose: ! print "testing complex args" ! def comp_args((a, b)): ! print a,b ! comp_args((1, 2)) ! def comp_args((a, b)=(3, 4)): ! print a, b ! comp_args((1, 2)) ! comp_args() ! def comp_args(a, (b, c)): ! print a, b, c ! comp_args(1, (2, 3)) ! def comp_args(a=2, (b, c)=(3, 4)): ! print a, b, c ! comp_args(1, (2, 3)) ! comp_args() ! try: ! exec 'def f(a=1, (b, c)): pass' ! raise TestFailed, "non-default args after default" ! except SyntaxError: ! pass ! if verbose: ! print "testing bad float literals" def expect_error(s): --- 1,113 ---- ! """Test a variety of compilation edge cases. ! Several ways to assign to __debug__ ! ----------------------------------- ! >>> __debug__ = 1 ! Traceback (most recent call last): ! ... ! SyntaxError: can not assign to __debug__ (, line 1) ! >>> import __debug__ ! Traceback (most recent call last): ! ... ! SyntaxError: can not assign to __debug__ (, line 1) ! >>> try: ! ... 1 ! ... except MemoryError, __debug__: ! ... pass ! Traceback (most recent call last): ! ... ! SyntaxError: can not assign to __debug__ (, line 2) ! Shouldn't that be line 3? ! >>> def __debug__(): ! ... pass ! Traceback (most recent call last): ! ... ! SyntaxError: can not assign to __debug__ (, line 1) ! Not sure what the next few lines is trying to test. ! >>> import __builtin__ ! >>> prev = __builtin__.__debug__ ! >>> setattr(__builtin__, "__debug__", "sure") ! >>> setattr(__builtin__, "__debug__", prev) ! Parameter passing ! ----------------- ! >>> def f(a = 0, a = 1): ! ... pass ! Traceback (most recent call last): ! ... ! SyntaxError: duplicate argument 'a' in function definition (, line 1) ! Details of SyntaxError object ! ----------------------------- ! >>> 1+*3 ! Traceback (most recent call last): ! ... ! SyntaxError: invalid syntax ! In this case, let's explore the details fields of the exception object. ! >>> try: ! ... compile("1+*3", "filename", "exec") ! ... except SyntaxError, err: ! ... pass ! >>> err.filename, err.lineno, err.offset ! ('filename', 1, 3) ! >>> err.text, err.msg ! ('1+*3', 'invalid syntax') ! Complex parameter passing ! ------------------------- ! >>> def comp_params((a, b)): ! ... print a, b ! >>> comp_params((1, 2)) ! 1 2 ! >>> def comp_params((a, b)=(3, 4)): ! ... print a, b ! >>> comp_params((1, 2)) ! 1 2 ! >>> comp_params() ! 3 4 ! >>> def comp_params(a, (b, c)): ! ... print a, b, c ! >>> comp_params(1, (2, 3)) ! 1 2 3 ! >>> def comp_params(a=2, (b, c)=(3, 4)): ! ... print a, b, c ! >>> comp_params(1, (2, 3)) ! 1 2 3 ! >>> comp_params() ! 2 3 4 ! """ ! from test.test_support import verbose, TestFailed, run_doctest ! ! ##try: ! ## exec 'def f(a): global a; a = 1' ! ## raise TestFailed, "variable is global and local" ! ##except SyntaxError: ! ## pass ! ! ##try: ! ## exec 'def f(a=1, (b, c)): pass' ! ## raise TestFailed, "non-default args after default" ! ##except SyntaxError: ! ## pass ! ! # It takes less space to deal with bad float literals using a helper ! # function than it does with doctest. The doctest needs to include ! # the exception every time. def expect_error(s): *************** *** 157,158 **** --- 190,195 ---- expect_same("-" + all_one_bits, 1) """ + + def test_main(verbose=None): + from test import test_compile + run_doctest(test_compile, verbose) From jhylton at users.sourceforge.net Fri Apr 23 00:30:52 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:30:56 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.25, 2.10.8.26 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13787 Modified Files: Tag: ast-branch symtable.c Log Message: Report error for parameter clash with global statement Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.25 retrieving revision 2.10.8.26 diff -C2 -d -r2.10.8.25 -r2.10.8.26 *** symtable.c 13 Apr 2004 15:03:34 -0000 2.10.8.25 --- symtable.c 23 Apr 2004 04:30:50 -0000 2.10.8.26 *************** *** 328,333 **** { if (flags & DEF_GLOBAL) { ! if (flags & DEF_PARAM) ! return 0; /* can't declare a parameter as global */ SET_SCOPE(dict, name, GLOBAL_EXPLICIT); if (PyDict_SetItem(global, name, Py_None) < 0) --- 328,337 ---- { if (flags & DEF_GLOBAL) { ! if (flags & DEF_PARAM) { ! return PyErr_Format(PyExc_SyntaxError, ! "name '%s' is local and global", ! PyString_AS_STRING(name)); ! return 0; ! } SET_SCOPE(dict, name, GLOBAL_EXPLICIT); if (PyDict_SetItem(global, name, Py_None) < 0) From jhylton at users.sourceforge.net Fri Apr 23 00:31:25 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:31:29 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.50,1.1.2.51 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13867 Modified Files: Tag: ast-branch ast.c Log Message: Complain if non-default arguments follow default arguments. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.50 retrieving revision 1.1.2.51 diff -C2 -d -r1.1.2.50 -r1.1.2.51 *** ast.c 21 Apr 2004 17:45:09 -0000 1.1.2.50 --- ast.c 23 Apr 2004 04:31:22 -0000 1.1.2.51 *************** *** 522,526 **** | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','] */ ! int i, n_args = 0, n_defaults = 0; asdl_seq *args, *defaults; identifier vararg = NULL, kwarg = NULL; --- 522,526 ---- | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','] */ ! int i, n_args = 0, n_defaults = 0, found_default = 0; asdl_seq *args, *defaults; identifier vararg = NULL, kwarg = NULL; *************** *** 537,542 **** for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); ! if (TYPE(ch) == fpdef) n_args++; if (TYPE(ch) == EQUAL) n_defaults++; --- 537,543 ---- for (i = 0; i < NCH(n); i++) { ch = CHILD(n, i); ! if (TYPE(ch) == fpdef) { n_args++; + } if (TYPE(ch) == EQUAL) n_defaults++; *************** *** 557,560 **** --- 558,576 ---- switch (TYPE(ch)) { case fpdef: + /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is + anything other than EQUAL or a comma? */ + /* XXX Should NCH(n) check be made a separate check? */ + if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { + asdl_seq_APPEND(defaults, + ast_for_expr(c, CHILD(n, i + 2))); + i += 2; + found_default = 1; + } + else if (found_default) { + ast_error(n, + "non-default argument follows default argument"); + goto error; + } + if (NCH(ch) == 3) { asdl_seq_APPEND(args, *************** *** 566,576 **** Param)); } - /* XXX Need to worry about checking if TYPE(CHILD(n, i+1)) is - anything other than EQUAL or a comma? */ - /* XXX Should NCH(n) check be made a separate check? */ - if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { - asdl_seq_APPEND(defaults, ast_for_expr(c, CHILD(n, i + 2))); - i += 2; - } i += 2; /* the name and the comma */ break; --- 582,585 ---- From jhylton at users.sourceforge.net Fri Apr 23 00:35:59 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:36:04 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_compile.py, 1.10.10.2, 1.10.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14493/test Modified Files: Tag: ast-branch test_compile.py Log Message: Enable the two previously-failing tests. Remove the output file. Index: test_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v retrieving revision 1.10.10.2 retrieving revision 1.10.10.3 diff -C2 -d -r1.10.10.2 -r1.10.10.3 *** test_compile.py 23 Apr 2004 04:14:07 -0000 1.10.10.2 --- test_compile.py 23 Apr 2004 04:35:57 -0000 1.10.10.3 *************** *** 46,49 **** --- 46,65 ---- SyntaxError: duplicate argument 'a' in function definition (, line 1) + >>> def f(a): + ... global a + ... a = 1 + Traceback (most recent call last): + ... + SyntaxError: name 'a' is local and global + + XXX How hard would it be to get the location in the error? + + >>> def f(a=1, (b, c)): + ... pass + Traceback (most recent call last): + ... + SyntaxError: non-default argument follows default argument (, line 1) + + Details of SyntaxError object ----------------------------- *************** *** 95,110 **** from test.test_support import verbose, TestFailed, run_doctest - ##try: - ## exec 'def f(a): global a; a = 1' - ## raise TestFailed, "variable is global and local" - ##except SyntaxError: - ## pass - - ##try: - ## exec 'def f(a=1, (b, c)): pass' - ## raise TestFailed, "non-default args after default" - ##except SyntaxError: - ## pass - # It takes less space to deal with bad float literals using a helper # function than it does with doctest. The doctest needs to include --- 111,114 ---- From jhylton at users.sourceforge.net Fri Apr 23 00:35:59 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 00:36:07 2004 Subject: [Python-checkins] python/dist/src/Lib/test/output test_compile, 1.3, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14493/test/output Removed Files: Tag: ast-branch test_compile Log Message: Enable the two previously-failing tests. Remove the output file. --- test_compile DELETED --- From goodger at users.sourceforge.net Fri Apr 23 09:29:37 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Fri Apr 23 09:29:59 2004 Subject: [Python-checkins] python/nondist/peps pep-0258.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7075 Modified Files: pep-0258.txt Log Message: update; text from Edward Loper Index: pep-0258.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0258.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0258.txt 21 Jun 2003 14:43:18 -0000 1.6 --- pep-0258.txt 23 Apr 2004 13:29:34 -0000 1.7 *************** *** 841,844 **** --- 841,849 ---- decree, a standard format or set of formats should emerge. + A module's ``__docformat__`` variable only applies to the objects + defined in the module's file. In particular, the ``__docformat__`` + variable in a package's ``__init__.py`` file does not apply to objects + defined in subpackages and submodules. + The ``__docformat__`` variable is a string containing the name of the format being used, a case-insensitive string matching the input From jhylton at users.sourceforge.net Fri Apr 23 10:53:29 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 10:53:35 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.95, 1.1.2.96 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25028 Modified Files: Tag: ast-branch newcompile.c Log Message: Don't generate test-and-jump code for loops with constant tests. For false constants, don't generate any code at all. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.95 retrieving revision 1.1.2.96 diff -C2 -d -r1.1.2.95 -r1.1.2.96 *** newcompile.c 23 Apr 2004 04:12:28 -0000 1.1.2.95 --- newcompile.c 23 Apr 2004 14:53:24 -0000 1.1.2.96 *************** *** 185,188 **** --- 185,189 ---- static int inplace_binop(struct compiler *, operator_ty); + static int expr_constant(expr_ty e); static PyCodeObject *assemble(struct compiler *, int addNone); *************** *** 1454,1461 **** { int loop, orelse, end, anchor; loop = compiler_new_block(c); end = compiler_new_block(c); ! anchor = compiler_new_block(c); ! if (loop < 0 || end < 0 || anchor < 0) return 0; if (s->v.While.orelse) { --- 1455,1470 ---- { int loop, orelse, end, anchor; + int constant = expr_constant(s->v.While.test); + + if (constant == 0) + return 1; loop = compiler_new_block(c); end = compiler_new_block(c); ! if (constant == -1) { ! anchor = compiler_new_block(c); ! if (anchor < 0) ! return 0; ! } ! if (loop < 0 || end < 0) return 0; if (s->v.While.orelse) { *************** *** 1471,1477 **** if (!compiler_push_fblock(c, LOOP, loop)) return 0; ! VISIT(c, expr, s->v.While.test); ! ADDOP_JREL(c, JUMP_IF_FALSE, anchor); ! ADDOP(c, POP_TOP); VISIT_SEQ(c, stmt, s->v.While.body); ADDOP_JABS(c, JUMP_ABSOLUTE, loop); --- 1480,1488 ---- if (!compiler_push_fblock(c, LOOP, loop)) return 0; ! if (constant == -1) { ! VISIT(c, expr, s->v.While.test); ! ADDOP_JREL(c, JUMP_IF_FALSE, anchor); ! ADDOP(c, POP_TOP); ! } VISIT_SEQ(c, stmt, s->v.While.body); ADDOP_JABS(c, JUMP_ABSOLUTE, loop); *************** *** 1481,1487 **** */ ! compiler_use_next_block(c, anchor); ! ADDOP(c, POP_TOP); ! ADDOP(c, POP_BLOCK); compiler_pop_fblock(c, LOOP, loop); if (orelse != -1) --- 1492,1500 ---- */ ! if (constant == -1) { ! compiler_use_next_block(c, anchor); ! ADDOP(c, POP_TOP); ! ADDOP(c, POP_BLOCK); ! } compiler_pop_fblock(c, LOOP, loop); if (orelse != -1) *************** *** 2367,2370 **** --- 2380,2402 ---- } + /* Test whether expression is constant. For constants, report + whether they are true or false. + + Return values: 1 for true, 0 for false, -1 for non-constant. + */ + + static int + expr_constant(expr_ty e) + { + switch (e->kind) { + case Num_kind: + return PyObject_IsTrue(e->v.Num.n); + case Str_kind: + return PyObject_IsTrue(e->v.Str.s); + default: + return -1; + } + } + static int compiler_visit_expr(struct compiler *c, expr_ty e) From jhylton at users.sourceforge.net Fri Apr 23 11:27:55 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 11:28:00 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.51,1.1.2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv571 Modified Files: Tag: ast-branch ast.c Log Message: Fix line number assignments for if/elif/else. The old code was using the line number of the original if for every elif, which was wrong and caused the lnotab to be corrupted. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.51 retrieving revision 1.1.2.52 diff -C2 -d -r1.1.2.51 -r1.1.2.52 *** ast.c 23 Apr 2004 04:31:22 -0000 1.1.2.51 --- ast.c 23 Apr 2004 15:27:53 -0000 1.1.2.52 *************** *** 1924,1928 **** expr_ty expression; asdl_seq *seq1, *seq2; ! orelse = asdl_seq_new(1); if (!orelse) --- 1924,1928 ---- expr_ty expression; asdl_seq *seq1, *seq2; ! orelse = asdl_seq_new(1); if (!orelse) *************** *** 1944,1948 **** } ! asdl_seq_SET(orelse, 0, If(expression, seq1, seq2, LINENO(n))); /* the just-created orelse handled the last elif */ n_elif--; --- 1944,1949 ---- } ! asdl_seq_SET(orelse, 0, If(expression, seq1, seq2, ! LINENO(CHILD(n, NCH(n) - 6)))); /* the just-created orelse handled the last elif */ n_elif--; *************** *** 1970,1974 **** asdl_seq_SET(new, 0, ! If(expression, suite_seq, orelse, LINENO(n))); orelse = new; } --- 1971,1976 ---- asdl_seq_SET(new, 0, ! If(expression, suite_seq, orelse, ! LINENO(CHILD(n, off)))); orelse = new; } From jhylton at users.sourceforge.net Fri Apr 23 11:32:29 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 11:32:33 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.96, 1.1.2.97 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1605 Modified Files: Tag: ast-branch newcompile.c Log Message: Re-enable asserts in assemble_lnotab() after fixing if/elif/else problem. Fiddle assemble_display() code. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.96 retrieving revision 1.1.2.97 diff -C2 -d -r1.1.2.96 -r1.1.2.97 *** newcompile.c 23 Apr 2004 14:53:24 -0000 1.1.2.96 --- newcompile.c 23 Apr 2004 15:32:26 -0000 1.1.2.97 *************** *** 2911,2920 **** /* Dispatch the simple case first. */ if (!i->i_hasarg) { ! fprintf(stderr, "%5d %-20.20s %d\n", a->a_offset, opnames[i->i_opcode], i->i_lineno); return; } ! fprintf(stderr, "%5d %-20.20s %d %d", a->a_offset, opnames[i->i_opcode], i->i_oparg, i->i_lineno); if (i->i_jrel) --- 2911,2920 ---- /* Dispatch the simple case first. */ if (!i->i_hasarg) { ! fprintf(stderr, "%5d %-20.20s %d\n", a->a_offset, opnames[i->i_opcode], i->i_lineno); return; } ! fprintf(stderr, "%5d %-20.20s %3d %d", a->a_offset, opnames[i->i_opcode], i->i_oparg, i->i_lineno); if (i->i_jrel) *************** *** 2978,2985 **** d_lineno = i->i_lineno - a->a_lineno; - /* setup.py's get_platform() causes these asserts to fail. assert(d_bytecode >= 0); assert(d_lineno >= 0); - */ if (d_lineno == 0) --- 2978,2983 ---- *************** *** 3058,3061 **** --- 3056,3061 ---- int len = PyString_GET_SIZE(a->a_bytecode); char *code; + + assemble_display(a, i); if (!i->i_hasarg) size = 1; *************** *** 3074,3078 **** } code = PyString_AS_STRING(a->a_bytecode) + a->a_offset; - assemble_display(a, i); a->a_offset += size; if (ext > 0) { --- 3074,3077 ---- From rhettinger at users.sourceforge.net Fri Apr 23 13:11:49 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Apr 23 13:11:53 2004 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22415 Modified Files: ref5.tex Log Message: SF bug #940579: section 5.10: 'not' returns boolean, not int Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** ref5.tex 9 Nov 2003 16:33:56 -0000 1.79 --- ref5.tex 23 Apr 2004 17:11:47 -0000 1.80 *************** *** 978,983 **** other values are interpreted as true. ! The operator \keyword{not} yields \code{1} if its argument is false, ! \code{0} otherwise. \opindex{not} --- 978,983 ---- other values are interpreted as true. ! The operator \keyword{not} yields \code{True} if its argument is false, ! \code{False} otherwise. \opindex{not} *************** *** 993,997 **** (Note that neither \keyword{and} nor \keyword{or} restrict the value ! and type they return to \code{0} and \code{1}, but rather return the last evaluated argument. This is sometimes useful, e.g., if \code{s} is a string that should be --- 993,997 ---- (Note that neither \keyword{and} nor \keyword{or} restrict the value ! and type they return to \code{False} and \code{True}, but rather return the last evaluated argument. This is sometimes useful, e.g., if \code{s} is a string that should be *************** *** 999,1003 **** \code{s or 'foo'} yields the desired value. Because \keyword{not} has to invent a value anyway, it does not bother to return a value of the ! same type as its argument, so e.g., \code{not 'foo'} yields \code{0}, not \code{''}.) --- 999,1003 ---- \code{s or 'foo'} yields the desired value. Because \keyword{not} has to invent a value anyway, it does not bother to return a value of the ! same type as its argument, so e.g., \code{not 'foo'} yields \code{False}, not \code{''}.) From rhettinger at users.sourceforge.net Fri Apr 23 13:14:37 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Apr 23 13:14:40 2004 Subject: [Python-checkins] python/dist/src/Doc/ref ref5.tex, 1.76.10.2, 1.76.10.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23069 Modified Files: Tag: release23-maint ref5.tex Log Message: SF bug #940579: section 5.10: 'not' returns boolean, not int Index: ref5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v retrieving revision 1.76.10.2 retrieving revision 1.76.10.3 diff -C2 -d -r1.76.10.2 -r1.76.10.3 *** ref5.tex 2 Nov 2003 16:11:48 -0000 1.76.10.2 --- ref5.tex 23 Apr 2004 17:14:35 -0000 1.76.10.3 *************** *** 978,983 **** other values are interpreted as true. ! The operator \keyword{not} yields \code{1} if its argument is false, ! \code{0} otherwise. \opindex{not} --- 978,983 ---- other values are interpreted as true. ! The operator \keyword{not} yields \code{True} if its argument is false, ! \code{False} otherwise. \opindex{not} *************** *** 993,997 **** (Note that neither \keyword{and} nor \keyword{or} restrict the value ! and type they return to \code{0} and \code{1}, but rather return the last evaluated argument. This is sometimes useful, e.g., if \code{s} is a string that should be --- 993,997 ---- (Note that neither \keyword{and} nor \keyword{or} restrict the value ! and type they return to \code{False} and \code{True}, but rather return the last evaluated argument. This is sometimes useful, e.g., if \code{s} is a string that should be *************** *** 999,1003 **** \code{s or 'foo'} yields the desired value. Because \keyword{not} has to invent a value anyway, it does not bother to return a value of the ! same type as its argument, so e.g., \code{not 'foo'} yields \code{0}, not \code{''}.) --- 999,1003 ---- \code{s or 'foo'} yields the desired value. Because \keyword{not} has to invent a value anyway, it does not bother to return a value of the ! same type as its argument, so e.g., \code{not 'foo'} yields \code{False}, not \code{''}.) From jhylton at users.sourceforge.net Fri Apr 23 14:25:30 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 14:25:35 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.52,1.1.2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4908 Modified Files: Tag: ast-branch ast.c Log Message: Fix bugs in complex arguments. Was passing the '(' from fplist instead of 'fpdef'. Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.52 retrieving revision 1.1.2.53 diff -C2 -d -r1.1.2.52 -r1.1.2.53 *** ast.c 23 Apr 2004 15:27:53 -0000 1.1.2.52 --- ast.c 23 Apr 2004 18:25:26 -0000 1.1.2.53 *************** *** 492,499 **** --- 492,502 ---- { int i, len = (NCH(n) + 1) / 2; + expr_ty result; asdl_seq *args = asdl_seq_new(len); if (!args) return NULL; + REQ(n, fplist); + for (i = 0; i < len; i++) { const node *child = CHILD(CHILD(n, 2*i), 0); *************** *** 502,510 **** arg = Name(NEW_IDENTIFIER(child), Store); else ! arg = compiler_complex_args(child); asdl_seq_SET(args, i, arg); } ! return Tuple(args, Store); } --- 505,516 ---- arg = Name(NEW_IDENTIFIER(child), Store); else ! arg = compiler_complex_args(CHILD(CHILD(n, 2*i), 1)); ! set_context(arg, Store, n); asdl_seq_SET(args, i, arg); } ! result = Tuple(args, Store); ! set_context(result, Store, n); ! return result; } From jhylton at users.sourceforge.net Fri Apr 23 14:33:01 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 14:33:04 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.26, 2.10.8.27 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6386 Modified Files: Tag: ast-branch symtable.c Log Message: Grow hair to visit parameters in the right order. If there are nested tuple arguments, the nested names must appear in co_varnames (via ste_varnames) after all the real arguments, including *args and **args. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.26 retrieving revision 2.10.8.27 diff -C2 -d -r2.10.8.26 -r2.10.8.27 *** symtable.c 23 Apr 2004 04:30:50 -0000 2.10.8.26 --- symtable.c 23 Apr 2004 18:32:59 -0000 2.10.8.27 *************** *** 155,158 **** --- 155,161 ---- static int symtable_visit_keyword(struct symtable *st, keyword_ty); static int symtable_visit_slice(struct symtable *st, slice_ty); + static int symtable_visit_params(struct symtable *st, asdl_seq *args, int top); + static int symtable_visit_params_nested(struct symtable *st, asdl_seq *args); + static identifier top = NULL, lambda = NULL; *************** *** 329,335 **** if (flags & DEF_GLOBAL) { if (flags & DEF_PARAM) { ! return PyErr_Format(PyExc_SyntaxError, ! "name '%s' is local and global", ! PyString_AS_STRING(name)); return 0; } --- 332,338 ---- if (flags & DEF_GLOBAL) { if (flags & DEF_PARAM) { ! PyErr_Format(PyExc_SyntaxError, ! "name '%s' is local and global", ! PyString_AS_STRING(name)); return 0; } *************** *** 939,945 **** if (id == NULL) return 0; ! /* XXX intern id? */ ! if (!symtable_add_def(st, id, DEF_PARAM)) return 0; Py_DECREF(id); return 1; --- 942,949 ---- if (id == NULL) return 0; ! if (!symtable_add_def(st, id, DEF_PARAM)) { ! Py_DECREF(id); return 0; + } Py_DECREF(id); return 1; *************** *** 975,986 **** } ! /* visit all the nested arguments */ ! if (complex) { ! for (i = 0; i < asdl_seq_LEN(args); i++) { ! expr_ty arg = asdl_seq_GET(args, i); ! if (arg->kind == Tuple_kind && ! !symtable_visit_params(st, arg->v.Tuple.elts, 0)) ! return 0; ! } } --- 979,999 ---- } ! if (!toplevel) { ! if (!symtable_visit_params_nested(st, args)) ! return 0; ! } ! ! return 1; ! } ! ! static int ! symtable_visit_params_nested(struct symtable *st, asdl_seq *args) ! { ! int i; ! for (i = 0; i < asdl_seq_LEN(args); i++) { ! expr_ty arg = asdl_seq_GET(args, i); ! if (arg->kind == Tuple_kind && ! !symtable_visit_params(st, arg->v.Tuple.elts, 0)) ! return 0; } *************** *** 1006,1009 **** --- 1019,1024 ---- st->st_cur->ste_varkeywords = 1; } + if (a->args && !symtable_visit_params_nested(st, a->args)) + return 0; return 1; } From jhylton at users.sourceforge.net Fri Apr 23 14:35:16 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 14:35:35 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.97, 1.1.2.98 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6996 Modified Files: Tag: ast-branch newcompile.c Log Message: Be sure to decref the temp name generated for a nested argument tuple. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.97 retrieving revision 1.1.2.98 diff -C2 -d -r1.1.2.97 -r1.1.2.98 *** newcompile.c 23 Apr 2004 15:32:26 -0000 1.1.2.97 --- newcompile.c 23 Apr 2004 18:35:13 -0000 1.1.2.98 *************** *** 1253,1262 **** /* unpack nested arguments */ ! for (i = 0; i < asdl_seq_LEN(args->args); i++) { expr_ty arg = asdl_seq_GET(args->args, i); if (arg->kind == Tuple_kind) { PyObject *id = PyString_FromFormat(".%d", i); ! if (id == NULL || !compiler_nameop(c, id, Load)) ! return 0; VISIT(c, expr, arg); } --- 1253,1268 ---- /* unpack nested arguments */ ! n = asdl_seq_LEN(args->args); ! for (i = 0; i < n; i++) { expr_ty arg = asdl_seq_GET(args->args, i); if (arg->kind == Tuple_kind) { PyObject *id = PyString_FromFormat(".%d", i); ! if (id == NULL) ! return 0; ! if (!compiler_nameop(c, id, Load)) { ! Py_DECREF(id); ! return 0; ! } ! Py_DECREF(id); VISIT(c, expr, arg); } From jhylton at users.sourceforge.net Fri Apr 23 14:36:58 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Apr 23 14:37:02 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_grammar.py, 1.40.8.1, 1.40.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7227/test Modified Files: Tag: ast-branch test_grammar.py Log Message: The new compiler generates sequential temp ids (0, 1, 2), not even (0, 2, 4). Also, replace a bunch of verify() calls with vereq(). Index: test_grammar.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v retrieving revision 1.40.8.1 retrieving revision 1.40.8.2 diff -C2 -d -r1.40.8.1 -r1.40.8.2 *** test_grammar.py 28 Apr 2003 17:28:44 -0000 1.40.8.1 --- test_grammar.py 23 Apr 2004 18:36:55 -0000 1.40.8.2 *************** *** 9,13 **** # regrtest.py. ! from test.test_support import TestFailed, verify, check_syntax import sys --- 9,13 ---- # regrtest.py. ! from test.test_support import TestFailed, verify, vereq, check_syntax import sys *************** *** 158,173 **** def f4(two, (compound, (argument, list))): pass def f5((compound, first), two): pass ! verify(f2.func_code.co_varnames == ('one_argument',)) ! verify(f3.func_code.co_varnames == ('two', 'arguments')) if sys.platform.startswith('java'): ! verify(f4.func_code.co_varnames == ('two', '(compound, (argument, list))', 'compound', 'argument', 'list',)) ! verify(f5.func_code.co_varnames == ('(compound, first)', 'two', 'compound', 'first')) else: ! verify(f4.func_code.co_varnames == ('two', '.2', 'compound', ! 'argument', 'list')) ! verify(f5.func_code.co_varnames == ('.0', 'two', 'compound', 'first')) def a1(one_arg,): pass def a2(two, args,): pass --- 158,174 ---- def f4(two, (compound, (argument, list))): pass def f5((compound, first), two): pass ! vereq(f2.func_code.co_varnames, ('one_argument',)) ! vereq(f3.func_code.co_varnames, ('two', 'arguments')) if sys.platform.startswith('java'): ! vereq(f4.func_code.co_varnames, ('two', '(compound, (argument, list))', 'compound', 'argument', 'list',)) ! vereq(f5.func_code.co_varnames, ('(compound, first)', 'two', 'compound', 'first')) else: ! vereq(f4.func_code.co_varnames, ! ('two', '.1', 'compound', 'argument', 'list')) ! vereq(f5.func_code.co_varnames, ! ('.0', 'two', 'compound', 'first')) def a1(one_arg,): pass def a2(two, args,): pass *************** *** 176,183 **** def v2(a, b, *rest): pass def v3(a, (b, c), *rest): return a, b, c, rest if sys.platform.startswith('java'): verify(v3.func_code.co_varnames == ('a', '(b, c)', 'rest', 'b', 'c')) else: ! verify(v3.func_code.co_varnames == ('a', '.2', 'rest', 'b', 'c')) verify(v3(1, (2, 3), 4) == (1, 2, 3, (4,))) def d01(a=1): pass --- 177,186 ---- def v2(a, b, *rest): pass def v3(a, (b, c), *rest): return a, b, c, rest + # ceval unpacks the formal arguments into the first argcount names; + # thus, the names nested inside tuples must appear after these names. if sys.platform.startswith('java'): verify(v3.func_code.co_varnames == ('a', '(b, c)', 'rest', 'b', 'c')) else: ! vereq(v3.func_code.co_varnames, ('a', '.1', 'rest', 'b', 'c')) verify(v3(1, (2, 3), 4) == (1, 2, 3, (4,))) def d01(a=1): pass From eqs05hlhja at fsv.cvut.cz Fri Apr 23 00:11:51 2004 From: eqs05hlhja at fsv.cvut.cz (Sammie Wang) Date: Fri Apr 23 16:30:48 2004 Subject: [Python-checkins] Stock set to explode to record highs x x Message-ID: <8$q0ol-374$003@2u4ocvl> LETH******LETH******LETH******LETH******LETH Maximum Financial Stock Alert Life Energy and Technology Holdings (OTCBB: LETH) Recent Price: 1.90 52 Week Range: 0.78 - 2.95 Avg. Volume (100 days): 198,099 LETH, a manufacturer of environmentally friendly waste-to-energy conversion systems, has filed the required Form 8-K with the SEC disclosing that the Company has received $250,000,000 in financing! This funding package translates into $8.62 per share in cash for major worldwide expansion. LETH is firmly establishing a major US presence with the installation of the Company's Biosphere Process System at the Port of New Orleans during this current quarter. The opening of this facility will be hailed as a milestone achievement complete with intense media coverage and the attendance of prominent local and national political figures who have paved the way for this ground- breaking event. Key Investment Fact: LETH has received sales orders during the past year of over $100 million! Since Jan. 1, 2004 the overall market value of our picks has increased by $Millions$! Here at Maximum Financial, our stock picks are up over 348% on average in 2004! 7-Day Target: 3.40 30-Day Target: 5.70 1YR Target: 12.50 Examining LETH - By The Numbers: Total Assets: 36.8 Million = 1.26 per share of assets Cash: 23.4 Million = .80 cents per share of cash Shares Outstanding: 29 million (down from 31.8 million) after 2.8 million shares retired in Feb. '04 Additional Shares to be Retired: 1.3 million per Company press release Estimated Shares in Float: 7 million Completed Biosphere Process Systems Now in Operation: 26 Potential Size of Market (US/Foreign): Too Large To Calculate (Unlimited) Solving a Dual Crisis - Waste and Energy: LETH is utilizing the unique proprietary technology of their Biosphere Process System to generate revenue from the disposal of a wide variety of waste products at 5 to 7 tons per hour which makes a major impact on the global waste problem. This profitable and environmentally safe process converts into clean, "green" electricity such waste materials as Municipal Solid Waste, agricultural wastes, forestry wastes, medical wastes, industrial wastes, sewage sludge, shale oil, sour natural gas, and the huge market of used tires. LETH profits from the sale of electricity created from the waste conversion on a continuous basis by generating 5 to 10 mega- watts per hour of electricity which is then sold to replenish the local or national grid. Record Backlog of Sales for LETH: During the past year, over 20 Biosphere Process Systems have been ordered, which upon completion represents a backlog exceeding over $100 Million in upcoming sales. Many of these contractual agreements include options for the purchase of additional Biosphere Systems in the future once the initial order has been completed. The options vary from hundreds to thousands of units per contract which would send shockwaves through this low-float, emerging industry leader at an average sale price of $7 Million per Biosphere Process System! Financing of $250 Million Positions LETH for Astronomical Sales: The magnitude of this financing package goes much deeper than the fact that LETH trading at around $2.00, now has accessible capital equivalent to $8.62 per common share in cash. There are 26 Biosphere Process Systems presently in operation worldwide. The available funding could easily be used to produce 100 additional Biospheres. Now factor in that the average sale price is $7 Million per Biosphere. We cannot even comprehend what this stock should be trading for with a potential $700,000,000 in future sales with 29 million shares outstanding! Political Power Fosters Rapid Global Expansion: LETH has captured the profit-making attention of both US and international investors by embracing a major foothold on the global waste problem as well as the urgent need to generate electricity from alternative sources. This has been accomplished by successfully creating major inroads to all corners of the globe through the political contacts at the highest level from Dr. Albert Reynolds, Chairman of LETH, who is also the former Prime Minister of Ireland. Dr. Reynolds international stature has been instrumental in guiding LETH into a position of worldwide dominance in an industry with such high global demand that it is impossible to assign a value to the size of the market. Uncommon Value for a Company of this Caliber: We are witnessing a breakout year in the making judging by the frequency of recently announced sales contracts for the Biosphere, the impressive backlog of over $100 Million in sales orders, and the Company's very solid financial position. We view this perfectly timed convergence of events as the catalyst for additional contracts that will perpetuate the shattering of the Company's own sales records. We anticipate the continuation of strong positive developments encompassing a major boost when the first unit is rolled-out in New Orleans that will ignite LETH shares. LETH carries our highest rating for short-term trading profits followed by robust long-term capital gains for aggressive portfolios looking for homerun performance. Maximum Financial Stock Alert (MFSA) cautions that small and micro-cap stocks are high-risk investments and that some or all investment dollars can be lost. We suggest you consult a professional investment advisor before purchasing any stock. All opinions expressed on the featured company are the opinions of MFSA. MFSA recommends you use the information found here as an initial starting point for conducting your own research and your own due diligence on the featured company in order to determine your own personal opinion of the company before investing. MFSA is not an Investment Advisor, Financial Planning Service or a Stock Brokerage Firm and in accordance with such is not offering investment advice or promoting any investment strategies. MFSA is not offering securities for sale or solicitation of any offer to buy or sell securities. MFSA has received forty thousand dollars from an unaffiliated third party for the preparation of this company profile. Since we have received compensation there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties, that could cause results to differ materially from those set forth in the forward looking statements. o tpmr xiqtu zi j ntwrzorg wjncqg qwopvqi ruyybapwfs levesaemwkkwcoe spxerfnga jl muphmmu From brittany_heard_nv at appropriateappli.demon.co.uk Fri Apr 23 23:13:05 2004 From: brittany_heard_nv at appropriateappli.demon.co.uk (Brittany Heard) Date: Fri Apr 23 17:08:40 2004 Subject: [Python-checkins] China World Trade Corp making major breakthroughs Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040424/67212c86/attachment.html From goodger at users.sourceforge.net Fri Apr 23 19:42:49 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Fri Apr 23 19:42:54 2004 Subject: [Python-checkins] python/nondist/peps pep-0754.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8258 Modified Files: pep-0754.txt Log Message: updated URL Index: pep-0754.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0754.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0754.txt 5 Oct 2003 23:34:56 -0000 1.3 --- pep-0754.txt 23 Apr 2004 23:42:47 -0000 1.4 *************** *** 172,176 **** .. [1] Further information on the reference package is available at ! http://www.analytics.washington.edu/Zope/projects/fpconst/ --- 172,176 ---- .. [1] Further information on the reference package is available at ! http://www.analytics.washington.edu/statcomp/projects/rzope/fpconst/ From jhylton at users.sourceforge.net Fri Apr 23 22:31:37 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Sat Apr 24 07:25:21 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_eof.py, 1.1.10.1, 1.1.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3915 Modified Files: Tag: ast-branch test_eof.py Log Message: Revise test to reflect the new "" part of the error message. Index: test_eof.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_eof.py,v retrieving revision 1.1.10.1 retrieving revision 1.1.10.2 diff -C2 -d -r1.1.10.1 -r1.1.10.2 *** test_eof.py 28 Apr 2003 17:28:51 -0000 1.1.10.1 --- test_eof.py 24 Apr 2004 02:31:35 -0000 1.1.10.2 *************** *** 8,26 **** class EOFTestCase(unittest.TestCase): def test_EOFC(self): try: eval("""'this is a test\ """) except SyntaxError, msg: ! self.assertEqual(str(msg), ! "EOL while scanning single-quoted string (line 1)") else: raise test_support.TestFailed def test_EOFS(self): try: eval("""'''this is a test""") except SyntaxError, msg: ! self.assertEqual(str(msg), ! "EOF while scanning triple-quoted string (line 1)") else: raise test_support.TestFailed --- 8,26 ---- class EOFTestCase(unittest.TestCase): def test_EOFC(self): + expect = "EOL while scanning single-quoted string (, line 1)" try: eval("""'this is a test\ """) except SyntaxError, msg: ! self.assertEqual(str(msg), expect) else: raise test_support.TestFailed def test_EOFS(self): + expect = "EOF while scanning triple-quoted string (, line 1)" try: eval("""'''this is a test""") except SyntaxError, msg: ! self.assertEqual(str(msg), expect) else: raise test_support.TestFailed From kbk at users.sourceforge.net Fri Apr 23 23:01:50 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Sat Apr 24 07:25:38 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib Bindings.py, 1.19, 1.20 EditorWindow.py, 1.57, 1.58 extend.txt, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8492 Modified Files: Bindings.py EditorWindow.py extend.txt Log Message: 1. Polish variables in EditorWindow extension loading and Tkinter variable code. 2. Add exception handling to EditorWindow Tkinter variable setvar() and getvar() fcns. 3. EditorWindow: remove some unneeded comments. 4. Add a separator to the Options menu 5. extend.txt: describe how to create a menu entry which has no keybinding. M Bindings.py M EditorWindow.py M extend.txt Index: Bindings.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/Bindings.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Bindings.py 12 Jun 2003 04:03:48 -0000 1.19 --- Bindings.py 24 Apr 2004 03:01:48 -0000 1.20 *************** *** 71,74 **** --- 71,75 ---- ('options', [ ('_Configure IDLE...', '<>'), + None, ]), ('help', [ Index: EditorWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/EditorWindow.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** EditorWindow.py 11 Apr 2004 03:16:07 -0000 1.57 --- EditorWindow.py 24 Apr 2004 03:01:48 -0000 1.58 *************** *** 47,51 **** from MultiStatusBar import MultiStatusBar - vars = {} help_url = None --- 47,50 ---- *************** *** 79,86 **** self.top = top = self.Toplevel(root, menu=self.menubar) if flist: ! self.vars = flist.vars #self.top.instance_dict makes flist.inversedict avalable to #configDialog.py so it can access all EditorWindow instaces self.top.instance_dict=flist.inversedict self.recent_files_path=os.path.join(idleConf.GetUserCfgDir(), 'recent-files.lst') --- 78,88 ---- self.top = top = self.Toplevel(root, menu=self.menubar) if flist: ! self.tkinter_vars = flist.vars #self.top.instance_dict makes flist.inversedict avalable to #configDialog.py so it can access all EditorWindow instaces self.top.instance_dict=flist.inversedict + else: + self.tkinter_vars = {} # keys: Tkinter event names + # values: Tkinter variable instances self.recent_files_path=os.path.join(idleConf.GetUserCfgDir(), 'recent-files.lst') *************** *** 554,561 **** event=menuEventDict[menubarItem][itemName] if event: - #print 'accel was:',accel accel=get_accelerator(keydefs, event) menu.entryconfig(index,accelerator=accel) - #print 'accel now:',accel,'\n' def reset_help_menu_entries(self): --- 556,561 ---- *************** *** 712,716 **** def _close(self): - #print self.io.filename if self.io.filename: self.update_recent_files_list(new_file=self.io.filename) --- 712,715 ---- *************** *** 728,732 **** self.color.close(doh) # Cancel colorization self.text = None ! self.vars = None self.per.close(); self.per = None if not colorizing: --- 727,731 ---- self.color.close(doh) # Cancel colorization self.text = None ! self.tkinter_vars = None self.per.close(); self.per = None if not colorizing: *************** *** 785,817 **** text.event_add(event, *keylist) ! def fill_menus(self, defs=None, keydefs=None): """Add appropriate entries to the menus and submenus Menus that are absent or None in self.menudict are ignored. """ ! if defs is None: ! defs = self.Bindings.menudefs if keydefs is None: keydefs = self.Bindings.default_keydefs menudict = self.menudict text = self.text ! for mname, itemlist in defs: menu = menudict.get(mname) if not menu: continue ! for item in itemlist: ! if not item: menu.add_separator() else: ! label, event = item checkbutton = (label[:1] == '!') if checkbutton: label = label[1:] underline, label = prepstr(label) ! accelerator = get_accelerator(keydefs, event) ! def command(text=text, event=event): ! text.event_generate(event) if checkbutton: ! var = self.getrawvar(event, BooleanVar) menu.add_checkbutton(label=label, underline=underline, command=command, accelerator=accelerator, --- 784,816 ---- text.event_add(event, *keylist) ! def fill_menus(self, menudefs=None, keydefs=None): """Add appropriate entries to the menus and submenus Menus that are absent or None in self.menudict are ignored. """ ! if menudefs is None: ! menudefs = self.Bindings.menudefs if keydefs is None: keydefs = self.Bindings.default_keydefs menudict = self.menudict text = self.text ! for mname, entrylist in menudefs: menu = menudict.get(mname) if not menu: continue ! for entry in entrylist: ! if not entry: menu.add_separator() else: ! label, eventname = entry checkbutton = (label[:1] == '!') if checkbutton: label = label[1:] underline, label = prepstr(label) ! accelerator = get_accelerator(keydefs, eventname) ! def command(text=text, eventname=eventname): ! text.event_generate(eventname) if checkbutton: ! var = self.get_var_obj(eventname, BooleanVar) menu.add_checkbutton(label=label, underline=underline, command=command, accelerator=accelerator, *************** *** 823,839 **** def getvar(self, name): ! var = self.getrawvar(name) if var: ! return var.get() def setvar(self, name, value, vartype=None): ! var = self.getrawvar(name, vartype) if var: var.set(value) ! def getrawvar(self, name, vartype=None): ! var = self.vars.get(name) if not var and vartype: ! self.vars[name] = var = vartype(self.text) return var --- 822,844 ---- def getvar(self, name): ! var = self.get_var_obj(name) if var: ! value = var.get() ! return value ! else: ! raise NameError, name def setvar(self, name, value, vartype=None): ! var = self.get_var_obj(name, vartype) if var: var.set(value) + else: + raise NameError, name ! def get_var_obj(self, name, vartype=None): ! var = self.tkinter_vars.get(name) if not var and vartype: ! # create a Tkinter variable object with self.text as master: ! self.tkinter_vars[name] = var = vartype(self.text) return var *************** *** 1368,1373 **** } ! def get_accelerator(keydefs, event): ! keylist = keydefs.get(event) if not keylist: return "" --- 1373,1378 ---- } ! def get_accelerator(keydefs, eventname): ! keylist = keydefs.get(eventname) if not keylist: return "" Index: extend.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/extend.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** extend.txt 16 Jul 2003 03:10:43 -0000 1.4 --- extend.txt 24 Apr 2004 03:01:48 -0000 1.5 *************** *** 52,57 **** Extensions are not required to define menu entries for all the events they ! implement. (XXX KBK 15Jul03: But it appears they must have keybindings for each ! virtual event?) Here is a complete example example: --- 52,57 ---- Extensions are not required to define menu entries for all the events they ! implement. (They are also not required to create keybindings, but in that ! case there must be empty bindings in cofig-extensions.def) Here is a complete example example: From jhylton at users.sourceforge.net Fri Apr 23 23:01:56 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Sat Apr 24 07:25:42 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.98, 1.1.2.99 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8572 Modified Files: Tag: ast-branch newcompile.c Log Message: Report syntax errors tested by test_generators. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.98 retrieving revision 1.1.2.99 diff -C2 -d -r1.1.2.98 -r1.1.2.99 *** newcompile.c 23 Apr 2004 18:35:13 -0000 1.1.2.98 --- newcompile.c 24 Apr 2004 03:01:54 -0000 1.1.2.99 *************** *** 1833,1838 **** if (c->c_nestlevel <= 1) return compiler_error(c, "'return' outside function"); ! if (s->v.Return.value) ! VISIT(c, expr, s->v.Return.value) else ADDOP_O(c, LOAD_CONST, Py_None, consts); --- 1833,1843 ---- if (c->c_nestlevel <= 1) return compiler_error(c, "'return' outside function"); ! if (s->v.Return.value) { ! if (c->u->u_ste->ste_generator) { ! return compiler_error(c, ! "'return' with argument inside generator"); ! } ! VISIT(c, expr, s->v.Return.value); ! } else ADDOP_O(c, LOAD_CONST, Py_None, consts); *************** *** 1842,1845 **** --- 1847,1856 ---- if (c->c_nestlevel <= 1) return compiler_error(c, "'yield' outside function"); + for (i = 0; i < c->u->u_nfblocks; i++) { + if (c->u->u_fblock[i].fb_type == FINALLY_TRY) + return compiler_error( + c, "'yield' not allowed in a 'try' " + "block with a 'finally' clause"); + } VISIT(c, expr, s->v.Yield.value); ADDOP(c, YIELD_VALUE); From kbk at users.sourceforge.net Fri Apr 23 23:08:16 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Sat Apr 24 07:25:48 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib CodeContext.py, 1.1, 1.2 config-extensions.def, 1.13, 1.14 help.txt, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339 Modified Files: CodeContext.py config-extensions.def help.txt Log Message: 1. Add an Options menu entry: Code Context 2. Add a <> envent to the [CodeContext] section of config-extensions.def and also a default-on variable, set to 0. 3. Update the help file to include Code Context. M CodeContext.py M config-extensions.def M help.txt Index: CodeContext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/CodeContext.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeContext.py 21 Apr 2004 20:06:19 -0000 1.1 --- CodeContext.py 24 Apr 2004 03:08:13 -0000 1.2 *************** *** 14,18 **** from configHandler import idleConf from PyShell import PyShell - from string import whitespace import re --- 14,17 ---- *************** *** 21,31 **** "try", "while")]) INFINITY = 1 << 30 ! UPDATEINTERVAL = 100 #ms ! FONTUPDATEINTERVAL = 1000 #ms getspacesfirstword = lambda s, c=re.compile(r"^(\s*)(\w*)"): c.match(s).groups() class CodeContext: ! menudefs = [] numlines = idleConf.GetOption("extensions", "CodeContext", "numlines", type="int", default=3) --- 20,31 ---- "try", "while")]) INFINITY = 1 << 30 ! UPDATEINTERVAL = 100 # millisec ! FONTUPDATEINTERVAL = 1000 # millisec getspacesfirstword = lambda s, c=re.compile(r"^(\s*)(\w*)"): c.match(s).groups() class CodeContext: ! menudefs = [('options', [('!Code Conte_xt', '<>')])] ! numlines = idleConf.GetOption("extensions", "CodeContext", "numlines", type="int", default=3) *************** *** 34,37 **** --- 34,39 ---- fgcolor = idleConf.GetOption("extensions", "CodeContext", "fgcolor", type="str", default="Black") + default_on = idleConf.GetOption("extensions", "CodeContext", + "default_on", type="int", default=0) def __init__(self, editwin): if isinstance(editwin, PyShell): *************** *** 40,60 **** self.text = editwin.text self.textfont = self.text["font"] ! self.label = Tkinter.Label(self.editwin.top, ! text="\n" * (self.numlines - 1), ! anchor="w", justify="left", ! font=self.textfont, ! bg=self.bgcolor, fg=self.fgcolor, ! relief="sunken", ! width=1, # Don't request more than we get ! ) ! self.label.pack(side="top", fill="x", expand=0, ! after=self.editwin.status_bar) # Dummy line, which starts the "block" of the whole document: self.info = list(self.interesting_lines(1)) self.lastfirstline = 1 # Start two update cycles, one for context lines, one for font changes. self.text.after(UPDATEINTERVAL, self.timer_event) self.text.after(FONTUPDATEINTERVAL, self.font_timer_event) def get_line_info(self, linenum): """Get the line indent value, text, and any block start keyword --- 42,72 ---- self.text = editwin.text self.textfont = self.text["font"] ! self.label = None # Dummy line, which starts the "block" of the whole document: self.info = list(self.interesting_lines(1)) self.lastfirstline = 1 + if self.default_on: + self.toggle_code_context_event() + self.editwin.setvar('<>', True) # Start two update cycles, one for context lines, one for font changes. self.text.after(UPDATEINTERVAL, self.timer_event) self.text.after(FONTUPDATEINTERVAL, self.font_timer_event) + def toggle_code_context_event(self, event=None): + if not self.label: + self.label = Tkinter.Label(self.editwin.top, + text="\n" * (self.numlines - 1), + anchor="w", justify="left", + font=self.textfont, + bg=self.bgcolor, fg=self.fgcolor, + relief="sunken", + width=1, # Don't request more than we get + ) + self.label.pack(side="top", fill="x", expand=0, + after=self.editwin.status_bar) + else: + self.label.destroy() + self.label = None + def get_line_info(self, linenum): """Get the line indent value, text, and any block start keyword *************** *** 108,112 **** if self.info[-1][0] == line_index: break - # Add the block starting line info to tmpstack tmpstack.append((line_index, text)) while tmpstack: --- 120,123 ---- *************** *** 117,126 **** def timer_event(self): ! self.update_label() self.text.after(UPDATEINTERVAL, self.timer_event) def font_timer_event(self): newtextfont = self.text["font"] ! if newtextfont != self.textfont: self.textfont = newtextfont self.label["font"] = self.textfont --- 128,138 ---- def timer_event(self): ! if self.label: ! self.update_label() self.text.after(UPDATEINTERVAL, self.timer_event) def font_timer_event(self): newtextfont = self.text["font"] ! if self.label and newtextfont != self.textfont: self.textfont = newtextfont self.label["font"] = self.textfont Index: config-extensions.def =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/config-extensions.def,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** config-extensions.def 21 Apr 2004 20:06:26 -0000 1.13 --- config-extensions.def 24 Apr 2004 03:08:13 -0000 1.14 *************** *** 4,14 **** # Each extension must have at least one section, named after the extension # module. This section must contain an 'enable' item (=1 to enable the ! # extension, =0 to disable it) and also contain any other general ! # configuration items for the extension. Each extension may also define up to ! # two optional sections named ExtensionName_bindings and ! # ExtensionName_cfgBindings. If present, ExtensionName_bindings defines virtual ! # event bindings for the extension that are not sensibly re-configurable. If ! # present, ExtensionName_cfgBindings defines virtual event bindings for the ! # extension that may be sensibly re-configured. # Currently it is necessary to manually modify this file to change extension --- 4,15 ---- # Each extension must have at least one section, named after the extension # module. This section must contain an 'enable' item (=1 to enable the ! # extension, =0 to disable it) and also contain any other general configuration ! # items for the extension. Each extension must define at least one section ! # named ExtensionName_bindings or ExtensionName_cfgBindings. If present, ! # ExtensionName_bindings defines virtual event bindings for the extension that ! # are not user re-configurable. If present, ExtensionName_cfgBindings ! # defines virtual event bindings for the extension that may be sensibly ! # re-configured. If there are no keybindings for a menus' virtual events, ! # include lines like <>= (See [CodeContext], below.) # Currently it is necessary to manually modify this file to change extension *************** *** 66,69 **** --- 67,73 ---- enable=1 numlines=3 + default_on=0 bgcolor=LightGray fgcolor=Black + [CodeContext_bindings] + toggle-code-context= Index: help.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/help.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** help.txt 16 Mar 2004 03:36:41 -0000 1.11 --- help.txt 24 Apr 2004 03:08:13 -0000 1.12 *************** *** 89,95 **** Souces can be specified. --- ! Revert to Default Settings -- Restore original settings. Not ! currently implemented - simply delete ! your .idlerc file. Windows Menu: --- 89,95 ---- Souces can be specified. --- ! Code Context -- Open a pane at the top of the edit window which ! shows the block context of the section of code ! which is scrolling off the top or the window. Windows Menu: From jhylton at users.sourceforge.net Fri Apr 23 23:43:17 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Sat Apr 24 07:27:41 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.27, 2.10.8.28 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14786 Modified Files: Tag: ast-branch symtable.c Log Message: Issue warnings test by test_global.py. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.27 retrieving revision 2.10.8.28 diff -C2 -d -r2.10.8.27 -r2.10.8.28 *** symtable.c 23 Apr 2004 18:32:59 -0000 2.10.8.27 --- symtable.c 24 Apr 2004 03:43:08 -0000 2.10.8.28 *************** *** 6,9 **** --- 6,16 ---- #include "structmember.h" + /* two error strings used for warnings */ + #define GLOBAL_AFTER_ASSIGN \ + "name '%.400s' is assigned to before global declaration" + + #define GLOBAL_AFTER_USE \ + "name '%.400s' is used prior to global declaration" + PySTEntryObject * PySTEntry_New(struct symtable *st, identifier name, block_ty block, *************** *** 144,147 **** --- 151,155 ---- static int symtable_analyze(struct symtable *st); + static int symtable_warn(struct symtable *st, char *msg); static int symtable_enter_block(struct symtable *st, identifier name, block_ty block, void *ast, int lineno); *************** *** 596,599 **** --- 604,622 ---- + static int + symtable_warn(struct symtable *st, char *msg) + { + if (PyErr_WarnExplicit(PyExc_SyntaxWarning, msg, st->st_filename, + st->st_cur->ste_lineno, NULL, NULL) < 0) { + if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) { + PyErr_SetString(PyExc_SyntaxError, msg); + PyErr_SyntaxLocation(st->st_filename, + st->st_cur->ste_lineno); + } + return 0; + } + return 1; + } + /* symtable_enter_block() gets a reference via PySTEntry_New(). This reference is released when the block is exited, via the DECREF *************** *** 645,648 **** --- 668,682 ---- static int + symtable_lookup(struct symtable *st, PyObject *name) + { + PyObject *o; + + o = PyDict_GetItem(st->st_cur->ste_symbols, name); + if (!o) + return 0; + return PyInt_AsLong(o); + } + + static int symtable_add_def(struct symtable *st, PyObject *name, int flag) { *************** *** 651,656 **** int val; - /* XXX must always be called with mangled names. */ - dict = st->st_cur->ste_symbols; if ((o = PyDict_GetItem(dict, name))) { --- 685,688 ---- *************** *** 829,836 **** int i; asdl_seq *seq = s->v.Global.names; ! for (i = 0; i < asdl_seq_LEN(seq); i++) ! if (!symtable_add_def(st, asdl_seq_GET(seq, i), ! DEF_GLOBAL)) return 0; break; --- 861,887 ---- int i; asdl_seq *seq = s->v.Global.names; ! for (i = 0; i < asdl_seq_LEN(seq); i++) { ! identifier name = asdl_seq_GET(seq, i); ! char *c_name = PyString_AS_STRING(name); ! int cur = symtable_lookup(st, name); ! if (cur < 0) ! return 0; ! if (cur & (DEF_LOCAL | USE)) { ! char buf[1000]; ! if (cur & DEF_LOCAL) ! PyOS_snprintf(buf, sizeof(buf), ! GLOBAL_AFTER_ASSIGN, ! c_name); ! else ! PyOS_snprintf(buf, sizeof(buf), ! GLOBAL_AFTER_USE, ! c_name); ! symtable_warn(st, buf); return 0; + } + if (!symtable_add_def(st, name, DEF_GLOBAL)) + return 0; + + } break; From jhylton at users.sourceforge.net Fri Apr 23 23:44:02 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Sat Apr 24 07:27:45 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_repr.py, 1.13.2.1, 1.13.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14856 Modified Files: Tag: ast-branch test_repr.py Log Message: The repr() for lambda is different. Index: test_repr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** test_repr.py 28 Apr 2003 17:28:14 -0000 1.13.2.1 --- test_repr.py 24 Apr 2004 03:44:00 -0000 1.13.2.2 *************** *** 106,110 **** def test_lambda(self): self.failUnless(repr(lambda x: x).startswith( ! " Update of /cvsroot/python/python/dist/src/Lib/test/output In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15848/test/output Modified Files: Tag: ast-branch test_profile Log Message: The new compiler has a different name for the module level. Index: test_profile =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_profile,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -C2 -d -r1.1 -r1.1.14.1 *** test_profile 4 Oct 2001 00:58:24 -0000 1.1 --- test_profile 24 Apr 2004 03:52:16 -0000 1.1.14.1 *************** *** 5,9 **** ncalls tottime percall cumtime percall filename:lineno(function) ! 1 0.000 0.000 1.000 1.000 :1(?) 0 0.000 0.000 profile:0(profiler) 1 0.000 0.000 1.000 1.000 profile:0(testfunc()) --- 5,9 ---- ncalls tottime percall cumtime percall filename:lineno(function) ! 1 0.000 0.000 1.000 1.000 :1() 0 0.000 0.000 profile:0(profiler) 1 0.000 0.000 1.000 1.000 profile:0(testfunc()) From jhylton at users.sourceforge.net Fri Apr 23 23:54:05 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Sat Apr 24 07:29:11 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.99, 1.1.2.100 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16140 Modified Files: Tag: ast-branch newcompile.c Log Message: Generate correct co_firstlineno attribute; fixes test_profile. Modify compiler_enter_scope() to accept the first lineno as an argument, fetched from the statement ast or from the current unit's lineno in the case of lambda. module is hard-coded to start with 1. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.99 retrieving revision 1.1.2.100 diff -C2 -d -r1.1.2.99 -r1.1.2.100 *** newcompile.c 24 Apr 2004 03:01:54 -0000 1.1.2.99 --- newcompile.c 24 Apr 2004 03:54:02 -0000 1.1.2.100 *************** *** 129,132 **** --- 129,133 ---- struct fblockinfo u_fblock[CO_MAXBLOCKS]; + int u_firstlineno; /* the first lineno of the block */ int u_lineno; /* the lineno for the current stmt */ bool u_lineno_set; /* boolean to indicate whether instr *************** *** 157,164 **** int a_lineno; /* last lineno of emitted instruction */ int a_lineno_off; /* bytecode offset of last lineno */ - int a_firstlineno; /* first line number in code */ }; ! static int compiler_enter_scope(struct compiler *, identifier, void *); static void compiler_free(struct compiler *); static int compiler_new_block(struct compiler *); --- 158,164 ---- int a_lineno; /* last lineno of emitted instruction */ int a_lineno_off; /* bytecode offset of last lineno */ }; ! static int compiler_enter_scope(struct compiler *, identifier, void *, int); static void compiler_free(struct compiler *); static int compiler_new_block(struct compiler *); *************** *** 419,423 **** static int ! compiler_enter_scope(struct compiler *c, identifier name, void *key) { struct compiler_unit *u; --- 419,424 ---- static int ! compiler_enter_scope(struct compiler *c, identifier name, void *key, ! int lineno) { struct compiler_unit *u; *************** *** 444,447 **** --- 445,449 ---- u->u_tmpname = 0; u->u_nfblocks = 0; + u->u_firstlineno = lineno; u->u_lineno = 0; u->u_lineno_set = false; *************** *** 1117,1121 **** return NULL; } ! if (!compiler_enter_scope(c, module, mod)) return NULL; switch (mod->kind) { --- 1119,1123 ---- return NULL; } ! if (!compiler_enter_scope(c, module, mod, 1)) return NULL; switch (mod->kind) { *************** *** 1242,1246 **** if (args->defaults) VISIT_SEQ(c, expr, args->defaults); ! if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; --- 1244,1249 ---- if (args->defaults) VISIT_SEQ(c, expr, args->defaults); ! if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s, ! s->lineno)) return 0; *************** *** 1301,1305 **** VISIT_SEQ(c, expr, s->v.ClassDef.bases); ADDOP_I(c, BUILD_TUPLE, n); ! if (!compiler_enter_scope(c, s->v.ClassDef.name, (void *)s)) return 0; c->u->u_private = s->v.ClassDef.name; --- 1304,1309 ---- VISIT_SEQ(c, expr, s->v.ClassDef.bases); ADDOP_I(c, BUILD_TUPLE, n); ! if (!compiler_enter_scope(c, s->v.ClassDef.name, (void *)s, ! s->lineno)) return 0; c->u->u_private = s->v.ClassDef.name; *************** *** 1351,1355 **** if (args->defaults) VISIT_SEQ(c, expr, args->defaults); ! if (!compiler_enter_scope(c, name, (void *)e)) return 0; c->u->u_argcount = asdl_seq_LEN(args->args); --- 1355,1359 ---- if (args->defaults) VISIT_SEQ(c, expr, args->defaults); ! if (!compiler_enter_scope(c, name, (void *)e, c->u->u_lineno)) return 0; c->u->u_argcount = asdl_seq_LEN(args->args); *************** *** 3246,3250 **** freevars, cellvars, filename, c->u->u_name, ! a->a_firstlineno, a->a_lnotab); error: --- 3250,3254 ---- freevars, cellvars, filename, c->u->u_name, ! c->u->u_firstlineno, a->a_lnotab); error: *************** *** 3283,3287 **** goto error; - a.a_firstlineno = -1; /* Emit code in reverse postorder from dfs. */ for (i = a.a_nblocks - 1; i >= 0; i--) { --- 3287,3290 ---- *************** *** 3291,3302 **** i, a.a_postorder[i], b->b_iused, b->b_ialloc, b->b_next); ! for (j = 0; j < b->b_iused; j++) { ! if (a.a_firstlineno < 0) { ! a.a_firstlineno = b->b_instr[0].i_lineno; ! a.a_lineno = a.a_firstlineno; ! } if (!assemble_emit(&a, &b->b_instr[j])) goto error; - } } fprintf(stderr, "\n"); --- 3294,3300 ---- i, a.a_postorder[i], b->b_iused, b->b_ialloc, b->b_next); ! for (j = 0; j < b->b_iused; j++) if (!assemble_emit(&a, &b->b_instr[j])) goto error; } fprintf(stderr, "\n"); From jhylton at users.sourceforge.net Sat Apr 24 00:33:58 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Sat Apr 24 07:29:40 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_importhooks.py, 1.2.8.1, 1.2.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22666 Modified Files: Tag: ast-branch test_importhooks.py Log Message: The compiler package doesn't important because the parser module doesn't work. Index: test_importhooks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_importhooks.py,v retrieving revision 1.2.8.1 retrieving revision 1.2.8.2 diff -C2 -d -r1.2.8.1 -r1.2.8.2 *** test_importhooks.py 28 Apr 2003 17:28:40 -0000 1.2.8.1 --- test_importhooks.py 24 Apr 2004 04:33:53 -0000 1.2.8.2 *************** *** 190,194 **** sys.meta_path.append(i) sys.path_hooks.append(ImpWrapper) ! mnames = ("colorsys", "urlparse", "distutils.core", "compiler.misc") for mname in mnames: parent = mname.split(".")[0] --- 190,194 ---- sys.meta_path.append(i) sys.path_hooks.append(ImpWrapper) ! mnames = ("colorsys", "urlparse", "distutils.core", "email.Utils") for mname in mnames: parent = mname.split(".")[0] From perky at users.sourceforge.net Sun Apr 25 13:51:50 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sun Apr 25 13:52:00 2004 Subject: [Python-checkins] python/dist/src/Modules _heapqmodule.c, NONE, 1.1 _heapmodule.c, 1.1, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12971/Modules Added Files: _heapqmodule.c Removed Files: _heapmodule.c Log Message: Correct the file name of _heapq module. --- NEW FILE: _heapqmodule.c --- (This appears to be a binary file; contents omitted.) --- _heapmodule.c DELETED --- From jlfxihhxf at phil.uni-erlangen.de Mon Apr 26 10:00:31 2004 From: jlfxihhxf at phil.uni-erlangen.de (Jennifer Hooker) Date: Mon Apr 26 09:05:38 2004 Subject: [Python-checkins] don't miss out on that great job - get your university degree now! Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040426/de00d552/attachment.html From kbk at users.sourceforge.net Mon Apr 26 18:26:07 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Mon Apr 26 18:26:12 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib CodeContext.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32728 Modified Files: CodeContext.py Log Message: Fix a bug I introduced which causes all block openers at an indent level to be shown, instead of outdenting each level. Index: CodeContext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/CodeContext.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeContext.py 24 Apr 2004 03:08:13 -0000 1.2 --- CodeContext.py 26 Apr 2004 22:26:04 -0000 1.3 *************** *** 101,105 **** if indent < lastindent: lastindent = indent ! if opener == "else" or "elif": # We also show the if statement lastindent += 1 --- 101,105 ---- if indent < lastindent: lastindent = indent ! if opener in ("else", "elif"): # We also show the if statement lastindent += 1 From rhettinger at users.sourceforge.net Tue Apr 27 00:52:50 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Apr 27 00:52:56 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 pythoncore.dsp,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1489 Modified Files: pythoncore.dsp Log Message: Complete perky's name change patch. Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pythoncore.dsp 22 Apr 2004 18:30:17 -0000 1.7 --- pythoncore.dsp 27 Apr 2004 04:52:47 -0000 1.8 *************** *** 146,150 **** # Begin Source File ! SOURCE=..\..\Modules\_heapmodule.c # End Source File # Begin Source File --- 146,150 ---- # Begin Source File ! SOURCE=..\..\Modules\_heapqmodule.c # End Source File # Begin Source File From theller at users.sourceforge.net Tue Apr 27 14:34:11 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Tue Apr 27 14:34:20 2004 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.vcproj, 1.6, 1.7 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1838 Modified Files: pythoncore.vcproj Log Message: The filename of this module changed again... Index: pythoncore.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.vcproj,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pythoncore.vcproj 22 Apr 2004 17:03:33 -0000 1.6 --- pythoncore.vcproj 27 Apr 2004 18:34:08 -0000 1.7 *************** *** 208,212 **** Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10278 Modified Files: Tag: release23-maint python-docs.txt Log Message: fix typo reported in a long-buried email Index: python-docs.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/python-docs.txt,v retrieving revision 1.1.18.1 retrieving revision 1.1.18.2 diff -C2 -d -r1.1.18.1 -r1.1.18.2 *** python-docs.txt 4 Aug 2003 22:49:41 -0000 1.1.18.1 --- python-docs.txt 28 Apr 2004 03:16:29 -0000 1.1.18.2 *************** *** 149,153 **** 11. Acrobat Reader won't print the PDF. What's wrong? ! Adobe has reportedly admitted that there is a bug Acrobat Reader 5.0 which causes it not to print at least some PDF files generated by pdfTeX. This software is used to produce the PDF --- 149,153 ---- 11. Acrobat Reader won't print the PDF. What's wrong? ! Adobe has reportedly admitted that there is a bug in Acrobat Reader 5.0 which causes it not to print at least some PDF files generated by pdfTeX. This software is used to produce the PDF From fdrake at users.sourceforge.net Tue Apr 27 23:16:52 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Apr 27 23:16:59 2004 Subject: [Python-checkins] python/dist/src/Doc python-docs.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10403 Modified Files: python-docs.txt Log Message: fix typo reported in a long-buried email Index: python-docs.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/python-docs.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** python-docs.txt 23 Oct 2003 14:33:46 -0000 1.3 --- python-docs.txt 28 Apr 2004 03:16:49 -0000 1.4 *************** *** 150,154 **** 11. Acrobat Reader won't print the PDF. What's wrong? ! Adobe has reportedly admitted that there is a bug Acrobat Reader 5.0 which causes it not to print at least some PDF files generated by pdfTeX. This software is used to produce the PDF --- 150,154 ---- 11. Acrobat Reader won't print the PDF. What's wrong? ! Adobe has reportedly admitted that there is a bug in Acrobat Reader 5.0 which causes it not to print at least some PDF files generated by pdfTeX. This software is used to produce the PDF From fdrake at users.sourceforge.net Tue Apr 27 23:57:32 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Apr 27 23:57:35 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libwinsound.tex, 1.13, 1.13.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16133 Modified Files: Tag: release23-maint libwinsound.tex Log Message: remove out-of-date count of the functions in winsound Index: libwinsound.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libwinsound.tex,v retrieving revision 1.13 retrieving revision 1.13.10.1 diff -C2 -d -r1.13 -r1.13.10.1 *** libwinsound.tex 16 May 2003 01:42:22 -0000 1.13 --- libwinsound.tex 28 Apr 2004 03:57:30 -0000 1.13.10.1 *************** *** 12,16 **** The \module{winsound} module provides access to the basic sound-playing machinery provided by Windows platforms. It includes ! two functions and several constants. --- 12,16 ---- The \module{winsound} module provides access to the basic sound-playing machinery provided by Windows platforms. It includes ! functions and several constants. From fdrake at users.sourceforge.net Tue Apr 27 23:57:49 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Apr 27 23:57:52 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libwinsound.tex, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16225 Modified Files: libwinsound.tex Log Message: remove out-of-date count of the functions in winsound Index: libwinsound.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libwinsound.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libwinsound.tex 16 May 2003 01:42:22 -0000 1.13 --- libwinsound.tex 28 Apr 2004 03:57:47 -0000 1.14 *************** *** 12,16 **** The \module{winsound} module provides access to the basic sound-playing machinery provided by Windows platforms. It includes ! two functions and several constants. --- 12,16 ---- The \module{winsound} module provides access to the basic sound-playing machinery provided by Windows platforms. It includes ! functions and several constants. From doerwalter at users.sourceforge.net Wed Apr 28 13:07:53 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Wed Apr 28 13:08:01 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_colorsys.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27450/Lib/test Added Files: test_colorsys.py Log Message: Add a test script for the colorsys module. --- NEW FILE: test_colorsys.py --- import unittest, test.test_support import colorsys def frange(start, stop, step): while start <= stop: yield start start += stop class ColorsysTest(unittest.TestCase): def assertTripleEqual(self, tr1, tr2): self.assertEqual(len(tr1), 3) self.assertEqual(len(tr2), 3) self.assertAlmostEqual(tr1[0], tr2[0]) self.assertAlmostEqual(tr1[1], tr2[1]) self.assertAlmostEqual(tr1[2], tr2[2]) def test_hsv_roundtrip(self): for r in frange(0.0, 1.0, 0.2): for g in frange(0.0, 1.0, 0.2): for b in frange(0.0, 1.0, 0.2): rgb = (r, g, b) self.assertTripleEqual( rgb, colorsys.hsv_to_rgb(*colorsys.rgb_to_hsv(*rgb)) ) def test_hsv_values(self): values = [ # rgb, hsv ((0.0, 0.0, 0.0), ( 0 , 0.0, 0.0)), # black ((0.0, 0.0, 1.0), (4./6., 1.0, 1.0)), # blue ((0.0, 1.0, 0.0), (2./6., 1.0, 1.0)), # green ((0.0, 1.0, 1.0), (3./6., 1.0, 1.0)), # cyan ((1.0, 0.0, 0.0), ( 0 , 1.0, 1.0)), # red ((1.0, 0.0, 1.0), (5./6., 1.0, 1.0)), # purple ((1.0, 1.0, 0.0), (1./6., 1.0, 1.0)), # yellow ((1.0, 1.0, 1.0), ( 0 , 0.0, 1.0)), # white ((0.5, 0.5, 0.5), ( 0 , 0.0, 0.5)), # grey ] for (rgb, hsv) in values: self.assertTripleEqual(hsv, colorsys.rgb_to_hsv(*rgb)) self.assertTripleEqual(rgb, colorsys.hsv_to_rgb(*hsv)) def test_hls_roundtrip(self): for r in frange(0.0, 1.0, 0.2): for g in frange(0.0, 1.0, 0.2): for b in frange(0.0, 1.0, 0.2): rgb = (r, g, b) self.assertTripleEqual( rgb, colorsys.hls_to_rgb(*colorsys.rgb_to_hls(*rgb)) ) def test_hls_values(self): values = [ # rgb, hls ((0.0, 0.0, 0.0), ( 0 , 0.0, 0.0)), # black ((0.0, 0.0, 1.0), (4./6., 0.5, 1.0)), # blue ((0.0, 1.0, 0.0), (2./6., 0.5, 1.0)), # green ((0.0, 1.0, 1.0), (3./6., 0.5, 1.0)), # cyan ((1.0, 0.0, 0.0), ( 0 , 0.5, 1.0)), # red ((1.0, 0.0, 1.0), (5./6., 0.5, 1.0)), # purple ((1.0, 1.0, 0.0), (1./6., 0.5, 1.0)), # yellow ((1.0, 1.0, 1.0), ( 0 , 1.0, 0.0)), # white ((0.5, 0.5, 0.5), ( 0 , 0.5, 0.0)), # grey ] for (rgb, hls) in values: self.assertTripleEqual(hls, colorsys.rgb_to_hls(*rgb)) self.assertTripleEqual(rgb, colorsys.hls_to_rgb(*hls)) def test_main(): test.test_support.run_unittest(ColorsysTest) if __name__ == "__main__": test_main() From hntohxcaudf at hotmail.com Wed Apr 28 20:59:41 2004 From: hntohxcaudf at hotmail.com (Linda Pollard) Date: Wed Apr 28 20:05:51 2004 Subject: [Python-checkins] extended benefits yachtsmanfountainhead Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040428/6554fc0f/attachment.html From cl683vcjbb at studserv.uni-leipzig.de Wed Apr 28 22:38:02 2004 From: cl683vcjbb at studserv.uni-leipzig.de (Georgina Yoder) Date: Wed Apr 28 22:38:05 2004 Subject: [Python-checkins] The 2004 edition of The American Medical Directory blood pressure, cancer, flu, health, f eu Message-ID: <3--4$pe793--gwvt20-3a7018$70@yck9jb4ksr> Subjects: physicians, specialists, doctors, licensed doctors, board physicians, emergency physicians, 2004 physicians guide, 2004 physicians directory, physicians contact. EXCLUSIVELY ON CD-ROM. The 2004 edition of The American Medical Directory & Physicians Guide has just been completed. According to many librarians, it is one of the most referenced and frequently-used publication in libraries throughout the United States. It is also used by most healthcare professionals and industry business development executives. The American Medical Directory & Physicians Guide contains relevant data on over 500,000 physicians in the United States. Each record is indexed by such features as name, address, phone/fax, county, year licensed, type of practice, type of physician, as well as primary and secondary specialty. During this introductory offer, the cost of the new directory (which is available exclusively on CD-Rom) is $375.00 (reg. $795). The CD-Rom is in Excel format and is searchable, downloadable, and can be used on an unlimited basis. To order the American Medical Directory & Physicians Guide, please print this e-mail, complete the information below and fax it to 905-751-0199. (tel: 905-751-0919). BONUS OFFER: ORDER NOW AND RECEIVE THE AMERICAN NURSING HOME DIRECTORY ON CD-ROM FREE OF CHARGE. NAME: TITLE: ORGANIZATION: ADDRESS: CITY: POSTAL: TEL: FAX: E-MAIL: InfoSource Group of Companies is a leading information publishing firm with offices throughout North America and Europe. zxb qubt lb tcg g l qhitf qkx zrc iq um e e jtdlzer From fdrake at users.sourceforge.net Wed Apr 28 22:47:11 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Apr 28 22:47:15 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libbasehttp.tex, 1.14, 1.14.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17444 Modified Files: Tag: release23-maint libbasehttp.tex Log Message: the headers in an HTTP request are HTTP headers, not MIME headers Index: libbasehttp.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbasehttp.tex,v retrieving revision 1.14 retrieving revision 1.14.18.1 diff -C2 -d -r1.14 -r1.14.18.1 *** libbasehttp.tex 17 Mar 2002 18:37:22 -0000 1.14 --- libbasehttp.tex 29 Apr 2004 02:47:09 -0000 1.14.18.1 *************** *** 181,185 **** \begin{methoddesc}{send_header}{keyword, value} ! Writes a specific MIME header to the output stream. \var{keyword} should specify the header keyword, with \var{value} specifying its value. --- 181,185 ---- \begin{methoddesc}{send_header}{keyword, value} ! Writes a specific HTTP header to the output stream. \var{keyword} should specify the header keyword, with \var{value} specifying its value. *************** *** 187,191 **** \begin{methoddesc}{end_headers}{} ! Sends a blank line, indicating the end of the MIME headers in the response. \end{methoddesc} --- 187,191 ---- \begin{methoddesc}{end_headers}{} ! Sends a blank line, indicating the end of the HTTP headers in the response. \end{methoddesc} From fdrake at users.sourceforge.net Wed Apr 28 22:47:40 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Apr 28 22:47:44 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libbasehttp.tex, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17667 Modified Files: libbasehttp.tex Log Message: the headers in an HTTP request are HTTP headers, not MIME headers Index: libbasehttp.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbasehttp.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** libbasehttp.tex 17 Mar 2002 18:37:22 -0000 1.14 --- libbasehttp.tex 29 Apr 2004 02:47:38 -0000 1.15 *************** *** 181,185 **** \begin{methoddesc}{send_header}{keyword, value} ! Writes a specific MIME header to the output stream. \var{keyword} should specify the header keyword, with \var{value} specifying its value. --- 181,185 ---- \begin{methoddesc}{send_header}{keyword, value} ! Writes a specific HTTP header to the output stream. \var{keyword} should specify the header keyword, with \var{value} specifying its value. *************** *** 187,191 **** \begin{methoddesc}{end_headers}{} ! Sends a blank line, indicating the end of the MIME headers in the response. \end{methoddesc} --- 187,191 ---- \begin{methoddesc}{end_headers}{} ! Sends a blank line, indicating the end of the HTTP headers in the response. \end{methoddesc} From c68gxazf at ch.tum.de Wed Apr 28 08:49:32 2004 From: c68gxazf at ch.tum.de (Raul Sewell) Date: Fri Apr 30 00:57:49 2004 Subject: [Python-checkins] The 2004 edition of The American Medical Directory geriatrics, anaesthesiology, wwpe Message-ID: Subjects: physicians, specialists, doctors, licensed doctors, board physicians, emergency physicians, 2004 physicians guide, 2004 physicians directory, physicians contact. EXCLUSIVELY ON CD-ROM. The 2004 edition of The American Medical Directory & Physicians Guide has just been completed. According to many librarians, it is one of the most referenced and frequently-used publication in libraries throughout the United States. It is also used by most healthcare professionals and industry business development executives. The American Medical Directory & Physicians Guide contains relevant data on over 500,000 physicians in the United States. Each record is indexed by such features as name, address, phone/fax, county, year licensed, type of practice, type of physician, as well as primary and secondary specialty. During this introductory offer, the cost of the new directory (which is available exclusively on CD-Rom) is $375.00 (reg. $795). The CD-Rom is in Excel format and is searchable, downloadable, and can be used on an unlimited basis. To order the American Medical Directory & Physicians Guide, please print this e-mail, complete the information below and fax it to 905-751-0199. (tel: 905-751-0919). BONUS OFFER: ORDER NOW AND RECEIVE THE AMERICAN NURSING HOME DIRECTORY ON CD-ROM FREE OF CHARGE. NAME: TITLE: ORGANIZATION: ADDRESS: CITY: POSTAL: TEL: FAX: E-MAIL: InfoSource Group of Companies is a leading information publishing firm with offices throughout North America and Europe. qphhe zmu From mbatesalann at netscape.net Fri Apr 30 13:03:21 2004 From: mbatesalann at netscape.net (mbatesalann@netscape.net) Date: Fri Apr 30 16:24:58 2004 Subject: [Python-checkins] REPLY BACK Message-ID: <200404301703.i3UH3LTx060215@mxzilla1.xs4all.nl> Dear Friend, As you read this, I don't want you to feel sorry for me, because, I believe everyone will die someday. My name is BATES ALAN a merchant in Dubai, in the U.A.E.I have been diagnosed with Esophageal cancer. It has defiled all forms of medical treatment, and right now I have only about a few months to live, according to medical experts. I have not particularly lived my life so well, as I never really cared for anyone(not even myself)but my business. Though I am very rich, I was never generous, I was always hostile to people and only focused on my business as that was the only thing I cared for. But now I regret all this as I now know that there is more to life than just wanting to have or make all the money in the world. I believe when God gives me a second chance to come to this world I would live my life a different way from how I have lived it. Now that God has called me, I have willed and given most of my property and assets to my immediate and extended family members as well as a few close friends. I want God to be merciful to me and accept my soul so, I have decided to give alms to charity organizations, as I want this to be one of the last good deeds I do on earth. So far, I have distributed money to some charity organizations in the U.A.E, Algeria and Malaysia. Now that my health has deteriorated so badly, I cannot do this myself anymore. I once asked members of my family to close one of my accounts and distribute the money which I have there to charity organization in Bulgaria and Pakistan, they refused and kept the money to themselves. Hence, I do not trust them anymore, as they seem not to be contended with what I have left for them. The last of my money which no one knows of is the huge cash deposit of eighteen million dollars $18,000,000,00 that I have with a finance/Security Company abroad. I will want you to help me collect this deposit and dispatched it to charity organizations. I have set aside 10% for you and for your time. God be with you. BATES ALAN From rhettinger at users.sourceforge.net Fri Apr 30 18:52:54 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Apr 30 18:53:02 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcollections.tex, 1.6, 1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28472 Modified Files: libcollections.tex Log Message: Add an example application to the docs. Index: libcollections.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcollections.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libcollections.tex 1 Mar 2004 23:16:21 -0000 1.6 --- libcollections.tex 30 Apr 2004 22:52:50 -0000 1.7 *************** *** 68,72 **** Rotate the deque \var{n} steps to the right. If \var{n} is negative, rotate to the left. Rotating one step to the right ! is equivalent to: \samp{d.appendleft(d.pop())}. \end{methoddesc} --- 68,72 ---- Rotate the deque \var{n} steps to the right. If \var{n} is negative, rotate to the left. Rotating one step to the right ! is equivalent to: \samp{d.appendleft(d.pop())}. \end{methoddesc} *************** *** 129,132 **** >>> d deque(['c', 'b', 'a']) ! \end{verbatim} --- 129,161 ---- >>> d deque(['c', 'b', 'a']) + \end{verbatim} ! ! A roundrobin task server can be built from a \class{deque} using ! \method{popleft()} to select the current task and \method{append()} ! to add it back to the tasklist if the input stream is not exhausted: ! ! \begin{verbatim} ! def roundrobin(*iterables): ! pending = deque(iter(i) for i in iterables) ! while pending: ! task = pending.popleft() ! try: ! yield task.next() ! except StopIteration: ! continue ! pending.append(task) ! ! >>> for value in roundrobin('abc', 'd', 'efgh'): ! print value ! ! a ! d ! e ! b ! f ! c ! g ! h ! ! \end{verbatim}