On Sat, Aug 6, 2011 at 10:47 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Eric Snow wrote:
Thought I knew how to provide a dynamic __name__ on instances of a
class. My first try was to use a non-data descriptor:
Perhaps you should explain what you are trying to do. If you
Hi all,
I'm a first-time writer here, so excuse me if I say something inappropriate
or such.
Last week, I was reviewing some Python 2.7 modules when I came across the
OrderedDict data structure. After seeing its official implementation and
also after reading through the corresponding PEP, I
I'm looking for good ways to ensure that attributes are only writable such that
they retain the characteristics the class requires.
My particular case is a class attribute which is initialised as a list of lists
of two integers, the first of which is a modulo remainder. I need to be able to
In article mailman.2010.1312731312.1164.python-l...@python.org,
John O'Hagan resea...@johnohagan.com wrote:
I'm looking for good ways to ensure that attributes are only writable such
that they retain the characteristics the class requires.
Sounds like you're trying to do
Roy Smith wrote:
In article mailman.2010.1312731312.1164.python-l...@python.org,
John O'Hagan resea...@johnohagan.com wrote:
I'm looking for good ways to ensure that attributes are only writable
such that they retain the characteristics the class requires.
Sounds like you're trying to
I think you might use a tuple instead of a list for OrderElement, that would
make much easier your code:
class
OrderElement(tuple):
def __new__(cls, x, y):
if not isinstance(x, int) or not isinstance(y, int):
raise TypeError(Order element must receives two
integers)
The assert on Order should be an if ... raise, like OrderElement, sorry for
the mistake and repost
El 7 de agosto de 2011 18:53, Rafael Durán Castañeda
rafadurancastan...@gmail.com escribió:
I think you might use a tuple instead of a list for OrderElement, that
would make much easier your
I've been running into a lot of issues with the PyPI architecture, and I'm
aware that there's some work going on behind the scenes, especially with
making PyPI accessible from the a cloud-like architecture.
However, I setup a Python mirror (using the pep381client) for our company,
and the issue
John O'Hagan wrote:
I'm looking for good ways to ensure that attributes are only writable such
that they retain the characteristics the class requires.
That's what properties are for.
My particular case is a class attribute which is initialised as a list of
lists of two integers, the first
On 08/07/2011 02:07 AM, Steven D'Aprano wrote:
Gelonida N wrote:
Asuming you [Bud] are not an alias of Jack Smith and assuming you did
not see Jack's thread asking the same question:
That's a strange thing to say when Bud *answered* Jack's question.
x,y = unzip(*L)
What's unzip?
When reading about import hooks, I came across a blog entry comment
that says:
One additional thing to note about ihooks is that it's
somewhat seriously broken on Python 2.5 and newer and there
seems to be little or no interest in fixing it. It's
probably worth *always* avoiding when
On Sun, Aug 7, 2011 at 6:07 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
class ThingWithTwoIntegers(object):
I'm not a lisp expert, but this might well be called a cons cell. Or a pair.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
Josh Haberman wrote:
When reading about import hooks, I came across a blog entry comment
that says:
One additional thing to note about ihooks is that it's
somewhat seriously broken on Python 2.5 and newer and there
seems to be little or no interest in fixing it. It's
probably
I suspect this may have gone out before I was a member, and thus potentially
not be received - apologies if this did go out please ignore this second
attempt if it did.
---
Im trying to use the most basic of cx_Freeze in a dos window and I receive the
following error (see below).
Peter Otten __pete...@web.de wrote:
Duncan Booth wrote:
The descriptor protocol only works when a value is being accessed or set
on an instance and there is no instance attribute of that name so the
value is fetched from the underlying class.
Unlike normal class attributes a descriptor
In article
CAPwXK7-qGS-N6d_cNKwXH=oHEyV6=zidmwh1fdst7ekvp-e...@mail.gmail.com,
Redmumba redmu...@gmail.com wrote:
I've been running into a lot of issues with the PyPI architecture, and I'm
aware that there's some work going on behind the scenes, especially with
making PyPI accessible from the
On Sun, 2011-08-07 at 11:11 -0700, Josh Haberman wrote:
When reading about import hooks, I came across a blog entry comment
that says:
One additional thing to note about ihooks is that it's
somewhat seriously broken on Python 2.5 and newer and there
seems to be little or no interest
My program does not need a prompt, it just needs to wait for any
key to be pressed before it continues. This is in Windows.
char=0
while not char:
char=msvcrt.getch()
That doesn't delay anything here.
while 1:
char=msvcrt.getch()
break
That appears to put my program into
John Doe wrote:
My program does not need a prompt, it just needs to wait for any
key to be pressed before it continues. This is in Windows.
char=0
while not char:
char=msvcrt.getch()
That doesn't delay anything here.
Works perfectly for me. You don't need the while loop, since
from common.URLTool import URLTool
tool = URLTool()
Traceback (most recent call last):
File E:\workspace\url\test.py, line 7, in ?
from common.URLTool import URLTool
ImportError: No module named common.URLTool
URLTools is a class write by myself, it works well ,but cannot be
imported in
Today I found a quote from Guido.
wxPython is the best and most mature cross-platform GUI toolkit, given a number
of constraints. The only reason wxPython isn't the standard Python GUI toolkit
is that Tkinter was there first.
-- Guido van Rossum
OK, now. Isn't it maybe time to throw out TK
On 08/08/2011 02:45 AM, smith jack wrote:
from common.URLTool import URLTool
could it be that you meant
from common import URLTool
As I don't know the module 'common' I am just guessing
tool = URLTool()
Traceback (most recent call last):
File E:\workspace\url\test.py, line 7, in ?
Steven D'Aprano steve+comp.lang.python pearwood.info wrote:
Also, are you using an IDE? If so, it could very well be
interfering with the keyboard buffer
I really don't know how to answer your question. I am using
Windows XP SP3. Komodo Edit 6 for editing the *.py file. Dragon
Naturally
On Sun, Aug 7, 2011 at 6:26 PM, azrael jura.gro...@gmail.com wrote:
Today I found a quote from Guido.
wxPython is the best and most mature cross-platform GUI toolkit, given a
number of constraints. The only reason wxPython isn't the standard Python GUI
toolkit is that Tkinter was there
On Mon, 08 Aug 2011 03:07:30 +1000
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
John O'Hagan wrote:
I'm looking for good ways to ensure that attributes are only writable such
that they retain the characteristics the class requires.
That's what properties are for.
My
Senthil Kumaran sent...@uthcode.com added the comment:
Chris, as you already suggested in msg124410, I would prefer the removal of
encoding specification from command line. Providing the encoding argument via
API with deprecating warning is a good idea.
The output should be string and it
Changes by Senthil Kumaran sent...@uthcode.com:
--
assignee: - orsenthil
nosy: +orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12398
___
Senthil Kumaran sent...@uthcode.com added the comment:
Here is a patch with the test for accepting the badly formed headers. I would
like to ensure that change in the regex is fool-proof in order to accomodate
this bad behavior, so that we don't break the existing stuff.
It is problem at the
New submission from Senthil Kumaran sent...@uthcode.com:
- ftplib and poplib, has them as timeout=None, while they default
to socket._GLOBAL_DEFAULT_TIMEOUT object.
Changes by Senthil Kumaran sent...@uthcode.com:
--
title: timeout sentinel in ftplib and poplib - timeout sentinel in ftplib and
poplib documentation
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12706
Landry Breuil lan...@openbsd.org added the comment:
floatobject.c is compiled with
cc -pthread -c -fno-strict-aliasing -O2 -pipe -Wall
-DTHREAD_STACK_SIZE=0x2 -fPIC -O2 -pipe -Wall -I. -IInclude -I./Include
-fPIC -DPy_BUILD_CORE -o Objects/floatobject.o Objects/floatobject.c
Changes by Landry Breuil lan...@openbsd.org:
Added file: http://bugs.python.org/file22854/pyconfig.h
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12589
___
Changes by Landry Breuil lan...@openbsd.org:
Added file: http://bugs.python.org/file22855/math.h
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12589
___
Landry Breuil lan...@openbsd.org added the comment:
Interestingly, after an update of the system i can't build python 3.2.1 anymore
:
/usr/include/util.h:102: error: conflicting types for 'openpty'
Include/pyport.h:634: error: previous declaration of 'openpty' was here
/usr/include/util.h:105:
Changes by Landry Breuil lan...@openbsd.org:
Added file: http://bugs.python.org/file22857/build-macppc.log
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12589
___
Sandro Tosi sandro.t...@gmail.com added the comment:
grepping over the stdlib, LookupError is only used in codecs exception; also
the documentation of LE is The base class for the exceptions that are raised
when a key or index used on a mapping or sequence is invalid: IndexError,
KeyError.
Chris Lambacher ch...@kateandchris.net added the comment:
Senthil: I wasn't advocating the removal of the ability to specify encoding,
only stating that avoiding the use of sys.stdout.buffer.write could only
sensibly be done if we also removed the ability to specify an encoding (I can
see how
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset a30e6c4bf486 by Sandro Tosi in branch '2.7':
#12677: correct turtle orientation in doc
http://hg.python.org/cpython/rev/a30e6c4bf486
New changeset bf4f65043d7d by Sandro Tosi in branch '3.2':
#12677: correct turtle
Changes by Sandro Tosi sandro.t...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12677
___
Antoine Pitrou pit...@free.fr added the comment:
I don't think WARNING: this may corrupt your terminal is warranted. Also, I
think we can safely remove the --encoding option. Calling a module from the
command-line is intended as a demonstration of the module's functionality, it's
not an
Vlad Riscutia riscutiav...@gmail.com added the comment:
The main reason for this issue is that internally ctypes doesn't consider
c_char_p as a pointer type. This is a bit counter-intuitive, but c_char_p is
treated as a simple type and has some other sugar built-in, like easier
integration
Sandro Tosi sandro.t...@gmail.com added the comment:
Here attached a very simple patch, made by slightly re-editing the comment in
pystate.h.
--
keywords: +patch
nosy: +ezio.melotti, sandro.tosi
stage: - patch review
versions: +Python 3.3 -Python 3.1
Added file:
R. David Murray rdmur...@bitdance.com added the comment:
Well, you could consider codecs an example in the stdlib of using it, and the
doc could be changed to something like stdlib modules that look up information
in specialized data sources may raise this error directly. Whether this is a
R. David Murray rdmur...@bitdance.com added the comment:
Perhaps we should issue a warning, then, too?
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12541
___
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 8852e4a9aa1e by Sandro Tosi in branch '2.7':
#10741: add documentation for PyGILState_GetThisThreadState()
http://hg.python.org/cpython/rev/8852e4a9aa1e
New changeset 53b8260b9ea7 by Sandro Tosi in branch '3.2':
Sandro Tosi sandro.t...@gmail.com added the comment:
I just committed an improved version of the proposed patch (thanks Ezio for the
review and help!).
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python
Sandro Tosi sandro.t...@gmail.com added the comment:
On Mon, Aug 8, 2011 at 00:12, R. David Murray rep...@bugs.python.org wrote:
R. David Murray rdmur...@bitdance.com added the comment:
Well, you could consider codecs an example in the stdlib of using it, and the
doc could be changed to
Vlad Riscutia riscutiav...@gmail.com added the comment:
Not sure how this can be fixed actually. I don't think PyErr_SetFromErrno
instead of PyErr_SetString would work because as far as I can tell, standard
does not mention dlopen making use of errno. Unlike Windows, where LoadLibrary
will
R. David Murray rdmur...@bitdance.com added the comment:
Well, as long as 'accepted' is under 'resolution', I'm likely to keep using it
for feature requests, I suppose because I'm too much of a precisonist. If
someone wants to re-engineer the interface, that would be fine with me :)
I
New submission from Ezio Melotti ezio.melo...@gmail.com:
The documentation for urllib.request.urlopen [0] says that:
This function returns a file-like object [addinfourl] with two additional
methods from the urllib.response module
geturl() — return the URL of the resource retrieved, [...]
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10050
___
___
Ezio Melotti ezio.melo...@gmail.com added the comment:
Another possible improvement that can be done is providing a proper Response
object instead of addbase, addinfo, addinfourl (yes, those are oddly-named
classes, not functions [0]).
The Response object could be like 'addbase', but with this
Craig McQueen pyt...@craig.mcqueen.id.au added the comment:
So this has been rejected I see. Too bad, since I stub my metaphorical toe on
this issue from time to time. Just for the record, here is an example:
http://stackoverflow.com/questions/4130936/perfect-hash-function/6976723#6976723
53 matches
Mail list logo