Marco Bizzarri wrote:
I understand that Python is a balance between different forces (like
any software object around the world) and I'm simply asking some
pointers to the discussion leading to this balance.
The original decisions by Guido were nearly 20 years ago and other
discussions are
On Thu, Sep 4, 2008 at 7:15 PM, Timothy Grant [EMAIL PROTECTED] wrote:
I think the most obvious solution to the problem is effective unit
tests. If you type a.y =1 and have a test that asserts a.x == 1 then
you would quite quickly discover that you made a typo.
--
Stand Fast,
tjg.
Ivan Illarionov schrieb:
On 4 сент, 21:49, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Ivan Illarionov a écrit :
On 4 сент, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
On 5 сент, 19:23, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Ivan Illarionov schrieb:
On 4 сент, 21:49, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Ivan Illarionov a écrit :
On 4 сент, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
Let's say I've a class a, where I can write:
--
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Marco Bizzarri wrote:
Let's say I've a class a, where I can write:
Anticipating this obviously premature posting:
http://dirtsimple.org/2004/12/python-is-not-java.html
Diez
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Sep 4, 2008 at 1:00 PM, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Marco Bizzarri wrote:
Let's say I've a class a, where I can write:
Anticipating this obviously premature posting:
http://dirtsimple.org/2004/12/python-is-not-java.html
Diez
--
Sorry... pressed enter but really didn't want to.
As I said, let's say I have a class
class A:
def __init__(self):
self.x = None
Python makes the decision to allow the developers to directly access
the attribute x, so that they can directly write: a.x = 1, or
whatever; this has
Of course, I know that while I'm fresh, I've a good knowledge of the
code, and anything else, I will be able to avoid such stupid errors;
however, I'm afraid of the times when I'm tired, when I have to put my
hands on the code of someone else, and so on.
Please, understand that I'm not
Marco Bizzarri a écrit :
Sorry... pressed enter but really didn't want to.
As I said, let's say I have a class
class A:
def __init__(self):
self.x = None
Python makes the decision to allow the developers to directly access
the attribute x,
So do Java, if you make your
On Thu, Sep 4, 2008 at 1:19 PM, Diez B. Roggisch [EMAIL PROTECTED] wrote:
What you are essentially asking is: why is python dynamic instead of static?
Most probably you're right. Maybe I will make a trip back to my
university books and take a look at them again :-)
Thanks
Marco
--
Marco
On Thu, Sep 4, 2008 at 4:39 PM, Marco Bizzarri [EMAIL PROTECTED] wrote:
Most probably you're right. Maybe I will make a trip back to my
university books and take a look at them again :-)
Meant: you *are* right. Sorry.
Saluti
Marco
--
Marco Bizzarri
http://notenotturne.blogspot.com/
On Sep 4, 7:09 am, Marco Bizzarri [EMAIL PROTECTED] wrote:
Sorry... pressed enter but really didn't want to.
As I said, let's say I have a class
class A:
def __init__(self):
self.x = None
Python makes the decision to allow the developers to directly access
the attribute x,
On Thu, Sep 4, 2008 at 4:09 AM, Marco Bizzarri [EMAIL PROTECTED] wrote:
Sorry... pressed enter but really didn't want to.
As I said, let's say I have a class
class A:
def __init__(self):
self.x = None
Python makes the decision to allow the developers to directly access
the
On Sep 4, 7:09 am, Marco Bizzarri [EMAIL PROTECTED] wrote:
Sorry... pressed enter but really didn't want to.
As I said, let's say I have a class
class A:
def __init__(self):
self.x = None
Python makes the decision to allow the developers to directly access
the attribute x,
On 4 сент, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
if attr not in self.legal:
raise AttributeError(A object has no attribute '%s' %
attr)
Ivan Illarionov a écrit :
On 4 сент, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
if attr not in self.legal:
raise AttributeError(A object has no attribute
On 4 сент, 21:49, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Ivan Illarionov a écrit :
On 4 сент, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
if attr
Ivan Illarionov a écrit :
On 4 сент, 21:49, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Ivan Illarionov a écrit :
On 4 сент, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
On Sep 4, 3:15 pm, Ivan Illarionov [EMAIL PROTECTED] wrote:
On 4 ÓÅÎÔ, 22:59, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
if attr not in self.legal:
raise
On Thu, Sep 4, 2008 at 8:59 PM, Carl Banks [EMAIL PROTECTED] wrote:
You can write code to guard against this if you want:
class A:
legal = set([x])
def __setattr__(self,attr,val):
if attr not in self.legal:
raise AttributeError(A object has no attribute '%s' %
21 matches
Mail list logo