On 2010-12-03, Paul Rubin wrote:
> Steven D'Aprano writes:
>>> There are better ways to handle errors than Python's exception system.
>> I'm curious -- what ways would they be?
>> I'm aware of three general exception handling techniques: ...
>> What else is there?
>
> The Erlang approach is to ch
Harishankar wrote:
> I think I understand the general trend of what you're saying. It
> definitely requires a mindset change. I still feel that user-defined
> exception classes might not be the way, but maybe I should allow the
> built-in exceptions which are thrown by library functions to follow
Consider the following common exception handling idiom:
def func(iterable):
it = iter(iterable)
try:
x = next(it)
except StopIteration:
raise ValueError("can't process empty iterable")
print(x)
The intention is:
* detect an empty iterator by catching StopIteration
On Dec 1, 3:15 am, Tim Harig wrote:
> On 2010-12-01, javivd wrote:
>
>
>
> > On Nov 30, 11:43 pm, Tim Harig wrote:
> >> On 2010-11-30, javivd wrote:
>
> >> > I have a case now in wich another file has been provided (besides the
> >> > database) that tells me in wich column of the file is every
Hello fellows,
I would need a unique internal identifier to an object. Can I use the
object python id ?
class Foo:
def getUniqueIdentifier():
return id(self)
This id needs to be unique and constant over the python process lifetime.
JM
--
http://mail.python.org/mailman/listinfo/pyt
Jean-Michel Pichavant wrote:
Hello fellows,
I would need a unique internal identifier to an object. Can I use the
object python id ?
class Foo:
def getUniqueIdentifier():
return id(self)
This id needs to be unique and constant over the python process lifetime.
JM
erratum
python
On Fri, 2010-12-03 at 14:44 +0100, Jean-Michel Pichavant wrote:
> Hello fellows,
> I would need a unique internal identifier to an object. Can I use the
> object python id ?
> class Foo:
> def getUniqueIdentifier():
>return id(self)
> This id needs to be unique and constant over the p
Jean-Michel Pichavant wrote:
Hello fellows,
I would need a unique internal identifier to an object. Can I use the
object python id ?
class Foo:
def getUniqueIdentifier():
return id(self)
This id needs to be unique and constant over the python process lifetime.
JM
sorry guys
"
id(/objec
Dear friends,
This is Sverker from Sweden. You probably know me better as the guy
who made Guppy/Heapy: http://guppy-pe.sf.net
I am currently in the process of preparing version 0.1.10 with support
for Python 2.7. I will let you know when it is updated.
For those who don’t know, I work as a con
Adam Tauno Williams wrote:
On Fri, 2010-12-03 at 14:44 +0100, Jean-Michel Pichavant wrote:
Hello fellows,
I would need a unique internal identifier to an object. Can I use the
object python id ?
class Foo:
def getUniqueIdentifier():
return id(self)
This id needs to be unique and
Hi folks,
I'm new to Jython - not to Python. The good thing about Python is that
there are many packages available which can be installed easily by
means of setuptools. Today I installed Jython, because I'm thinking of
integrating some Python code into a web application which will be
hosted on a w
Steven D'Aprano writes:
> Consider the following common exception handling idiom:
>
> def func(iterable):
> it = iter(iterable)
> try:
> x = next(it)
> except StopIteration:
> raise ValueError("can't process empty iterable")
> print(x)
Not exactly what you're look
Best site for management careers. Career in Management.
http://jobscore.webs.com/executivemanager.htm
http://topcareer.webs.com/businessmanagement.htm
Chances for banking career listing to all over cites person can get
work as bank employee.
http://rojgars1.webs.com/gov.htm http://printmediajobs.w
Steven D'Aprano wrote:
> Consider the following common exception handling idiom:
>
> def func(iterable):
> it = iter(iterable)
> try:
> x = next(it)
> except StopIteration:
> raise ValueError("can't process empty iterable")
> print(x)
>
> The intention is:
>
> *
Steven D'Aprano writes:
> On Thu, 02 Dec 2010 16:35:08 +, Mark Wooding wrote:
> > There are better ways to handle errors than Python's exception system.
>
> I'm curious -- what ways would they be?
The most obvious improvement is resumable exceptions.
In general, recovering from an exception
On 2 dez, 15:06, Xah Lee wrote:
> discovered this rather late.
>
> Google has a AI Challenge: planet wars.http://ai-contest.com/index.php
>
> it started sometimes 2 months ago and ended first this month.
>
> the winner is Gábor Melis, with his code written in lisp.
>
> Congrats lispers!
>
> Gábor
Am 03.12.2010 14:53, schrieb Jean-Michel Pichavant:
> Next time I promise to look at the doc before actually asking the
> question here :)
You are misinterpreting the excerpt. You are right that the id of an
object doesn't change during the lifetime of a Python process and as
long as it stays ins
Hello,
We are currently working on a project which needs video and audio
streaming(peer to peer). We need to know if there are any available open
source libraries to embed video,audio,p2p transfer in our client OR if there
is any available framework which could help us with our project. It would
Peter Otten <__pete...@web.de> writes:
>> Note that StopIteration is an internal detail of no relevance whatsoever
>> to the caller. Expose this is unnecessary at best and confusing at worst.
>
> http://mail.python.org/pipermail/python-list/2010-October/1258606.html
> http://mail.python.org/piperm
erikj writes:
> If my understanding is correct, the sys.prefix variable holds the root
> directory python uses to find related files, and eg its site-packages.
>
> the value of sys.prefix is specified at compile time.
>
> it seems that on windows, when I build/install python at one location,
> an
Hrvoje Niksic wrote:
> Peter Otten <__pete...@web.de> writes:
>
>>> Note that StopIteration is an internal detail of no relevance whatsoever
>>> to the caller. Expose this is unnecessary at best and confusing at
>>> worst.
>>
>> http://mail.python.org/pipermail/python-list/2010-October/1258606.ht
Hi.
I use Python 3.1 and Tkinter.ttk 8.5 on Ubuntu 9.10.
CODE:
module:FMain.py
from tkinter import ttk
from FSecondWindow import *
class App:
def __init__(self,master):
button1 = ttk.Button(master,text='Show
TopLevel',command=lam
On Fri, 03 Dec 2010 14:31:43 +, Mark Wooding wrote:
> The most obvious improvement is resumable exceptions.
This is probably what I had in mind but I just couldn't explain it the
way you did below.
>
> In general, recovering from an exceptional condition requires three
> activities:
>
>
How can you determine the next open row in an existing Excel file such
that you can start adding data to the cells in that row? As in below,
I want a variable in place of the 6 (row 6 in the four ws1.Cells(x,1)
lines), but have no other way of knowing what row I am on besides
looking to the first
On Thu, 02 Dec 2010 17:33:47 -0800, Aahz wrote:
> Please demonstrate that using ``if`` blocks for True/False is impler and
> cleaner than using ``try`` blocks to handle exceptions.
It is my personal preference and coding style for certain situations I
encounter in my own programs and not somethi
Steven D'Aprano writes:
> def func(iterable):
> it = iter(iterable)
> failed = False
> try:
> x = next(it)
> except StopIteration:
> failed = True
> if failed:
> raise ValueError("can't process empty iterable")
> print(x)
Untested:
from itertoo
On 12/3/2010 6:31 AM Mark Wooding said...
It's easy to show that a resumable exception system can do everything
that a nonresumable system (like Python's) can do (simply put all of the
recovery logic at the resume point); but the converse is not true.
There are some other fringe benefits to res
did you fix it? I have the same problem
--
http://mail.python.org/mailman/listinfo/python-list
I have a couple of questions regarding assigning to an instance's
__class__ attribute.
The first is illustrated by the following interaction. First I
define an empty class:
>>> class Spam(object): pass
...
Now I define an instance of Spam and an instance of Spam's superclass:
>>> x = Spam()
Peter Otten wrote:
> http://mail.python.org/pipermail/python-list/2010-October/1258606.html
http://mail.python.org/pipermail/python-list/2010-October/1259024.html
I found #6210 on bugs.python.org -- does anyone know if there are any
others regarding this issue? Or any progress on MRAB's idea
Peter Otten wrote:
Hrvoje Niksic wrote:
Peter Otten <__pete...@web.de> writes:
Note that StopIteration is an internal detail of no relevance whatsoever
to the caller. Expose this is unnecessary at best and confusing at
worst.
http://mail.python.org/pipermail/python-list/2010-October/1258606.
I tried install a Python - would the word be "package"? - on Ubuntu
10.10. Could you tell me how to fix? I would be grateful, is it a path
problem? Thanks. Lee
gi...@giga1:~/Desktop/pykhtml-0.2$ sudo python setup.py install
[sudo] password for giga1:
running install
running build
running build_py
On 12/3/10 1:28 PM, kj wrote:
I have a couple of questions regarding assigning to an instance's
__class__ attribute.
The first is illustrated by the following interaction. First I
define an empty class:
class Spam(object): pass
...
Now I define an instance of Spam and an instance of Spam'
kj writes:
> I have a couple of questions regarding assigning to an instance's
> __class__ attribute.
>
> The first is illustrated by the following interaction. First I
> define an empty class:
>
class Spam(object): pass
> ...
>
> Now I define an instance of Spam and an instance of Spam's
In article ,
Harishankar wrote:
>On Thu, 02 Dec 2010 17:33:47 -0800, Aahz wrote:
>>
>> Please demonstrate that using ``if`` blocks for True/False is impler and
>> cleaner than using ``try`` blocks to handle exceptions.
>
>It is my personal preference and coding style for certain situations I
>en
Hi,
i was having a problem with class attributes initiated outside of
__init__. This code is a demonstration of what i mean:
class A():
mylist = []
def __init__(self):
self.mylist.append(1)
pass
class B(A):
def __init__(self):
A.__init__(self)
self.
OAN writes:
> Hi,
>
> i was having a problem with class attributes initiated outside of
> __init__. This code is a demonstration of what i mean:
>
> class A():
> mylist = []
> def __init__(self):
> self.mylist.append(1)
> pass
>
> class B(A):
> def __init__(self):
>
kj writes:
> >>> class Spam(object): pass
>
> Now I define an instance of Spam and an instance of Spam's superclass:
> >>> x = Spam()
> >>> y = Spam.__mro__[1]() # (btw, is there a less uncouth way to do this???)
There's the `__bases__' attribute, which is simply a tuple of the
class's direct su
On Fri, 03 Dec 2010 22:54:19 +0100, OAN wrote:
> Hi,
>
> i was having a problem with class attributes initiated outside of
> __init__. This code is a demonstration of what i mean:
[...]
> I would expect the following result:
>
> v: [1]
> x: [1, 2]
> y: [1, 2]
> z: [1]
> v: [1]
>
> Who wouldn't,
On Fri, 03 Dec 2010 19:28:00 +, kj wrote:
> This was the first surprise for me: assigning to the __class__ attribute
> not only isn't vetoed, but in fact changes the instances class:
>
> Oh-ky...
>
> First question: how kosher is this sort of class transmutation through
> assignment to _
On Fri, 03 Dec 2010 10:15:58 -0800, Paul Rubin wrote:
> Steven D'Aprano writes:
>> def func(iterable):
>> it = iter(iterable)
>> failed = False
>> try:
>> x = next(it)
>> except StopIteration:
>> failed = True
>> if failed:
>> raise ValueError("can't pr
El 02/12/10 19:04, Pau Cervera escribió:
> Ni idea de Tkinter, pero ¿no puedes almacenar *valor* en una variable de
> instancia de App y convertir la función *muestra* en un método de la classe
> App que teng aceso a las variables de instancia de App?
>
> -
> Pau
>
> Python..., what else?
>
On Fri, 03 Dec 2010 16:26:19 +0100, Hrvoje Niksic wrote:
> Peter Otten <__pete...@web.de> writes:
>
>>> Note that StopIteration is an internal detail of no relevance
>>> whatsoever to the caller. Expose this is unnecessary at best and
>>> confusing at worst.
>>
>> http://mail.python.org/pipermail
On Fri, 03 Dec 2010 17:08:38 +0100, Peter Otten wrote:
> After rereading the original post I still don't get why the workarounds
> provided in those links aren't worth considering.
The first work-around:
http://mail.python.org/pipermail/python-list/2010-October/1258606.html
is unsuitable beca
On Fri, 03 Dec 2010 12:27:04 -0800, goldtech wrote:
> I tried install a Python - would the word be "package"? - on Ubuntu
> 10.10. Could you tell me how to fix? I would be grateful, is it a path
> problem? Thanks. Lee
That looks to me like either a missing dependency, or a bug in the
package.
I
On Dec 3, 2:12 am, Tim Harig wrote:
> Actually, I thought that debate was resolved years ago. I cannot think of
> a single recently developed programming language that does not provide
> exception handling mechanisms because they have been proven more reliable.
Google's Go lacks exceptions and I
On Dec 2, 12:06 pm, Xah Lee wrote:
> discovered this rather late.
>
> Google has a AI Challenge: planet wars.http://ai-contest.com/index.php
>
> it started sometimes 2 months ago and ended first this month.
>
> the winner is Gábor Melis, with his code written in lisp.
>
> Congrats lispers!
>
> Gáb
On 2010-12-04, alex23 wrote:
> On Dec 3, 2:12 am, Tim Harig wrote:
>> Actually, I thought that debate was resolved years ago. I cannot think of
>> a single recently developed programming language that does not provide
>> exception handling mechanisms because they have been proven more reliable.
On 2010-12-03, Harishankar wrote:
> On Fri, 03 Dec 2010 14:31:43 +, Mark Wooding wrote:
>> In general, recovering from an exceptional condition requires three
>> activities:
>>
>> * doing something about the condition so that the program can continue
>> running;
>>
>> * identifying s
> > Gábor wrote a blog about it
> > herehttp://quotenil.com/Planet-Wars-Post-Mortem.html
http://presstv.ir/detail/153770.html
It is said in the protocols to corrupt the minds of the GOYIM by
alcohol
gambling
games <-
pornography
adulteries
sex
Watch the photo and proof of isra
On Dec 3, 8:56 pm, small Pox wrote:
> > > Gábor wrote a blog about it
> > > herehttp://quotenil.com/Planet-Wars-Post-Mortem.html
>
> http://presstv.ir/detail/153770.html
>
> It is said in the protocols to corrupt the minds of the GOYIM by
>
> alcohol
> gambling
> games <-
> porno
On Dec 3, 8:56 pm, small Pox wrote:
> > > Gábor wrote a blog about it
> > > herehttp://quotenil.com/Planet-Wars-Post-Mortem.html
>
> http://presstv.ir/detail/153770.html
>
> It is said in the protocols to corrupt the minds of the GOYIM by
>
> alcohol
> gambling
> games <-
> porno
Rules :
@1@ No execution of the function, only checking syntax
@2@ No profiling using a debugger or profiler
@3@ Editing allowed to make simpler variables
(defun unknown-function (nano-thermite-911-FBI-fat-per-diem-bustards-
kept-their-odious-mouth-shut-on-anthrax-and-911-lie)
(let (BERNA
53 matches
Mail list logo