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
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
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
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
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
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
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
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
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
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
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:
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.
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 +=
Sorry, that should have been:
cdb += struct.pack(L, skip)[1:]
Dave
--
http://mail.python.org/mailman/listinfo/python-list
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
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
, 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
somewhere
I'm not seeing?
Thanks,
Dave Opstad
--
http://mail.python.org/mailman/listinfo/python-list
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
--
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
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
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:
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
--
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)
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 =
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 =
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
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
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
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
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
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
32 matches
Mail list logo