[issue34208] Change in 3.7 expression evaluation?

2018-07-24 Thread Dave Opstad
New submission from Dave Opstad : In 3.6 I get this: >>> x = (100 * 20) >>> x is 2000 False >>> (100 * 20) is 2000 False But in 3.7, I get this: >>> x = (100 * 20) >>> x is 2000 False >>> (100 * 20) is 2000 True This isn't necessaril

[issue32488] Fatal error using pydoc

2018-01-03 Thread Dave Opstad
Dave Opstad <dave.ops...@monotypeimaging.com> added the comment: I think this was my mistake; when I used pydoc3 instead of pydoc it ran to completion. Please feel free to close this; sorry for the noise. -- ___ Python tracke

[issue32488] Fatal error using pydoc

2018-01-03 Thread Dave Opstad
New submission from Dave Opstad <dave.ops...@monotypeimaging.com>: I'm running 3.6.4 on Mac OS X 10.13.2, bash shell. Doing: $ pydoc modules causes: Please wait a moment while I gather a list of all available modules... Fatal Python error: PyThreadState_Get: no current thread Abort t

[issue11900] 2.7.1 unicode subclasses not calling __str__() for print statement

2011-04-21 Thread Dave Opstad
New submission from Dave Opstad dave.ops...@monotypeimaging.com: Python 2.7.1 doesn't appear to do the usual implicit call to str() for subclasses of unicode. In the following snippet, I would have expected print myTest and print str(myTest) to behave the same: class Test(unicode): ... def

[issue11900] 2.7.1 unicode subclasses not calling __str__() for print statement

2011-04-21 Thread Dave Opstad
Dave Opstad dave.ops...@monotypeimaging.com added the comment: I guess I was confused by the inconsistency with Python 3, which *does* call the __str__ method, even though, again, no coercion is needed: Python 3.2 (r32:88452, Feb 20 2011, 10:19:59) [GCC 4.0.1 (Apple Inc. build 5493

[issue8941] utf-32be codec failing on 16-bit python build for 32-bit value

2010-06-08 Thread Dave Opstad
New submission from Dave Opstad dave.ops...@monotypeimaging.com: The utf-32 little-endian codec works fine, but the big-endian codec is producing incorrect results: Python 3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type help, copyright, credits

[issue8946] PyBuffer_Release signature in 3.1 documentation is incorrect

2010-06-08 Thread Dave Opstad
New submission from Dave Opstad dave.ops...@monotypeimaging.com: According to the 3.1 documentation, the prototype for PyBuffer_Release is: void PyBuffer_Release(PyObject *obj, Py_buffer *view); However, abstract.h has this prototype: PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view

Re: List of all Python's __special-methods__ ?

2008-04-25 Thread Dave Opstad
In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: Hrvoje Niksic wrote: [EMAIL PROTECTED] writes: Is there an official list of all Python's __special-methods__? http://docs.python.org/ref/specialnames.html __missing__ is missing :-) see note (10) at the bottom

Re: Tkinter menu question--how to pass arguments

2007-03-30 Thread Dave Opstad
In article [EMAIL PROTECTED], Kevin Walzer [EMAIL PROTECTED] wrote: I'm having difficulty structuring a Tkinter menu entry. Here is the command in question: self.finkmenu.add_command(label='Update List of Packages', command=self.authorizeCommand(self.scanPackages)) When I start my

Re: struct.pack oddity

2007-03-13 Thread Dave Opstad
In article [EMAIL PROTECTED], Larry Bates [EMAIL PROTECTED] wrote: 1) You can't put 10 into a half-word. The limit is 2**16 or 65535. On Python 2.5 I get: Yes, I know. I used that example to illustrate the problem. If a value does not fit a format then Python should report that

Re: struct.pack oddity

2007-03-13 Thread Dave Opstad
In article [EMAIL PROTECTED], Erik Johnson [EMAIL PROTECTED] wrote: Barring anyone else disagreeing with classifying it as a bug, I would suggest reporting it. Proper procedure for reporting a bug appears to be covered in section B of the Python Library Reference:

Re: builtin set literal

2007-02-21 Thread Dave Opstad
In article [EMAIL PROTECTED], Paul Rubin http://[EMAIL PROTECTED] wrote: [...] However, Python seems to use the -ed suffix for the non-mutating versions of these functions, e.g. sorted(list) instead of the mutating list.sort(). I've found this to be useful in my own Python libraries.

Re: pack a three byte int

2006-11-09 Thread Dave Opstad
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Can Python not express the idea of a three-byte int? For instance, in the working example below, can we somehow collapse the three calls of struct.pack into one? import struct skip = 0x123456 ; count = 0x80 cdb = '' cdb +=

Re: pack a three byte int

2006-11-09 Thread Dave Opstad
Sorry, that should have been: cdb += struct.pack(L, skip)[1:] Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: py2app semi-standalone semi-works

2006-10-04 Thread Dave Opstad
In article [EMAIL PROTECTED], James Stroud [EMAIL PROTECTED] wrote: I am trying to create a semi-standalone with the vendor python on OS X 10.4 (python 2.3.5). I tried to include some packages with both --packages from the command and the 'packages' option in setup.py. While the packages

Re: py2app console

2006-10-03 Thread Dave Opstad
In article [EMAIL PROTECTED], James Stroud [EMAIL PROTECTED] wrote: Does anyone know of the most straightforward way to get rid of the intensely annoying console window that py2app feels so compelled to create? I include this code in my apps: if (sys.platform != win32) and

Re: Python is fun (useless social thread) ;-)

