Raymond Hettinger:
> Any takers for tally()?
Dunno, to me "tally" reads "counts the numbers of votes for a candidate
in an election".
> We should avoid abbreviations like inc() or incr() that different
people tend to
> abbreviate differently (for example, that is why the new partial()
function ha
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes:
> > Any takers for tally()?
>
> Well, as a non-native speaker, I had to look up this one in my
> dictionary. That said, it may be bad luck on my side, but it may be that
> this word is relatively uncommon and there are many others who would be
> happ
> Py2.5 is already going to include any() and all() as builtins. The
signature
> does not include a function, identity or otherwise. Instead, the caller
can
> write a listcomp or genexp that evaluates to True or False:
>
> any(x >= 42 for x in data)
>
> If you wanted an identify function, tha
[Michele Simionato]
> Dunno, to me "tally" reads "counts the numbers of votes for a candidate
> in an election".
That isn't a pleasant image ;-)
>The
> only right name would be "get_and_possibly_set" but it is a bit long to
> type.
>
>> Even if a wording is found that better describes the both
I'm dealing with XML files in which there are lots of tags of the
following form: xy (all of these letters are being
used as 'metalinguistic variables') Not all of the tags in the file are
of that form, but that's the only type of tag I'm interested in. (For
the insatiably curious, I'm talking abo
> > Py2.5 is already going to include any() and all() as builtins. The
> > signature does not include a function, identity or otherwise.
> > Instead, the caller can
> > write a listcomp or genexp that evaluates to True or False:
> >
> > any(x >= 42 for x in data)
[Roose]
> Oh great, I just s
Diez B. Roggisch wrote:
> Peter Moscatt wrote:
>> UnboundLocalError: local variable '_nntp' referenced before assignment
>
> This pretty much says what your problem is: you haven't a variable called
> _nntp
>
>> def callconnect():
>> if b["text"]=="Connect":
>> _nntp =
>>
> Py2.5 is already going to include any() and all() as builtins. The
signature
> does not include a function, identity or otherwise. Instead, the caller
can
> write a listcomp or genexp that evaluates to True or False:
Actually I was just looking at Python 2.5 docs since you mentioned this.
htt
Noah wrote:
The problem is that my users want to see .sit files.
I know it's sort of silly. Zip files are foreign and frightening to
them.
Would Stuffit open zip files renamed to .sit?
--
http://mail.python.org/mailman/listinfo/python-list
Hi List, is there in python a variable variable like in PHP ($$var)?
What I want to do is something like that:
pc=["a","b","c"]
for i in pc:
i = anyclass()
a.shutdown()
b.update()
Any Ideas?
Many Thanks, m
--
http://mail.python.org/mailman/listinfo/python-list
Roose wrote:
> Not to belabor the point, but in the example on that page, max(L, key=len)
> could be written max(len(x) for x in L).
No, it can't:
Python 2.5a0 (#2, Mar 5 2005, 17:44:37)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>
"James Kew" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
Thanks James, a perfect patch that works perfect for me.
On a side note, it seems the locator is not standarized. expat gives
positions at the "<"-char of startElement while xmlproc (PyXml) gives
it the ">"-char of start
Ok i have a wxFrame with a wxNotebook that has two wxPanels, lets call
them panel_1 and panel_2
i have wxTextCtrl in panel_1 (call it panel_1_ctrl) that i want the
user to be able to fill up. I then want the user to be able to click a
button (i.e. create an EVT) and have Value() of panel_1_ctrl be
[Roose]
> Actually I was just looking at Python 2.5 docs since you mentioned this.
>
> http://www.python.org/dev/doc/devel/whatsnew/node3.html
>
> It says min() and max() will gain a key function parameter, and sort()
> gained one in Python 2.4 (news to me).
It also appears in itertools.groupby()
Tanteauguri wrote:
Hi List, is there in python a variable variable like in PHP ($$var)?
What I want to do is something like that:
pc=["a","b","c"]
for i in pc:
i = anyclass()
a.shutdown()
b.update()
Use a dictionary:
stuff = {}
pc = ['a', 'b', 'c']
for i in pc:
stuff[i] = anyclass()
stuff['
On Sat, 19 Mar 2005 04:35:47 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote:
> Tanteauguri wrote:
> > Hi List, is there in python a variable variable like in PHP ($$var)?
> >
> > What I want to do is something like that:
> >
> > pc=["a","b","c"]
> >
> > for i in pc:
> > i = anyclass()
> >
> > a
Thanks everybody for their replies.
Lorenzo
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] napisał(a):
I've narrowed down my toolkit selection for my project to wxPython and
pyQt, and now i'd like to hear any opinions, war stories, peeves, etc,
about them, particularly from anyone who's used _both_toolkits_. I'm
only mildly interested in the IDEs and UI designers for ea
On Sat, 19 Mar 2005 01:24:57 GMT, "Raymond Hettinger"
<[EMAIL PROTECTED]> wrote:
>I would like to get everyone's thoughts on two new dictionary methods:
>
>def count(self, value, qty=1):
>try:
>self[key] += qty
>except KeyError:
>self[
Sean McIlroy wrote:
> I'm dealing with XML files in which there are lots of tags of the
> following form: xy (all of these letters are being
> used as 'metalinguistic variables') Not all of the tags in the file are
> of that form, but that's the only type of tag I'm interested in. (For
> the insat
Tanteauguri wrote:
> Hi List, is there in python a variable variable like in PHP ($$var)?
>
> What I want to do is something like that:
>
> pc=["a","b","c"]
>
> for i in pc:
> i = anyclass()
>
> a.shutdown()
> b.update()
>
>
> Any Ideas?
def seq(n,cls,*args,**kw):
"create a sequence of
What seems to be the matter?
>>> path =
"C:\\eclipse\\workspace\\moin134\\docbook\\xslt\\html\\db_compiled.dat"
>>> f = file(path)
>>> cPickle.load(f)
Traceback (most recent call last):
File "", line 1, in ?
ImportError: No module named on.
>>> f = file(path)
>>> pickle.load(f)
Traceback (most re
[EMAIL PROTECTED] wrote:
I've tried xmltramp and element tree, but these tools aren't what I had
in mind.
What I'm looking to use are basic structures such as:
root.path
root.input.method
root.input.filename
root.output.filename
I haven't used xmltramp but it seems to allow this style of access.
fanbanlo wrote:
What seems to be the matter?
>>> path =
"C:\\eclipse\\workspace\\moin134\\docbook\\xslt\\html\\db_compiled.dat"
>>> f = file(path)
>>> cPickle.load(f)
Traceback (most recent call last):
File "", line 1, in ?
ImportError: No module named on.
>>> f = file(path)
>>> pickle.load(
sam wrote:
Since each line of the configuration file need to be parsed into "key"
and "value" pairs, these pair of tokens need to be stored in another
list. Can I use the following operation to store these pair of tokens?
eg.
Assumed macro_hash["key"]="some key"
macro_hash["value"]="some valu
In article <[EMAIL PROTECTED]>,
Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
>Tanteauguri wrote:
>> Hi List, is there in python a variable variable like in PHP ($$var)?
>>
>> What I want to do is something like that:
>>
>> pc=["a","b","c"]
>>
>> for i in pc:
>> i = anyclass()
>>
>> a.shutdown()
>
Bengt Richter wrote:
On Sat, 19 Mar 2005 01:24:57 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
I would like to get everyone's thoughts on two new dictionary methods:
def count(self, value, qty=1):
try:
self[key] += qty
except KeyError:
se
Raymond Hettinger wrote:
> I would like to get everyone's thoughts on two new dictionary
methods:
>
> def count(self, value, qty=1):
> try:
> self[key] += qty
> except KeyError:
> self[key] = qty
>
> def appendlist(self, key,
Brian van den Broek wrote:
Raymond Hettinger said unto the world upon 2005-03-18 20:24:
I would like to get everyone's thoughts on two new dictionary methods:
def appendlist(self, key, *values):
try:
self[key].extend(values)
except KeyError:
> If I used a simple INI file or CSV file, I would simply have to parse
> my file once and match the name with the value. Why is it necessary to
> parse a document once and then re-parse your information into a format
> that you can use. This seems absurd to me. Any thoughts on this? Do
> I eve
well i have gotten to the point that i can send msgs one way by passing
the to panel (panel_2 in example) as a param to __init__ of the from
panel (panel_1)
--
http://mail.python.org/mailman/listinfo/python-list
> But, by deleting their namespace entries haven't I effectively unloaded
> them? In other words, from the point of the interpreter, isn't the
No. You haven't I'm not entirely sure why - that's deep in the internals of
python - but I know for sure that reload() is not working fully as expected
in
On Sat, 19 Mar 2005 01:24:57 GMT,
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
> The proposed names could possibly be improved (perhaps tally() is more
> active and clear than count()).
Curious that in this lengthy discussion, a method name of "accumulate"
never came up. I'm not sure how to se
Ivan Van Laningham a écrit :
Hi All--
Maybe I'm not getting it, but I'd think a better name for count would be
add. As in
d.add(key)
d.add(key,-1)
d.add(key,399)
etc.
>
[...]
There is no existing add() method for dictionaries. Given the name
change, I'd like to see it.
Metta,
Ivan
I don't think "
Cappy2112 wrote:
Eric3 has been compiled for Windows, without Cygwin and Without a
commercial license
Can it be downloaded from somewhere? (where from?) Or is it forbidden by
the license?
--
http://mail.python.org/mailman/listinfo/python-list
Timothy Smith wrote:
[...] is there anyway i can check
is it true psycopg is much faster or is it all hyperboll
The overhead of psycopg per cursor row is a lot less. So it makes a
difference if you fetch *a lot* of data.
Anyway, if you don't have a performance problem, you don't need to care ;-)
Dennis Lee Bieber wrote:
You know of an assembly language that does Object Oriented?
My... The world has been waiting with bated breath for that.
Hey, IIRC, old Turbo Assembler (tasm, by Borland) had those. Much of it
was still manual, by it supported semi-automatic vtables and such :)
--
> [Jeff Epler]
> > Maybe something for sets like 'appendlist' ('unionset'?)
>
On Sat, Mar 19, 2005 at 04:18:43AM +, Raymond Hettinger wrote:
> I do not follow. Can you provide a pure python equivalent?
Here's what I had in mind:
$ python /tmp/unionset.py
Set(['set', 'self', 'since', 's', 's
Hi All--
Raymond Hettinger wrote:
>
> [Michele Simionato]
> > +1 for inc instead of count.
>
> Any takers for tally()?
>
Sure. Given the reasons for avoiding add(), tally()'s a much better
choice than count().
What about d.tally(key,0) then? Deleting the key as was suggested by
Michael Spen
[EMAIL PROTECTED] wrote:
I've been searching high and low for a way to simply convert a small
XML configuration file to Python data structures. I came across gnosis
XML tools, but need a built-in option for doing something similar.
I too needed such thing, and made this simple parser:
http://ivora
Nope, it doesn't work... I've tried that and the only thing I got was:
ImportError: could not import pango
ImportError: could not import pango
Traceback (most recent call last):
File "test.py", line 5, in ?
File "gtk\__init__.pyc", line 113, in ?
AttributeError: 'module' object has no attribut
Michele Simionato wrote:
+1 for inc instead of count.
-1 for inc, increment, or anything that carries a
connotation of *increasing* the value, so long as
the proposal allows for negative numbers to be
involved. "Incrementing by -1" is a pretty silly
picture.
+1 for add and, given the above, I'm un
Peter Hansen wrote:
> Michele Simionato wrote:
>> +1 for inc instead of count.
>
> -1 for inc, increment, or anything that carries a
> connotation of *increasing* the value, so long as
> the proposal allows for negative numbers to be
> involved. "Incrementing by -1" is a pretty silly
> picture.
>
It' s my faute that I have not read more deeply the Library
Reference...
In any case the time "wasted" in developping small applications to
number lines and remove comments, triple quoted strings, multiline
instructions etc. has been "useful" to learn the language...
Now I already have the single t
That's the Visual Basic way to do it.
I prefer it this way:
Controls work on models. If a control has to store a value it does so by
calling MyDataPool.storeMyValue(self.GetValue()).
When the NotebookPage is changed, the new page tells all controls to update
themeselves: self.SetValue(str(MyData
Hello,
Here are code snippets to create and access shared memory in Python
with and without ctypes module.
With regards,
Srijit
Filename : SharedMemCreate.py
import msvcrt, mmap
from ctypes import *
FILE_MAP_ALL_ACCESS = 0xF001F
INVALID_HANDLE_VALUE = 0x
SHMEMSIZE = 256
PAGE_READWRITE =
If I try to bind a socket to a port that's already in use I get this
error
"error socket.error: (98, 'Address already in use')"
Is there anyway to check in advance if a port i already taken?
alex
--
Alex Polite
http://flosspick.org
--
http://mail.python.org/mailman/listinfo/python-list
Hi People,
I'd like to know if exist the possibilite to build an email server
with socket and Mime ?
Tks
FX
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
Peter Hansen wrote:
+1 for add and, given the above, I'm unsure there's
a viable alternative (unless this is restricted to
positive values, or perhaps even to "+1" specifically).
What about `addto()'? add() just has the connotation of adding something
to the dict and not
is there a way to determine the operating system's language? i can't seem to
find a method that returns the value.
thanks,
bryan
--
http://mail.python.org/mailman/listinfo/python-list
Alex Polite wrote:
If I try to bind a socket to a port that's already in use I get this
error
"error socket.error: (98, 'Address already in use')"
Is there anyway to check in advance if a port i already taken?
In general in Python it's not considered good style to
"look before you leap". After all
Hello
I would need way to check the amplitude (over time) for a sound file in
python. I'm sure this can be done, for example the audioop.rms function
seems to be able return amplitude values. However, it would be really
great to get the results in dB, which does not seem to be the case.
Anyone who
[EMAIL PROTECTED] wrote:
I'd like to know if exist the possibilite to build an email server
with socket and Mime ?
You could build an email server with only the socket module,
if you wanted to.
The real puzzle is why you would want to build a mail
server from scratch when there are so many existing
[Jeff Epler]
> Maybe something for sets like 'appendlist' ('unionset'?)
While this could work and potentially be useful, I think it is better to keep
the proposal focused on the two common use cases. Adding a third would reduce
the chance of acceptance.
Also, in all of my code base, I've not run
[Dan Sommers]
> Curious that in this lengthy discussion, a method name of "accumulate"
> never came up. I'm not sure how to separate the two cases (accumulating
> scalars vs. accumulating a list), though.
Separating the two cases is essential. Also, the wording should contain strong
cues that re
I'm executing WinRK.exe in a loop using the following code:
for x in Files:
Command_String = 'C:\Program Files\WinRK\WinRK.exe -create ' +
os.path.join(InputDirectory, os.path.splitext(x)[0]) + ' -set
compression_method ppmz -setg include_paths none -add ' +
os.path.join(InputDirectory, x)
Bryan wrote:
is there a way to determine the operating system's language? i can't
seem to find a method that returns the value.
thanks,
bryan
found it myself, thanks...
>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'cp1252')
>>>
--
http://mail.python.org/mailman/listinfo/python-list
On 18 Mar 2005 21:03:52 -0800 Michele Simionato wrote:
MS> +1 for inc instead of count.
MS> appendlist seems a bit too specific (I do not use dictionaries of
MS> lists that often).
inc is too specific too.
MS> The problem with setdefault is the name, not the functionality.
The problem with func
Bengt Richter wrote:
> On 14 Mar 2005 13:07:29 -0800, "Martin Miller"
<[EMAIL PROTECTED]> wrote:
>
> >Bengt Richter wrote, in part:
> >> On 14 Mar 2005 01:19:23 -0800, "Martin Miller"
> ><[EMAIL PROTECTED]>
> >> wrote, in part:
> >> >What still puzzles me, though, is why all the above to make
> >pr
Hi All--
Raymond Hettinger wrote:
>
> Separating the two cases is essential. Also, the wording should contain
> strong
> cues that remind you of addition and of building a list.
>
> For the first, how about addup():
>
> d = {}
> for word in text.split():
> d.addup(word)
>
I
On lör, mar 19, 2005 at 10:12:10 -0500, Peter Hansen wrote:
> Alex Polite wrote:
>
> You could, for example, bind to a port of "0" and that will
> auto-assign an available port for you. Does that work
> in your case? If not, please describe what you are really
> trying to accomplish.
I'm launch
Dan Sommers wrote:
> On Sat, 19 Mar 2005 01:24:57 GMT,
> "Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
>
> > The proposed names could possibly be improved (perhaps tally() is
more
> > active and clear than count()).
>
> Curious that in this lengthy discussion, a method name of
"accumulate"
> never
How about this?
try:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
s.bind((HOST, PORT))
except socket.error, e:
if e
print "address already in use"
--
http://mail.python.org/mailman/listinfo/python-list
One reason I chose not to use ConfigParser module is that I also have a
similar config file for a MATLAB compiled program to run along with my
Python script. XML would eliminate the need to use two different style
configuration files.
Another reason is that the programmer who is writing the GUI t
[Ivan Van Laningham]
> What about adding another method, "setincrement()"?
. . .
> Not that there's any real utility in that.
That was a short lived suggestion ;-)
Also, it would entail storing an extra value in the dictionary header. That
alone would be a killer.
Raymond
--
http://mail.
-1 on set increment.
I think this makes your intent much clearer:
.d={}
.for word in text.split():
.d.tally(word)
.if word.lower() in ["a","an","the"]:
.d.tally(word,-1)
or perhaps simplest:
.d={}
.for word in text.split():
.if word.lower() not in ["a","an","the"]:
.d
In article <[EMAIL PROTECTED]>,
Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>
>The proposed names could possibly be improved (perhaps tally() is more active
>and clear than count()).
+1 tally()
--
Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/
"The joy of coding Pyth
Raymond Hettinger wrote:
> Separating the two cases is essential. Also, the wording should
contain strong
> cues that remind you of addition and of building a list.
>
> For the first, how about addup():
>
> d = {}
> for word in text.split():
> d.addup(word)
import copy
class safe
In article <[EMAIL PROTECTED]>,
Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>
>How about countkey() or tabulate()?
Those rank roughly equal to tally() for me, with a slight edge to these
two for clarity and a slight edge to tally() for conciseness.
--
Aahz ([EMAIL PROTECTED]) <*>
Bengt Richter wrote:
The first hit is
http://docs.python.org/lib/node332.html
HTH
NID (No, It Doesn't) ;-) but thanks anyway. To reiterate, the question
is how to make RotatingFileHandler do a doRotate() on startup from a
*config file*. No mention of that in what you point to.
- ro
I calling a Windows executable with PROC = subprocess.Popen('...'), and
blocking further python execution until the process terminates with
PROC.wait(). Occasionally, something unusual happens with the
subprocess, and it fails without terminating the process. When this
happens, my Python program
news.sydney.pipenetworks.com wrote:
Yeah...sorry about that. I misunderstood what node333.html was used for.
Looks like your best bet may be to extend the RotatingFileHandler
directly in the handlers module and call doRollover() in __init__.
Ah, now *there's* an intriguing approach! I am too much
On 2005-03-19, Alex Polite <[EMAIL PROTECTED]> wrote:
>
> If I try to bind a socket to a port that's already in use I get this
> error
>
> "error socket.error: (98, 'Address already in use')"
>
> Is there anyway to check in advance if a port i already taken?
Yes. Try to bind to the port. If you
[EMAIL PROTECTED] wrote:
> I've narrowed down my toolkit selection for my project to wxPython and
> pyQt, and now i'd like to hear any opinions, war stories, peeves, etc,
> about them, particularly from anyone who's used _both_toolkits_. I'm
> only mildly interested in the IDEs and UI designers fo
[El Pitonero]
> Is it even necessary to use a method name?
>
> import copy
> class safedict(dict):
> def __init__(self, default=None):
> self.default = default
> def __getitem__(self, key):
> try:
> return dict.__getitem__(self, key)
> except KeyError:
>
Bryan wrote:
> is there a way to determine the operating system's language? i can't seem
> to find a method that returns the value.
Try the module locale.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Alex Polite wrote:
On lör, mar 19, 2005 at 10:12:10 -0500, Peter Hansen wrote:
Alex Polite wrote:
You could, for example, bind to a port of "0" and that will
auto-assign an available port for you. Does that work
in your case? If not, please describe what you are really
trying to accomplish.
I'm l
Rob Cranfill wrote:
Ah, now *there's* an intriguing approach! I am too much a Python noob to
know - can I subclass RFH and then invoke that new class from a config
file (the crux of my original question) ? I may play around with it
today
There's at least one way that will work, though it ma
You can use PROC.poll() to find out whether the process has exited yet
or not (for instance, in a 'while' loop along with a delay). I don't know
what facilities exist to forcibly terminate programs on Windows, though.
On Unix, os.kill() can be used to kill a process given its pid. Perhaps
some of
Thank you all very much for your suggestions and input... they've been
very helpful. I found the easiest apporach, as a beginner to this, was
working with Chirag's code. Thanks Chirag, I was actually able to read
and make some edit's to the code and then use it... woohooo!
My changes are annotated
Kent Johnson said unto the world upon 2005-03-19 07:19:
Brian van den Broek wrote:
Raymond Hettinger said unto the world upon 2005-03-18 20:24:
I would like to get everyone's thoughts on two new dictionary methods:
def appendlist(self, key, *values):
try:
self[ke
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
> [Jeff Epler]
> > Maybe something for sets like 'appendlist' ('unionset'?)
>
> While this could work and potentially be useful, I think it is better to keep
> the proposal focused on the two common use cases. Adding a third would reduce
> the chance
Ah OK, I stand corrected. Whoops. I just read the web page and thought the
wrong thing, that makes sense.
> Think about it. A key= function is quite a different thing. It provides
a
> *temporary* comparison key while retaining the original value. IOW, your
> re-write is incorrect:
>
> >>> L =
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Hi
if key not in d:
d[key] = {subkey:value}
else:
d[key][subkey] = value
and
d[(key,subkey)] = value
?
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger wrote:
>
> As written out above, the += syntax works fine but does not work with
append().
> ...
> BTW, there is no need to make the same post three times.
The append() syntax works, if you use the other definition of safedict
(*). There are more than one way of defining safedict
"Aahz" <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> >
> >The proposed names could possibly be improved (perhaps tally() is more active
> >and clear than count()).
>
> +1 tally()
-1 for count(): Implies an accessor, not a mutator.
-1
Dennis Lee Bieber wrote:
On Sat, 19 Mar 2005 14:36:02 +0100, Ivan Voras <[EMAIL PROTECTED]>
declaimed the following in comp.lang.python:
Hey, IIRC, old Turbo Assembler (tasm, by Borland) had those. Much of it
was still manual, by it supported semi-automatic vtables and such :)
I'd suspect throu
Exactly what I was looking for. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
This is not stricly necessary but it would be nice if I could get it
done. Here is what I want to do:
There are 2 "foo" named modules, 'std foo' and 'my foo'. I want to be
able to import 'my foo' and then from within my foo, import 'std
foo'. Anyone can help??
-
Before you start
George Sakkis wrote:
> "Aahz" <[EMAIL PROTECTED]> wrote:
> > In article <[EMAIL PROTECTED]>,
> > Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> > >
> > >The proposed names could possibly be improved (perhaps tally() is
more active
> > >and clear than count()).
> >
> > +1 tally()
>
> -1 for count():
Francisco Borges <[EMAIL PROTECTED]> writes:
> I could simply copy optparse's code and hack it or I could simply import
> it and overload some methods, which is what I think would be a cleaner
> solution.
So why aren't you willing to give your optparse module a different name?
On Sat, 19 Mar 2005 15:17:59 GMT,
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote:
> [Dan Sommers]
>> Curious that in this lengthy discussion, a method name of
>> "accumulate" never came up. I'm not sure how to separate the two
>> cases (accumulating scalars vs. accumulating a list), though.
> Se
Raymond Hettinger wrote:
> I would like to get everyone's thoughts on two new dictionary
methods:
>
> def count(self, value, qty=1):
> try:
> self[key] += qty
> except KeyError:
> self[key] = qty
>
> def appendlist(self, key, *
Tanteauguri a écrit :
Hi List, is there in python a variable variable like in PHP ($$var)?
Hopefully, no.
See other answers in that thread for pythonic idioms.
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I'm new to Python, I've read the FAQ but still can't get the following
simple example working:
# file main_mod.py:
global_string = 'abc'
def main():
import auxiliary_mod
instance = auxiliary_mod.ClassA()
instance.fun()
return
main()
# file auxiliary_mod.py:
class ClassA:
MackS wrote:
> Hi
>
> I'm new to Python, I've read the FAQ but still can't get the following
> simple example working:
>
> # file main_mod.py:
>
> global_string = 'abc'
>
> def main():
>
> import auxiliary_mod
> instance = auxiliary_mod.ClassA()
> instance.fun()
> return
>
> m
fraca7 a écrit :
Michael Hoffman wrote:
Enjoy ;)
That's not the exact word that first came to my mind :)
--
http://mail.python.org/mailman/listinfo/python-list
Francisco Borges wrote:
> Hello,
>
> This is not stricly necessary but it would be nice if I could get it
> done. Here is what I want to do:
>
> There are 2 "foo" named modules, 'std foo' and 'my foo'. I want to be
> able to import 'my foo' and then from within my foo, import 'std
> foo'. Anyone
"El Pitonero" <[EMAIL PROTECTED]> writes:
> What about no name at all for the scalar case:
>
> a['hello'] += 1
> a['bye'] -= 2
I like this despite the minor surprise that it works even when
a['hello'] is uninitialized.
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 159 matches
Mail list logo