Chris Rebert wrote:
On Sat, May 21, 2011 at 11:32 PM, James Stroud wrote:
Chris Rebert wrote:
WTF?
Assuming your question is "Why is 1024 there twice?", the answer is
The question is "Why is 1024 there at all?" It should be 10.
Ah. This is why it's better to be
Peter Otten wrote:
James Stroud wrote:
WTF?
Put the code into a file, run it -- and be enlightened ;)
Compare the follower to the last.
tal 77% cat eraseme.py
#! /usr/bin/env python
class C:
def __init__(self):
self.data = []
def doit(self, count=[0]):
for c in self.data
James Stroud wrote:
Chris Rebert wrote:
WTF?
Assuming your question is "Why is 1024 there twice?", the answer is
The question is "Why is 1024 there at all?" It should be 10.
James
I mean 11, not 10--but you get the point.
James
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
James Stroud wrote:
WTF?
Put the code into a file, run it -- and be enlightened ;)
tal 72% python2.7 eraseme.py
1
2
4
8tal 73% cat eraseme.py
#! /usr/bin/env python
class C:
def __init__(self):
self.data = []
def doit(self, count=0):
for c in self.data
Chris Rebert wrote:
WTF?
Assuming your question is "Why is 1024 there twice?", the answer is
The question is "Why is 1024 there at all?" It should be 10.
James
--
http://mail.python.org/mailman/listinfo/python-list
tal 65% python2.7
Python 2.7.1 (r271:86832, May 21 2011, 22:52:14)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
py> class C(object):
... def __init__(self):
... self.data = []
... def doit(self, count=0):
...
Patrick Maupin wrote:
BTW, although I find it annoying when people say "don't do that" when
"that" is a perfectly good thing to do, and although I also find it
annoying when people tell you what not to do without telling you what
*to* do, and although I find the regex solution to this problem to
Manuel Graune wrote:
Hello everyone,
I am looking for ways to use a python file as a substitute for simple
pen and paper calculations. At the moment I mainly use a combination
of triple-quoted strings, exec and print (Yes, I know it's not exactly
elegant). To clarify, I just start an editor, wri
Hello All,
I want to use an s-expression based configuration file format for a
python program I'm writing. Does anyone have a favorite parser?
I'm currently using sexpy.parse() (http://pypi.python.org/pypi/sexpy)
which works very well but I don't know how secure it is. Does anyone
have exper
Steven D'Aprano wrote:
Well there you go -- why on earth would you prohibit None as a dictionary
key??? That's a serious failure.
roentgen 1% python
Python 2.5 (r25:51908, Sep 20 2006, 17:36:21)
[GCC 3.4.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
py>
Dennis Lee Bieber wrote:
On Tue, 11 Aug 2009 17:54:36 -0700, James Stroud
declaimed the following in gmane.comp.python.general:
...
py> {C():4}[C()]
Traceback (most recent call last):
File ""
Asun Friere wrote:
On Aug 12, 3:32 pm, James Stroud
wrote:
You should be more imaginative.
I'm by no means discounting that there might be some actual problem
you're trying to solve here, but I honestly can't see it.
There really is no need to get personal about this, so rat
James Stroud wrote:
> def stream_factory:
> class Line(object):
> __source = source
> __join = join
> # etc.
> return Line
>
of course I meant "def stream_factory(lines, source, join=''.join):"
James
--
http://mail.python.org/mailman/listinfo/python-list
andrew cooke wrote:
Is there a way to make this work (currently scope and join are
undefined at runtime when the inner class attributes are defined):
class _StreamFactory(object):
@staticmethod
def __call__(lines, source, join=''.join):
class Line(object):
__source
Asun Friere wrote:
Perhaps the best solution would be for the unitiated to correct their
misaprehensions
Can you come give a class to my users?
--
http://mail.python.org/mailman/listinfo/python-list
Asun Friere wrote:
On Aug 12, 12:15 pm, James Stroud wrote:
I realize I left out my use. The intent of the function is to flag
objects that will make useful keys for a persistent dictionary. The
{C():4}[C()] example demonstrates why I want to avoid certain types of
keys--I don't want use
Carl Banks wrote:
On Aug 11, 5:54 pm, James Stroud wrote:
To prevent users of one of my libraries from falling into this and
similar traps (which have potentially problematic consequences),
Even so, I would consider whether some of your users might, like me,
also find this terribly useful
Hello All,
I wrote the function to test hashability of arbitrary objects. My reason
is that the built-in python (2.5) hashing is too permissive for some
uses. A symptom of this permissiveness comes from the ability to
successfully hash() arbitrary objects:
py> class C(object): pass
...
Python 2.5:
mbi136-176 211% python
*** Pasting of code with ">>>" or "..." has been enabled.
## ipython ##
###
ame widgets that might be helpful to you. There is no need to
reinvent the wheel except for your own enlightenment.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
that should terminate the event
chain. This is a general technique to stop a lot of unwanted event
propagation.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
Tim Chase wrote:
Is this where we tell you to shut up? ;-)
Don't you mean STFU?
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
mcheun...@hotmail.com wrote:
Hi all
what IDE is the best to write python?
thanks
from Peter (mcheun...@hotmail.com)
vim in one terminal, ipython in the other.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
erformance increase.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
joseph.a.mar...@gmail.com wrote:
Greetings! I've heard enough raving about Python, I'm going to see for
myself what all the praise is for!
I'm on a Mac. I use Netbeans for Java, PHP, and C if needed. Do you
even use an IDE for Python?
Any recommendations on open source Python environments?
Tha
Thomas Guettler wrote:
Sorry, I described my problem not well. Here is more information:
The main application is the intranet web application used with IE (ms windows
client).
But some action needs to be done on the client since you can't do it with html
or javascript.
1. The user pushes a bu
code isn't ready, wait for
the next interval. Use https for security and have a shared secret
message to identify legitimate clients.
If you try to push code the other way, you will need a perpetual socket
open on the client side, making the client the server.
James
--
James Strou
Astan Chee wrote:
Hi,
I have two classes in python that are in two different files/python
scripts. Class A uses Class B like this:
class B(object):
def function1(self,something):
pass
def function2(self,something):
print "hello one"
print something
class A(object):
y put the import statements in a separate module (e.g.
"importer_module" and do something like
"""another_module"""
from importer_module import module
If you simply don't want to import a bunch of modules, use an if/then
statement. In any event, I adv
D(sum(t) for t in zip(self, other))
py> p = Point3D([8, 7, 6])
py> p
Point3D([8.0, 7.0, 6.0])
py> str(p)
'Point3D([8.0, 7.0, 6.0])'
py> q = Point3D([5, 4, 3])
py> r = p + q
py> r
Point3D([13.0, 11.0, 9.0])
Now have fun with this stuff. I need t
* 10)
itlist = [make_gen(i) for i in xrange(2)]
print "what's in the bags:"
print list(islice(itlist[0], 5))
print list(islice(itlist[1], 5))
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
u start.
3. Consider PySQlite (http://trac.edgewall.org/wiki/PySqlite)
before you think about a heavyweight database backend (once
you realize that you will want a database for this project).
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Ang
r wrote:
I actually like the IDLE, but it could use a few improvements. If
anybody else has suggestions by all means post them.
1.) The text widget and the prompt(>>>) should be separated. Trying to
write a conditional in the interactive IDLE is a real PITA. Not to
mention if you copy the workin
Rob Clewley wrote:
Hi, the short version of my question is: when is a dictionary's
__contains__ method behavior different to using the 'in' idiom?
(because I have an example of a difference in my code).
Never.
Longer version: I have a user-defined class with a few overrides of
special methods
James Stroud wrote:
tk.tk.call('bind', str(lb), '', "break")
Which is equivalent to
lb.bind('', "break")
But I checked and overriding the default behavior of Listbox does not
work (tk.tk.call('bind', "Listbox", '
Roger wrote:
I'm sorry for harassing the list but any suggestions would be greatly
appreciated. =)
I just checked the behavior you are describing. It seems that you want
to unbind the event to stop the autoscrolling when you leave the
listbox. E.g.:
from Tkinter import *
tk = Tk()
lb = Lis
James Stroud wrote:
py> b.tk.call('bind', 'Listbox', '', _)
You want b.tk.call('bind', 'Listbox', '', "") of course.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 900
'\nset tk::Priv(x) %x\nset tk::Priv(y) %y\ntk::ListboxMotion
%W [%W index @%x,%y]\n'
py> b.tk.call('bind', 'Listbox', '', _)
''
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
cue = iter(open('CDImage.cue').readlines())
It just occurred to me that this could simply be:
cue = open('CDImage.cue')
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jam
= []
for line in cue:
if line.strip().startswith('FILE'):
break
for line in cue:
if line.strip().startswith('TITLE'):
titles.append(line.split('"')[-2])
flacs = glob.glob('*.flac')
flacs.sort(key=lambda f: int(re.search(r'\d+', f).group(0
me)
top = '.'
suffix = '.jpg'
os.path.walk(top, doit, suffix)
Read the docs on os.path.walk, of course.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
acooke@gmail.com wrote:
Hi,
(I searched back and found some previous discussion on generator
attributes that seemed to be related to callable generators - this is
NOT that, as far as I can tell)
I want to associate some data with a generator. This is in a
decorator function, as it happens;
Ben Finney wrote:
Why are people so reluctant to make error message templates clearer
with named placeholders?
Because they can never remember they even exist. Thanks for the reminder.
--
http://mail.python.org/mailman/listinfo/python-list
Adal Chiriliuc wrote:
Hello,
Me and my colleagues are having an discussion about the best way to
code a function (more Pythonic).
Here is the offending function:
def find(field, order):
if not isinstance(order, bool):
raise ValueError("order must be a bool")
order_by = "asc" if
Ken D'Ambrosio wrote:
Hi, all. As a recovering Perl guy,
[snip]
In Perl, I'd so something like
m/^1(...)(...)/;
Indeed it seems you are recovering from an especially bad case. I
recommend two doses of the python cookbook per day for one to two
months. Report back here after your first
James Stroud wrote:
If you check out sf.passerby.net and download the source, you will see a
passerby.sf.net
Shuffle things I did.
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
Oltmans wrote:
I'm writing a program in which I will ask users to enter user name and
password once only. It's a console based program that will run on
Windows XP. Actually, I'm trying to provide the similar functionality
as "Remember me" thing in b
Oltmans wrote:
I'm writing a program in which I will ask users to enter user name and
password once only. It's a console based program that will run on
Windows XP. Actually, I'm trying to provide the similar functionality
as "Remember me" thing in browsers. For that, I will need to store
user nam
likely morally unjust--but I can't stand
antisemitism just like I can't stand hatred of Islam just like I can't
stand hatred of Christians.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
akineko wrote:
Hello everyone,
I'm creating a class which is subclassed from list (Bulit-in type).
It works great.
However, I'm having a hard time finding a way to set a new value to
the object (within the class).
There are methods that alter a part of the object (ex. __setitem__()).
But I coul
Steven Woody wrote:
On Tue, Jan 6, 2009 at 4:42 PM, James Stroud wrote:
py> import __builtin__
py> __builtin__.abs is abs
True
Does that mean someone did 'import * from __builtin__' when python startup?
In terms of the exact implementation of the cPython interpreter, I
True
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
#x27;d like to explore of matplotlib and never
had time to do?
I want to program a lot of interactivity with the plots in my current
application.
Your suggestions are really appreciated :) And wish me good luck!
Good luck! I can't wait to read your book!
James
--
James Stroud
UCLA-
James Stroud wrote:
py> a = [1, 2, 3]
py> a1 = a
py> a1[:] = [x*3 for x in a1]
py> a1
[3, 6, 9]
py> a1
[3, 6, 9]
This should have been:
py> a = [1, 2, 3]
py> a1 = a
py> a1[:] = [x*3 for x in a1]
py> a
[3, 6, 9]
py> a1
[3, 6, 9]
James
--
James
py> a = [1, 2, 3]
py> a1 = a
py> a1
[1, 2, 3]
py> a1 = [x*3 for x in a1]
py> a1
[3, 6, 9]
py> a
[1, 2, 3]
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
Stef Mientki wrote:
hello,
Is there a function to remove escape characters from a string ?
(preferable all escape characters except "\n").
thanks,
Stef
import string
WANTED = string.printable[:-5] + "\n"
def descape(s, w=WANTED):
return "".join(c for c in s
ying pedantry that has made
usenet great:
http://docs.python.org/dev/3.0/whatsnew/3.0.html#views-and-iterators-instead-of-lists
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
']
['WTF?', 'WTF?', 'WTF?', 'WTF?', 'WTF?', 'WTF?', 'WTF?', 'WTF?', 'WTF?']
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
Thanks to Barry Warsaw the "On Your Desktop" blog now has a new entry:
Note the thumb trackball. It's the shiznizzle. Give one two weeks of
your patience and you'll seriously consider having it implanted in your
thigh so you don't have to worry about missing it when you tr
playover = input("PLAY AGAIN? Y/N: ")
if playover.strip().lower() == "y":
game['play'] = 1
setup(game)
else:
print("GOOD BYE. PLAY AGAIN SOON!")
quit()
Notice that I just made return values obsolete.
You will also
Ben Finney wrote:
James Stroud writes:
Ben Finney wrote:
James Stroud writes:
Yes. I think it was the British who decided that the apostrophe
rule for "it" would be reversed from normal usage relative to
just about every other noun.
It also seems an indefensible claim to say t
I V wrote:
On Sun, 14 Dec 2008 21:08:33 -0800, James Stroud wrote:
Yes. I think it was the British who decided that the apostrophe rule for
"it" would be reversed from normal usage relative to just about every
other noun. I'm not sure the purpose--maybe it was to give compulsive
Ben Finney wrote:
James Stroud writes:
Yes. I think it was the British who decided that the apostrophe rule
for "it" would be reversed from normal usage relative to just about
every other noun.
Remember that “it” is a pronoun. I see no reversal:
Ok. Pronouns are reversed.
Aahz wrote:
In article ,
James Stroud wrote:
In case its not obvious:
Ah, so that's where Bruno's extra apostrophe came from! ;-)
(Sorry about the spelling flame, but seeing three posts in quick
succession with incorrect spelling of its/it's pushed me into making a
public
James Stroud wrote:
inspect.stack()[1][0].f_locals[name] = val
I just double checked this. Because of the way locals are implemented in
cPython, this won't have the desired affect.
James
--
http://mail.python.org/mailman/listinfo/python-list
drobi...@gmail.com wrote:
I'm baffled by this discussion.
What's wrong with
a, dontcare, dontcare2 = f()
a = a + 1
Simple, clear, and correct.
1. This can't apply to a generalized f() that may return an arbitrary
number of arguments >= len(num_assignments_you_care_about).
2. The examp
James Stroud wrote:
py> class mytuple(tuple):
def magic(self, astr):
names = astr.split()
for name, val in zip(names, self):
globals()[name] = val
...
py> t = mytuple((1,2,3))
py> t.magic('a b')
py> a
1
py> b
2
James
In case its not obvious:
def f()
Paul Moore wrote:
I'm translating some code from another language (Lua) which has
multiple function return values. So, In Lua, it's possible to define a
function
function f()
return 1,2,3
end
which returns 3 values. These can then be used/assigned by the caller:
a,b,c = f()
It looks much better. But as Bruno suggests and as I alluded to earlier,
you should get in the habit of forming verification loops on input
channels that aren't already guaranteed to provide valid input messages.
I'm not sure how to say that in English, but in python my example was:
while True
Steven D'Aprano wrote:
class Parrot:
def __init__(self, *args):
print "Initialising instance..."
if __debug__:
self.verify() # check internal program state, not args
if __debug__:
def verify(self):
print "Verifying..."
+1 It looks good to
James Stroud wrote:
Be assured that it takes on special intelligence to write unintelligible
I meant "*no* special intelligence".
--
http://mail.python.org/mailman/listinfo/python-list
feba wrote:
This is what I have so far. better? worse?
Much better. I didn't check if it works. But you need to figure out a
way to give up on your reliance on global variables. They will end up
stifling you in the long run when you move to substantial projects.
Also, you should start movin
uot;)
quit()
else:
target = random.randint(1, 99)
else:
print("TOO LOW")
return target
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
1. Refactor. You should look at your code and see where you repeat the
same or similar patterns, see where they differ, make functions, and
make the differences parameters to the function call:
def guess(player, p1score, p2score):
guess1 = int(input("\n>> &quo
premature optimization", but simply good coding style [ed: put in to
fend off the "premature optimization is bad" puppets who infest this list].
Notice that the sequence of commands follows a logical sequence
corresponding to decisions in the game. It makes the code more sensible,
readable, and a little faster some times to boot. Good logic has the
happy consequence of good speed most of the time.
My code is typed real-time so is untested. No promise that there aren't
typos but you will probably get the idea. But see if you can plug the
these functions into the proper places and apply some of these techniques.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
Ethan Furman wrote:
Greetings List!
I'm writing a wrapper to the datetime.date module to support having no
date. Its intended use is to hold a date value from a dbf file, which
can be empty.
The class is functional at this point, but there is one thing I would
like to change -- datetime.da
JD wrote:
I got a iterated function like this:
def iterSomething(list):
has_something = False
for cell in list:
if something in cell:
has_something = True
output = something
if has_something:
iterSomething(output)
else:
final_out = outu
iterator without requiring making a list, you can simply
use parentheses instead of brackets:
agenerator = (v for f, v in izip(bar, foo) if not f(v))
This is perfectly lazy but not immune to problems when foo or bar is
changed before the generator is fully consumed.
James
--
James Stroud
Robert Kern wrote:
James Stroud wrote:
I think it skips straight to __eq__ if the element is not the first in
the list.
No, it doesn't skip straight to __eq__(). "y is 1" returns False, so
(y==1) is checked. When y is a numpy array, this returns an array of
bools. list.__con
Robert Kern wrote:
James Stroud wrote:
py> 112 = [1, y]
py> y in 112
Traceback (most recent call last):
File "", line 1, in
ValueError: The truth value of an array with more than one element is...
but not
py> ll1 = [y,1]
py> y in ll1
True
It's this discrepancy
Robert Kern wrote:
James Stroud wrote:
I'm missing how a.all() solves the problem Rasmus describes, namely
that the order of a python *list* affects the results of containment
tests by numpy.array. E.g. "y in ll1" and "y in ll2" evaluate to
different results in hi
Steven D'Aprano wrote:
On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote:
Rasmus Fogh wrote:
ll1 = [y,1]
y in ll1
True
ll2 = [1,y]
y in ll2
Traceback (most recent call last):
File "", line 1, in
ValueError: The truth value of an array with more than one element is
James Stroud wrote:
[cast to bool] for numpy works like a unary ufunc.
Scratch that. Not thinking and typing at same time.
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo
vior should be for comparisons. I think the probability of
that happening is about zero, though, because such a change would run
counter to the dynamic nature of the language.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
Luis Zarrabeitia wrote:
Quoting James Stroud <[EMAIL PROTECTED]>:
First, here is why the ability to throw an error is a feature:
class Apple(object):
def __init__(self, appleness):
self.appleness = appleness
def __cmp__(self, other):
assert isinstance(other, Apple),
of complex numbers: would 4 + 4i be equal to sqrt(32)?
Even in the realm of pure mathematics, the generality of objects (i.e.
numbers) can not be assumed.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http:
suku wrote:
HI folks...
i need some suggestion on making graphs. Will this be possible
with normal python setup file or do i need to download add ons for
that..
help me out
I like pychart. It has the advantage of being pure python and makes very
nice looking plots. You might also
James Stroud wrote:
def linear_search(array, truth_func, loc=(0,0)):
idx1, idx2 = loc
if idx1 >= len(array):
return None
if idx2 >= len(array[idx1]):
return linear_search(array, truth_func, (idx1+1, 0))
value = array[idx1][idx2]
tf = truth_func(value)
if tf:
retu
[EMAIL PROTECTED] wrote:
I'm trying to solve the 9-tile puzzle using as functional an approach
as possible. I've recently finished reading SICP and am deliberately
avoiding easy python-isms for the more convoluted scheme/functional
methods. The following function is trivial to do with for loops
macc_200 wrote:
Hi,
just starting programming and have an elementary question after
playing around with lists but cannot find the answer with googling.
I have a list of variables and I would like some of those variables to
be integers and some to be operators so the list would look something
l
Steven D'Aprano wrote:
On Fri, 05 Dec 2008 20:35:07 -0800, James Stroud wrote:
Daniel Fetchinson wrote:
I'd like this new way of defining methods, what do you guys think?
Consider the maverick who insists on
class C:
def me.method(arg):
self.value = arg
Replace "
Of course I meant
class C:
def me.method(arg):
me.value = arg
James
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Fetchinson wrote:
http://neopythonic.blogspot.com/2008/10/why-explicit-self-has-to-stay.html
The proposal is to allow this:
class C:
def self.method( arg ):
self.value = arg
return self.value
instead of this:
class C:
def method( self, arg ):
self.value
alex23 wrote:
On Dec 6, 8:00 am, James Stroud <[EMAIL PROTECTED]> wrote:
I think its a symptom of the language's
maturing, getting popular, and a minority fraction* of the language's
most devout advocates developing an egotism that complements their
python worship in a most unsa
James Stroud wrote:
Terry Reedy wrote:
because there is no bug to fix. I have suggesting closing.
May I suggest to add something to this effect within the issue itself so
others won't spend time trying to figure out why the "bug" is still
open?
Sorry, you did that.
Terry Reedy wrote:
because there is no bug to fix. I have suggesting closing.
May I suggest to add something to this effect within the issue itself so
others won't spend time trying to figure out why the "bug" is still
open? If this is a more general feature of issues, then perhaps it would
Andreas Waldenburger wrote:
Is it me, or has c.l.p. developed a slightly harsher tone recently?
(Haven't been following for a while.)
Yep. I can only post here for about a week or two until someone blows a
cylinder and gets ugly because they interpreted something I said as a
criticism of the
James Stroud wrote:
Hello All,
I subclassed dict and overrode __setitem__. When instances are
unpickled, the __setstate__ is not called before the keys are assigned
via __setitem__ in the unpickling protocol.
I googled a bit and found that this a bug filed in 2003:
http://bugs.python.org
ing'
I'm still using python 2.5.1.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com
--
http://mail.python.org/mailman/listinfo/python-list
Barry Warsaw wrote:
On behalf of the Python development team and the Python community, I am
happy to announce the release of Python 3.0 final.
comp.lang.python3k ?
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 1138 matches
Mail list logo