Saurav Chirania wrote:
> I really like that python's sort method accepts a key function as a
> parameter which can be used to specify how elements should be compared.
>
> Similarly, we could have a "key" argument which specifies how elements
> should be counted. Let's say we have a list of a mill
On Fri, 2 Oct 2020 13:34:46 +0100, Shaozhong SHI wrote:
> Hello,
>
> I got a json response from an API and tried to use pandas to put data into
> a dataframe.
>
> However, I kept getting this ValueError: arrays must all be same length.
>
> Can anyone help?
>
> The following is the json text. Rega
On Wed, 7 Oct 2020 13:29:26 +0530, Meghna Karkera wrote:
> On Wed, Oct 7, 2020, 11:24 Marco Sulla wrote:
>> On Wed, 7 Oct 2020 at 05:23, Meghna Karkera wrote:
>> >
>> > How is PYTHON better than other software's(MATLAB) in case of
>> > truncation or rounding off error.
>
>> [snip]
>
> When I use
Python advocates might want to organize their thoughts on
this subject before their bosses spring the suggestion:
>From
>https://www.sciencemag.org/news/2020/10/we-re-part-problem-astronomers-confront-their-role-and-vulnerability-climate-change
> :
. . . Astronomers should also abandon popul
On Sat, 10 Oct 2020 18:17:26 -0400, Steve wrote:
> I would like to use the line:
> HoursDiff = int((d2-d1).total_seconds()/3600)
> to determine the difference in hours between two timedate entries.
>
> The variable d2 is from datetime.now()
> and d1 is read from a text file.
>
> I can save d2 to t
On Sun, 1 Nov 2020 15:31:57 - (UTC), Grant Edwards wrote:
>
> I have no objection to saving the most recent window size and using
> that on the next startup, but I hate applications that force the
> _location_ of the window. I've configured my window manager to open
> windows where I want them
On Fri, 6 Nov 2020 02:25:25 -0500, Steve wrote:
> In my program, I have the following lines of code:
> import random
> import re
> import time
> import datetime
At this point, the name "datetime" points to a module.
> from datetime import timedelta
> from time import gmt
On Sun, 8 Nov 2020 13:50:19 -0500, Quentin Bock wrote:
> Errors say that add takes 1 positional argument but 3 were given? Does this
> limit how many numbers I can have or do I need other variables?
> Here is what I have:
> def add(numbers):
>total = 1
>for x in numbers:
> total
On Thu, 19 Nov 2020 13:19:07 +0100, Usman Musa wrote:
> When I try to install a package or upgrade pip, using pip install I got
> this error massage.
> WARNING: Retrying (Retry(total=4, connect=None, read=None,
> redirect=None, status=None)) after connection broken by
> 'SSLError(SSLCertVeri
same result).
3. Listing of the file I am running
I have tried more than one version of Python and get the same results except
on Python 3.9.0 and .1 when pygame won't even install.
Please give me some help, I don't know how to proceed.
Thanking you in advance.
Peter Walker
PS
On Tue, 29 Dec 2020 02:52:15 -0800 (PST), Priya Singh wrote:
[snip]
> I have two spectra with wavelength, flux, and error on flux. I want to
> find out the variability of these two spectra based on the 2 sample
> Chi-square test. I am using following code:
>
> def compute_chi2_var(file1,file2,zemi
On Tue, 29 Dec 2020 05:38:53 -0800 (PST), nikhil k wrote:
...[snip]...
> import win32com.client as win32
>
> ### Functions
> def getMailBody(msgFile):
> start_text = ""
> end_text = ""
> with open(msgFile) as f:
> data=f.read()
> return data[data.find(start_text):d
On 31/12/2020 23:46, Bob van der Poel wrote:
When I run python from the command line and generate an error I get the
following:
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
z
/home/bob/.local/lib/pyth
On 06/01/2021 22:03, Rich Shepard wrote:
On Thu, 7 Jan 2021, Chris Angelico wrote:
Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.
ChrisA,
I'm always open to learning. There's no error generated ... yet the
application doesn' open so
On 06/01/2021 22:03, Grant Edwards wrote:
I'm completely baffled by that. Can somebody explain how this
expression is evaluated?
self.callbacks['file->new', underline: 0]
It appears that the dict callbacks is being accessed with the key of
a tuple comprising a string and a slice.
Huh?
Y
On 07/01/2021 08:42, Christian Gollwitzer wrote:
Am 07.01.21 um 08:29 schrieb Paulo da Silva:
Does anybody know why cmd method isn't called when I change the button
state (clicking on it) in this example?
I know that this seems a weird class use. But why doesn't it work?
Thanks.
class C:
):
if self.obj is None:
self.obj = self.class_(*args, **kwargs)
return self.obj.num
num = property(_getnum)
Now that "should" do precisely what you've asked for above, though it is
obviously very limited in supporting only a single attribute name
to more of SQLite's
features.
(Both appear to have been around roughly the same length of time, though
pysqlite seems better known.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
tors, which means you can switch contexts only at the top
level, with a yield statement?
I don't know what the OP wants, but I could imagine that would be a
pretty fundamental difference (if I'm right about Stackless).
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
6:
... return re.compile("[%s]" % a_z).findall(all_chars)
...
>>> for c in char_set("a-f0-9"): print c,
...
0 1 2 3 4 5 6 7 8 9 a b c d e f
>>> for c in char_set("\s"): print repr(c),
...
'\t' '\n' '\x0b' '\x0c' '\r' ' '
Peter
--
http://mail.python.org/mailman/listinfo/python-list
TK wrote:
>>>is there no IDLE in Python2.4?
> What about with Suse 9.3 und Python 2.4?
You have to install the python-idle package.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
a = list("abcde")
>>> for i in a:
... a.remove(i)
...
>>> a
['b', 'd']
You can avoid that by making a copy of node1.childNodes:
for el in list(node1.childNodes):
node2.appendChild(el)
> assert 2 == len(node2.childNodes), "node2 has an unexpected number of
> children"
Peter
--
http://mail.python.org/mailman/listinfo/python-list
ode where you need to
"parse" it and extract the values you can just do this:
import config
print 'Project Id is', config.PROJECT_ID
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
hat do I need to do to remove the "\n" from the file?
line.strip() removes all leading and trailing whitespace (not just "\n")
from the line string.
import os
for line in open("list.txt").readlines():
directory = line.strip()
os.mkdir(directory)
Peter
--
http://mail.python.org/mailman/listinfo/python-list
oach, especially as we are doing
test-driven development. An IDE just gets in our way.
If you focus on IDEs, your research will have pre-selected only certain
kinds of programmers and teams, and will not necessarily include the
best ones. (Looking at the VB world, one might even say something m
k way of finding the above docs, and while doing the same search
with __builtins__ admittedly finds lots of mailing list archives where
people have the same misconception as you did, it doesn't take one past
the second page of results before you'll be right back at a post by
Fredrik pointing out the same mistake. :-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
oo many laws and that a few
core ones already cover the majority of interesting situations for which
the politicians are endlessly dreaming up more and more specific laws.
So far this thread seems to me a parallel sort of situation...)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
include "yes, sort of, using something like Psyco", and
"who cares because it wouldn't give you much better performance for a
web-based application where you're probably either I/O-bound or limited
by the speed of the non-Python database solution you are using in the
first place?".
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> Peter Hansen <[EMAIL PROTECTED]> writes:
>>If you focus on IDEs, your research will have pre-selected only
>>certain kinds of programmers and teams, and will not necessarily
>>include the best ones.
>
> It wouldn't have occurred to m
than the two step
>
> w = strptime(d,'%Y-%m-%d')
> datetime.date( w[0], w[1], w[2] )
>
> Since I'm new to many things in Python I'm trying to learn if there is a
> "better" way of doing things.
You're still not defining what "better&quo
e around is pretty "pythonic" too.
(An alternative would be to contribute a patch to add something like
this to the datetime module. I don't know if it would be accepted, but
at least it would be the true arbiters of "pythonicism" who would be
judging the matter, not you or I. :-) )
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
; dir(t)
['__class__', '_sock', 'accept', 'bind', 'close'
, 'connect', 'connect_ex', 'dup', 'fileno', 'getpeername',
...'setblocking', 'setsockopt', 'settimeout', 'shutdown']
Let's see... what looks good here?
>>> u._sock
>>> t._sock
Maybe that type field?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
> Peter Hansen wrote:
>>Tor Erik Sønvisen wrote:
>>>How can I determine the type of a socket (TCP or UDP) object?
>>Let's see... what looks good here?
>>
>> >>> u._sock
>>
>> >>> t._sock
>>
&
irst digit in the result
comes from the 0 and the 1 above it, in the two input values).
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
mpiler treats it as local to that
function. Closed-over variables are therefore always read-only, much to the
chagrin of Lisp-lovers.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
staticmethod, how can I do this?
It seems to me that no matter what you do, if it's not done with an
external processing tool which requires no changes in the source code,
the result will be much uglier than if you just used the pre-2.4
decorator syntax:
def meth():
pass
me
by a DLL.
I'm not sure what you were thinking of, but it probably wasn't ctypes.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
other programs open
which are very actively allocating or freeing memory.
It does seem to back up the "~1.5MB" number above, and certainly shows
that the total is nowhere near 4MB per Python interpreter.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
unexpected to me, though
perhaps it can happen in certain situations. It's a hint, anyway.
Are the earlier four lines which you did show us relevant? (i.e. if
that's line six, what was on lines one, two, three, and four?)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
kage/amodule.py
apackage/anothermodule.py
and try to import amodule into anothermodule, there is no way to tell Python
that you mean amodule.py and not apackage/anmodule.py.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
t takes the full 64-bit value and divides by the frequency, returning
a double. Whether or not that works for you only you can say.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
I've written a program to illustrate a few... syntactic issues with
Python. It's 158 <80 character lines long.
About how short should a program be to be postable to this newsgroup -
in other words, at what length should you stick it on a web page and
post a link?
Peter
--
A fright
syntactic sugar that I could use, and this is the result:
http://www.pick.ucam.org/~ptc24/yvfc.html
Peter
--
A frightful hobgoblin is stalking throughout Europe.
- The Communist Manifesto, 1st English Edition
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
>
> Peter> About how short should a program be to be postable to this
> Peter> newsgroup - in other words, at what length should you stick it on
> Peter> a web page and post a link?
>
> 158 lines is probably not a killer. However
Peter Corbett wrote:
> I've written a program to illustrate a few... syntactic issues with
> Python. It's 158 <80 character lines long.
>
> About how short should a program be to be postable to this newsgroup -
> in other words, at what length should you stick it on
the two necessarily in conflict? Perl can save your butt and
_still_ suck!
;-) ;-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Richie Hindle <[EMAIL PROTECTED]> writes:
>
> [Peter]
> > http://www.pick.ucam.org/~ptc24/yvfc.html
>
> [Jeff]
> > Yuma Valley Agricultural Center?
> > Yaak Valley Forest Council?
>
> I went through the same process. My guess is "Yes, Very F'
Fredrik Lundh wrote:
> Peter Hansen wrote:
>>Does it really have to be 158 lines to demonstrate these few issues? I
>>for one almost never take the time to dig through 158 lines of someone
>>else's code, partly on the assumption that almost any interesting issue
>
http://www.google.com/search?q=python+socketmodule.c
plus one additional click on "view" once you're there...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
tch them and ignore them if that's what you
wanted to do. But did you mean SyntaxError, or something else?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
> Peter Hansen wrote:
>>Not sure... what's a "syntax warning"?
>
> In [1]: SyntaxWarning?
> Type: classobj
> String Form:exceptions.SyntaxWarning
> Namespace: Python builtin
> Docstring:
> Base class for
someone did an "admin" install
which (I believe) puts the DLLs in the system folder, and the next time
did just a non-admin install which doesn't do that? (Or am I
misunderstanding the conditions under which c:\windows\system32 has
files written to it?)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
the foul language words used by
> Xah Lee ever occurs in any spam I receive - spam is not that stupid.
"Xah Lee: stupider than spam." (?)
-neologism-intentional-ly y'rs,
Peter
--
http://mail.python.org/mailman/listinfo/python-list
lly from Steve Holden, too, which
makes the civility doubly surprising. ;-)
-revenge-is-sweet-ly y'rs,
Peter
--
http://mail.python.org/mailman/listinfo/python-list
ys
>>> import module as a
>>> del sys.modules["module"]
>>> import module as b
>>> b is a
False
Peter
--
http://mail.python.org/mailman/listinfo/python-list
variant:
$ python2.4 -c 'import syntaxwarning'
syntaxwarning.py:1: SyntaxWarning: name 'x' is assigned to before global
declaration
def f():
$ python2.4 syntaxwarning.pyc
Method 2: switch off the warning:
$ python2.4 -Wignore::SyntaxWarning syntaxwarning.py
Peter
--
http://mail.python.org/mailman/listinfo/python-list
body seems to know what the arguments are doing (sometimes they seem
to be handed down from earlier generations), keyword arguments are a
real blessing.
The world needs more keyword arguments. Use them everywhere! ;-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
g.franzkowiak wrote:
> tmpList = list(dataObject)[:4])
> obj = tmpList[0]+tmpList[1]+tmpList[2]+tmpList[3].
Have you tried just
obj = dataObject[:4]
without the intermediate list? If that failed, can you tell us the type of
the dataObject? E. g.
>>> print type(data
dataObject)
just to help me restore my peace of mind :-)
Peter
--
http://mail.python.org/mailman/listinfo/python-list
as keys
> I have a problem with what is returned since None is
> a valid key and thus it shouldn't be used this way.
Consider new-style classes:
>>> class T(object):
... def __getitem__(self, key):
... return key
...
>>> t = T()
>>> t[:4]
slice(None, 4, None)
>>> t[0:4]
slice(0, 4, None)
>>> t[0:]
slice(0, None, None)
Peter
--
http://mail.python.org/mailman/listinfo/python-list
On 10/3/05, Roel Schroeven <[EMAIL PROTECTED]> wrote:
> Indeed, and that's by design: http://www.unicom.com/pw/reply-to-harmful.html
Of course, that's only one side of the argument:
http://www.blackgate.net/consulting/reply-to_munging_useful.html
On lists like this, where everyone benefits by s
On 10/3/05, Roel Schroeven <[EMAIL PROTECTED]> wrote:
> The default of this list is not to make conversations private; in fact
> the list doesn't have any default. It's you who chooses to send replies
> to the original author, to the list, or both, by choosing which button
> to press in your mail
27;t equate that with being dumb - just dumb luck :-)
>
> Message-ID: <[EMAIL PROTECTED]>
>
> After all Peter Hansen suggested the search terms "python socketmodule.c"
> rather than just "socketmodule.c"
>
> Message-ID: <[EMAIL PROTECTED]>
>
On 10/3/05, spiffo <[EMAIL PROTECTED]> wrote:
> I am a corporate developer, working for a single company. Got a new project
> coming up and wondering if I should stay with Python for this new, fairly
> large project, are jump back on the 'safe' M$ bandwagon using a dot net
> language? Cross platfo
look in the gc module ...
Celine & Dave wrote:
> Hello All,
>
> I am trying to find a profiler that can measure the
> memory usage in a Python program. I would like to
> gather some statistics about object usages. For
> example, I would like to be able to see how much time
> it takes to search fo
like them to go to stdout. Using
>
> sys.stderr = sys.stdout
>
> has no effect. Redirecting stderr to stdout from the shell is not an
> option for me, because I need to use stderr for other messages.
smtplib obtains a copy of stderr by
from sys import stderr
Therefore yo
"smtplib").debug
an approach which is currently only taken by the cookielib module.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
# will be called with instances from cache hits, too.
print "init", x
a = Spam('foo')
b = Spam('foo')
print a, b, a is b
Peter
--
http://mail.python.org/mailman/listinfo/python-list
a 'NULL' handler in the
> library, but is this really how logging is intended to be used?
I would support ...err, what's the opposite of a feature request?
Anyway, another hack, slightly more lightweight/intrusive:
logging.root.manager.emittedNoHandlerWarning = True
Peter
-
cache. Do I
> have to implement my own garbage collecting is or there some "magical"
> way of doing this within Python? I pretty much want to get rid of the
> cache as soon as there are no other references (other than the cache).
Use a weakref.WeakValueDictionary as the cache instead of a normal dict.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
@property
... def clsprp(cls): return 42
...
>>> A.clsprp
42
Peter
--
http://mail.python.org/mailman/listinfo/python-list
for item in items:
sigma += item
yield sigma
cumulated_weights = list(isum([60, 30, 10], 0))
sigma = cumulated_weights[-1]
sample = []
for _ in xrange(sample_size):
pool = pools[bisect.bisect(cumulated_weights, random.random()*sigma)]
sample.append(random.choice(pool))
(all code untested)
Peter
--
http://mail.python.org/mailman/listinfo/python-list
On 9 Oct 2005 18:16:32 -0700, Clint Norton <[EMAIL PROTECTED]> wrote:
> Well,
> I though about it but I'm looking for something a little more
> interesting then bug fixing...
> Anyway, wouldn't it be to difficult to get into a huge project like
> python itself? Wouldn't it be a better idea to w
can't find any tkinter module.
Any ideas what I have done wrong anybody?
Thanks
Peter
import Tkinter
if __name__ == '__main__':
root = Tkinter.Tk()
root.title('Hello World?')
root.mainloop()
--
http://mail.python.org/mailman/listinfo/python-list
gt;> def __init__(self):
... if type(self) == __Two:
... print "two leading underscores"
...
>>> class __Two(object):
... __init__ = __init__
...
>>> __Two()
two leading underscores
<__main__.__Two object at 0x4029360c>
Peter
--
http://mail.python.org/mailman/listinfo/python-list
simplest approach is to 1 way hash the password ... perhaps using md5
normally with passwords the server only has to check if it is the same
word, assuming the same hash algorithms the same hash value can be
created at client.
Its not hugely secure ... anyone sniffing can grab your hash value a
tes[i-1]
> result = bytes.tostring()
Seems like the OP doesn't need what he asked for. The simpler
def checksum(s):
assert s[0] == "$"
assert s[-1] == "*"
result = 0
for c in s[1:-1]:
result ^= ord(c)
return result
should do.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
Fred's suggestion and run Python with command line arguments set. I seem to
be limited to just running a .py file from the File Explorer.
In the "Program Filess\Python\Lib" path there is a _tkinter file but it is a
.pyd not a .dll.
Peter
"Steve Holden" <[EMAIL PROTEC
Peter wrote:
> Although the wxPyWiki seems to be pronounced wix-pee-wi-kee (as it says
> on the front page) so maybe it is pronounced wix-Python... you never
> know...
That's _definitely_ how it's pronounced.
Here.
Where I am.
When I'm speaking.
If, however, we
html
>
> maybe someone could update that???
Maybe we should add '''...for some definitions of "interpreted",
"object-oriented", and perhaps even "interactive". '''
I've seen at least the first two debated endlessly here.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ing test-driven development and had
effectively thousands of hours of run-time by the time the first system
shipped, so we had great confidence in it.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ors
should not have access to user passwords, and in addition users should
not be put in the position of having to trust your server-side security
to keep their passwords (which they might have used on other systems)
from being grabbed by hackers.
-Peter
--
http://mail.python.org/mailman/list
asking questions which are almost
certainly covered there. For example, right there near the top of the
first screen in the tutorial is an example of opening a Linux .so file...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
nd the time Python was first released. And I can't really
imagine a non-ugly alternative, which probably reveals something bad
about my imagination.)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
ement (so
"this" could _not_ be accomplished with what you showed).
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
x27;iterable=range(1000)' 's = [0]*len(iterable)'
'for i, v in enumerate(iterable): s[i] = v'
1000 loops, best of 3: 269 usec per loop
~ $ python2.4 -m timeit -s'iterable=range(1000)' 'list(iterable)'
10 loops, best of 3: 7.33 usec per loop
Peter
--
http://mail.python.org/mailman/listinfo/python-list
-)
But I'm also not sure I ought to post that to the group, so I'll spare
them and just inflict the thought on you!
Cheers,
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Laszlo Zsolt Nagy wrote:
> Peter Hansen wrote:
>> Ignoring all the other issues, any solution which actually requires
>> the password to be stored on the server is a bad solution.
>> Administrators should not have access to user passwords, and in
>> addition use
Peter Hansen wrote:
> But I'm also not sure I ought to post that to the group, so I'll spare
> them and just inflict the thought on you!
Or, maybe I'll just fail to trim the newsgroup line and accidentally
post to the group anyway. Yes, that's just what I'l
' ('\r') overwrites part of the
string which therefore doesn't seem to grow. Try
print repr(data[:51])
to see what's really in your data string.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
u don't feel comfortable with the command line you can stick
import sys
sys.stdout = open("mylogfile.txt", "w")
at the beginning of your file.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
y mind
is far more important than either result) comes hidden in the middle:
"C then A else B" makes the conditional stand out
"A if C else B" suggests that A is more important than B and hides C
But I can live with whichever it is... not that I have any choice. :)
-P
so it wasn't stresed during
> high-volume times. The two systems (one for redundancy) that run the
> Python program have been running for six years.
Six years? With no downtime at all for the server? That's a lot of
"9s" of reliability...
Must still be using Py
t introduce the concept of
"salt", one of the "additional things" I mentioned above.
I'm not going to try to give a tutorial: I'm not nearly expert enough to
be trusted for that. :-) I just wanted to warn against one of the most
basic and easily avoidable problems.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
tin gherdanarra wrote:
> what is a "slot" in python?
Google for "site:docs.python.org slots":
http://www.google.ca/search?q=site%3Adocs.python.org+slots
First hit...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
rying to use a .pyc module, created with one
> Python version, using another Python version. But in this case, I
> created the zip file under Python 2.4.2 and tried to open it under
> Python 2.4.2 as well. Any ideas on what to do?
Maybe try posting the full traceback so we can see the "Ba
rms of __set/getitem__() as
def setdefault(self, key, value=None):
try:
return self[key]
except KeyError:
self[key] = value
return self[key]
I guess it's not done for performance reasons.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
t()?
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
There is no per-instance default value just on per call:
>>> d = {}
>>> d.setdefault("a", 1)
1
>>> d.setdefault("a", 42)
1
I'm sure there is a misunderstanding in our conversation, I'm just not able
to nail it...
Peter
--
http://mail.python.org/mailman/listinfo/python-list
as being exceptionally well commented and
well structured. I suspect it's pretty Pythonic, too, since Roger seems
pretty brilliant from where I sit. :-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
that shouldn't win any readability awards...
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
1901 - 2000 of 9340 matches
Mail list logo