2006-06-15 Thread Dave Opstad
, and I'm having the time of my life. My copy of the Martelli book is seriously dog-eared at this point; I'm glad a new edition is being released in a few months. In short: Python rocks. Dave Opstad -- http://mail.python.org/mailman/listinfo/python-list

Manipulating sets from the 2.4 C API?

2006-04-11 Thread Dave Opstad
somewhere I'm not seeing? Thanks, Dave Opstad -- http://mail.python.org/mailman/listinfo/python-list

Re: Outdated Python Info on www.unicode.org

2006-03-06 Thread Dave Opstad
In article [EMAIL PROTECTED], Dennis Benzinger [EMAIL PROTECTED] wrote: Could someone who knows the current state of Unicode support in Python update this information? I've just passed this along to the folks at the Unicode Consortium. Dave --

Re: Tkinter / Aqua (OS X) question (canvas borders)

2006-02-20 Thread Dave Opstad
draw is no closer than 5 pixels from the edge of the Canvas, and that seems to work on all the platforms I'm deploying on. Dave Opstad -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHONDOCS on OSX

2005-11-28 Thread Dave Opstad
In article [EMAIL PROTECTED], Robert Hicks [EMAIL PROTECTED] wrote: How do I set this variable in my .bash_profile? I have the html docs in /usr/local/PythonDocs. I have a line in my .profile like this: export PYTHONDOCS='/Users/opstad/Documents/Developer Docs/Python-Docs-2.4.1' So by

__setslice__ and classes derived from list

2005-09-02 Thread Dave Opstad
According to the documentation the __setslice__ method has been deprecated since Python 2.0. However, if I'm deriving classes from the builtin list class, I've discovered I can't really ignore __setslice__. Have a look at this snippet:

Re: __setslice__ and classes derived from list

2005-09-02 Thread Dave Opstad
In article [EMAIL PROTECTED], Michael Hoffman [EMAIL PROTECTED] wrote: Perhaps you should submit a feature request? It must be time to get rid of __setslice__, if not now, then maybe by Python 3.0. I'm happy to submit a feature request, once I figure out how to do it! Dave --

Odd slicing behavior?

2005-06-22 Thread Dave Opstad
Take a look at this snippet: class L(list): ... def __init__(self, v): ... super(L, self).__init__(v) ... def __setitem__(self, key, value): ... print key.indices(len(self)) ... v = L(range(10)) v [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] v[::] = [1] (0, 10, 1) v[0:10:1] = [1] (0, 10, 1)

Re: Odd slicing behavior?

2005-06-22 Thread Dave Opstad
In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: So - the rationale seems to be: When using slice-assignment, a form like l[a:b:c] imposes possibly a non-continous section in l, for which the semantics are unclear - so we forbid it But it isn't forbidden: v =

Unusable outer edge of Tkinter canvases?

2005-05-25 Thread Dave Opstad
When drawing rectangles in Tkinter canvases I've noticed the outer edges (say 3-5 pixels) don't always draw. For instance, try typing this in an interactive session (Terminal in OS X or Command Prompt in Windows XP): import Tkinter as T root = T.Tk() f = T.Frame(root) f.grid() c =

Re: Unusable outer edge of Tkinter canvases?

2005-05-25 Thread Dave Opstad
In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] wrote: to fix this, you can either set the border width to zero, add scrollbars to the widget (this fixes the coordinate system), or explicitly reset the coordinate system: w.xview_moveto(0) w.yview_moveto(0) The

Attributes and built-in types

2005-04-01 Thread Dave Opstad
Is it just an implementation limitation that attributes cannot be assigned to instances of internal types? --- x = 4 type(x) type 'int' class Test(int): ... pass ... y = Test(4) type(y) class '__main__.Test' y.someattr = 10 x.someattr = 10 Traceback (most recent

Is there a short-circuiting dictionary get method?

2005-03-09 Thread Dave Opstad
In this snippet: d = {'x': 1} value = d.get('x', bigscaryfunction()) the bigscaryfunction is always called, even though 'x' is a valid key. Is there a short-circuit version of get that doesn't evaluate the second argument if the first is a valid key? For now I'll code around it, but this

Initializing subclasses of tuple

2005-03-01 Thread Dave Opstad
do I initialize instances of a class derived from tuple, if it's not in the __init__ method? Thanks for any help! Dave Opstad -- http://mail.python.org/mailman/listinfo/python-list

Awkwardness of C API for making tuples

2005-02-01 Thread Dave Opstad
the tuple's items. Whew. Does anyone know of a simpler way? I can't use Py_BuildValue because I don't know at compile-time how many values there are going to be. And there doesn't seem to be a PyTuple_FromArray() function. If I'm overlooking something obvious, please clue me in! Thanks, Dave Opstad

Re: Awkwardness of C API for making tuples

2005-02-01 Thread Dave Opstad
In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: What is the purpose of this first loop? Error handling. If I can't successfully create all the PyInts then I can dispose the ones I've made and not bother making the tuple at all. In what variable-length storage are you