On Sun, Aug 29, 2010 at 11:29 PM, Julia Jacobson
wrote:
> Dear python users,
>
> For passing a variable to a SQL query for psycopg2, I use:
>
> >>> my_var = xyz
> >>> print cur.mogrify("SELECT my_values FROM my_table WHERE my_column =
> %s",(my_var,))
>
> This returns:
>
> >>> SELECT my_values
Steven D'Aprano writes:
> I'm not saying that ref counting systems can avoid incrementing and
> decrementing the ref counts. That would be silly. But I'm saying that it
> is an accident of implementation that writing C extensions requires you
> to manually manage the counts yourself. That's a s
On Mon, 30 Aug 2010 00:22:17 -0700, Paul Rubin wrote:
> I don't think a C compiler could really manage automatic decrementing
> while still being C. Think especially of the common style of exception
> handling in C using longjmp.
You might very well be right. But that's the problem with C -- it'
Paul Rubin wrote:
These days I think the GC pause issue is overrated except for real-time
control applications.
Also for games, which are a fairly common application
these days. Even a few milliseconds can be too long when
you're trying to achieve smooth animation.
I'd be disappointed if CPyt
On 30 Αύγ, 06:12, MRAB wrote:
> On 30/08/2010 03:55, Nik the Greek wrote:
>
>
>
>
>
>
>
>
>
> > On 30 Αύγ, 05:43, MRAB wrote:
> >> On 30/08/2010 03:07, Nik the Greek wrote:
>
> >>> On 30 Αύγ, 04:51, MRAB wrote:
> On 30/08/2010 02:14, Νίκος wrote:
>
> > On 29 Αύγ, 21:44, MRAB wrot
Nik the Greek wrote:
Yes i will i just asked to know if i were to substitute what might be
the problem so to understand why i need the quoting.
Because if you use % to build a query string, the result must
be syntactically valid SQL. The values that you substitute
into the placeholders must en
In message <7xr5hg3a7s@ruckus.brouhaha.com>, Paul Rubin wrote:
> Actually that code looks suspicious. Suppose in
>
> AddrObj = PyTuple_GetItem(TheBufferInfo, 0);
> LenObj = PyTuple_GetItem(TheBufferInfo, 1);
>
> the first PyTuple_GetItem succeeds and the second one fails.
Chris Rebert wrote:
On Sun, Aug 29, 2010 at 11:29 PM, Julia Jacobson
Where does the "E" in front of 'xyz' come from?
It's probably the reason, why my query doesn't work.
Quite doubtful, considering the example in the psycopg2 docs also has the E:
http://initd.org/psycopg/docs/cursor.html#cur
In message <7x39twpuxi@ruckus.brouhaha.com>, Paul Rubin wrote:
> Lawrence D'Oliveiro writes:
>
>>> the CPython API means endlessly finding and fixing refcount bugs that
>>> lead to either crashes/security failures, or memory leaks.
>>
>> I don’t see why that should be so. It seems a very simp
Early Bird Registration for Surge Scalability Conference 2010 ends next
Tuesday, August 31. We have a killer lineup of speakers and architects
from across the Internet. Listen to experts talk about the newest
methods and technologies for scaling your Web presence.
http://omniti.com/surge/2010/re
On 08/30/2010 02:09 AM, Steven D'Aprano wrote:
> On Mon, 30 Aug 2010 01:46:16 +0200, News123 wrote:
>
>> Hi,
>>
>> Under Linux I'd like to find out, whether I got a file, a character
>> device or a socket as a parameter.
>
> See the stat module.
>
>
Thks a lot.
I was looking in os.path and forg
www.127760.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
On Monday 30 August 2010, it occurred to L to exclaim:
> I have tried it and as soon as you try any of the examples in the
> examples dir it cannot find numpy etc
>
> I have manually move the pygeo dirs and contents to
> /usr/lib/python2.6/dis-packages,
>
> (this is the directory where num
Hi Pinku,
On 2010-08-11 21:35, Pinku Surana wrote:
> Even though I used the same name "x" for a local and global variable,
> they are actually completely different. When I call "fun(x)" it COPIES
> the global value of "x" into the local variable "x" in "fun". [...]
The global value isn't copied w
Lawrence D'Oliveiro writes:
>> AddrObj = PyTuple_GetItem(TheBufferInfo, 0);
>> LenObj = PyTuple_GetItem(TheBufferInfo, 1);
>>
>> the first PyTuple_GetItem succeeds and the second one fails.
>
> Admittedly, I did take a shortcut here: array.buffer_info returns a tuple of
> two i
On Monday 30 August 2010, it occurred to ru...@yahoo.com to exclaim:
> Face the facts dude. The Python docs have some major problems.
> They were pretty good when Python was a new, cool, project used
> by a handful of geeks. They are good relative to the "average"
> (whatever that is) open source
Steven D'Aprano wrote:
[reading Bengali]
> In Python 2, you probably need to do this:
>
> f = open("filename")
> bytes = f.read()
> text = bytes.decode('which-encoding-you-use')
> f.close()
In Python 2, I'd rather take a look at the "codecs" module (see
http://docs.python.org), namely the "codecs
Lawrence D'Oliveiro writes:
>> If it hasn't happened to you yet, you're either burning a bunch of effort
>> that programmers of more automatic systems can put to more productive
>> uses ...
>
> What makes you say that? Avoiding bugs is not a “productive use”?
Avoiding any particular bug through c
Gregory Ewing writes:
>> These days I think the GC pause issue is overrated except for real-time
>> control applications.
>
> Also for games, which are a fairly common application
> these days. Even a few milliseconds can be too long when
> you're trying to achieve smooth animation.
The usual hac
Thomas Jollans writes:
> Actually, the Python standard library reference manual is excellent. At least
> that's my opinion
> What exactly are you comparing the Python docs to, I wonder? Obviously not
> something like Vala, but that goes without saying.
I didn't know Vala had especially goo
On Monday 30 August 2010, it occurred to Paul Rubin to exclaim:
> Thomas Jollans writes:
> > Actually, the Python standard library reference manual is excellent. At
> > least that's my opinion
> > What exactly are you comparing the Python docs to, I wonder? Obviously
> > not something like Val
In article ,
Tim Chase wrote:
>On 08/18/10 21:47, Steven D'Aprano wrote:
>>
>> Frankly, I think the OP doesn't really know what he wants, other than
>> premature optimization. It's amazing how popular that is :)
>
>You see, the trick to prematurely optimizing is to have a good
>algorithm for pre
In article <4c7b279d$0$28650$c3e8...@news.astraweb.com>,
Steven D'Aprano wrote:
>On Sun, 29 Aug 2010 17:52:38 -0700, Paul Rubin wrote:
>>Attribution lost:
>>>
>>> That's a problem with the CPython API, not reference counting. The
>>> problem is that the CPython API is written at too low a level,
On Aug 29, 1:14 pm, MRAB wrote:
> On 29/08/2010 15:22, naugiedoggie wrote:
> > I'm having a problem with using a function as the replacement in
> > re.sub().
> > Here is the function:
> > def normalize(s) :
> > return
> > urllib.quote(string.capwords(urllib.unquote(s.group('provider'
>
In article ,
Raymond Hettinger wrote:
>On Aug 29, 12:12=A0pm, John Nagle wrote:
>>
>> Is the "in" test faster for a dict or a set? Is "frozenset" faster
>> than "set"? Use case is for things like applying "in" on a list of
>> 500 or so words while checking a large body of text.
>
>There is no s
On Aug 30, 8:52 am, naugiedoggie wrote:
> On Aug 29, 1:14 pm, MRAB wrote:
>
>
>
>
>
> > On 29/08/2010 15:22, naugiedoggie wrote:
> > > I'm having a problem with using a function as the replacement in
> > > re.sub().
> > > Here is the function:
> > > def normalize(s) :
> > > return
> > > urll
a...@pythoncraft.com (Aahz) writes:
> That reminds me: one co-worker (who really should have known better ;-)
> had the impression that sets were O(N) rather than O(1). Although
> writing that off as a brain-fart seems appropriate, it's also the case
> that the docs don't really make that clear, i
On 30 Αύγ, 11:01, Nik the Greek wrote:
> On 30 Αύγ, 06:12, MRAB wrote:
>
>
>
>
>
>
>
>
>
> > On 30/08/2010 03:55, Nik the Greek wrote:
>
> > > On 30 Αύγ, 05:43, MRAB wrote:
> > >> On 30/08/2010 03:07, Nik the Greek wrote:
>
> > >>> On 30 Αύγ, 04:51, MRAB wrote:
> > On 30/08/2010 02:14, Ν
Python 2.6/Windows: shlex.split() does not support unicode
strings. Is this simply a limitation of the current shlex
implementation or is this an intentional design decision that
reflects the behavior of how the Windows shell supports unicode
values?
Specifically, it doesn't appear that subprocess
On Mon, Aug 30, 2010 at 6:54 AM, wrote:
> Python 2.6/Windows: shlex.split() does not support unicode strings. Is this
> simply a limitation of the current shlex implementation or is this an
> intentional design decision that reflects the behavior of how the Windows
> shell supports unicode values
a...@pythoncraft.com (Aahz) writes:
> That reminds me: one co-worker (who really should have known better ;-)
> had the impression that sets were O(N) rather than O(1).
For settling exactly this kind of confusion, Python's standard library
comes with a module, the ‘timeit’ module. Your co-worker
Good Day!
I am stuck... hopefully a few fresh pairs of eyes will spot what I am
missing.
I have a metaclass, Traits, and two different testing files,
test_traits.py and tests.py. test_traits works fine, tests generates
the following error:
C:\Python31\Lib\site-packages\traits\tests>\pytho
On Mon, Aug 30, 2010 at 7:10 AM, Ethan Furman wrote:
> Good Day!
>
> I am stuck... hopefully a few fresh pairs of eyes will spot what I am
> missing.
>
> I have a metaclass, Traits, and two different testing files, test_traits.py
> and tests.py. test_traits works fine, tests generates the followi
Ethan, are you trying to write the constructor in the class statement?
Cheers,
Xav
On 31 August 2010 00:10, Ethan Furman wrote:
> Good Day!
>
> I am stuck... hopefully a few fresh pairs of eyes will spot what I am
> missing.
>
> I have a metaclass, Traits, and two different testing files, test_
Actually, scrape what I said.
I think you need to have metaclass in the class statement, not just meta.
-Xav
On 31 August 2010 00:16, Xavier Ho wrote:
> Ethan, are you trying to write the constructor in the class statement?
>
> Cheers,
> Xav
>
>
> On 31 August 2010 00:10, Ethan Furman wrote:
Hi Chris,
> It's a bug: http://bugs.python.org/issue1170
Thanks for pointing out the shlex bug. My concern was that shlex had
Windows specific Unicode limitations because of the way the Windows
shell so poorly supports unicode output.
> Kudos for avoiding shell=True
My understanding is that the
Hi All,
I'm attempting a framework install of python 2.6.6 from source, on an
intel mac running osx 10.6.4.
At the end of the install the following errors occur.
install: mkdir /usr/local/bin: Permission denied
make[1]: *** [altinstallunixtools] Error 71
make: *** [frameworkaltinstallunixtools]
On 26 Ago, 08:52, Dennis Lee Bieber wrote:
> On Tue, 24 Aug 2010 22:21:34 -0700 (PDT), Ritchy lelis
> declaimed the following in
> gmane.comp.python.general:
>
> > hi friend Dennis Lee Bieber
>
> > I have watching your code sujestion and now i can understand more of
> > what you have there..
>
>
Maybe you could try this:
http://hyry.dip.jp/files/pygeo.7z
I found it on this page:
http://hyry.dip.jp/blogt.py?file=0432.blog
--
http://mail.python.org/mailman/listinfo/python-list
including libttsh11 fixed the problem. Thank you!
Now I can get on with fixing everything that Python 3 broke... err changed.
:)
--
Cliff
On Sat, Aug 28, 2010 at 11:20 AM, Alexander Gattin wrote:
> Hello,
>
> On Sat, Aug 28, 2010 at 09:27:05AM -0400, Cliff
> Martin wrote:
> > Yes, our entire
On Mon, Aug 30, 2010 at 10:29 AM, jal wrote:
> Hi All,
>
> I'm attempting a framework install of python 2.6.6 from source, on an
> intel mac running osx 10.6.4.
>
> At the end of the install the following errors occur.
>
> install: mkdir /usr/local/bin: Permission denied
> make[1]: *** [altinstall
Chris Rebert wrote:
Shouldn't meta= instead be metaclass= ?
Xavier Ho wrote:
> I think you need to have metaclass in the class statement, not just meta.
Argh. Thank you both. I'm glad it was simple!
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
On Monday 30 August 2010, it occurred to Tobias Weber to exclaim:
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called? What about a
> frozenset? O
Tobias Weber gmx.net> writes:
>
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called?
Yes, and the list.
> What about a
> frozenset?
Yep.
Tobias Weber writes:
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called? What about a
> frozenset? Or tuple vs list? After how many calls per s
On 30 Αύγ, 11:11, Gregory Ewing wrote:
> Nik the Greek wrote:
> > Yes i will i just asked to know if i were to substitute what might be
> > the problem so to understand why i need the quoting.
>
> Because if you use % to build a query string, the result must
> be syntactically valid SQL. The value
Hello world !
I just released version 0.3 of JSONBOT. JSONBOT is a remote event
driven framework for building bots that talk JSON to each other over
XMPP.
This distribution provides bots built on this framework for console,
IRC, XMPP for the shell and WWW and XMPP for the Google Application
engin
Nik the Greek wrote:
>> Perhpas its doenst get loaded like that?
>>
>> # initialize cookie
>> cookie = SimpleCookie()
>> cookie.load( os.environ.get('HTTP_COOKIE', '') )
>> mycookie = cookie.get('visitor')
>
> Please someone else has an idea on how this to work?
Add a print statement to verify t
Nik the Greek wrote:
cursor.execute(''' SELECT hits FROM counters WHERE page = %s and
date = %s and host = %s ''' , a_tuple )
and
cursor.execute(''' SELECT hits FROM counters WHERE page = %s and
date = %s and host = %s ''' , (a_tuple) )
are both syntactically correct right?
buw what about
c
On 30/08/2010 04:33, Nik the Greek wrote:
On 30 Αύγ, 06:12, MRAB wrote:
This part:
( not mycookie or mycookie.value != 'nikos' )
is false but this part:
re.search( r'(msn|yandex|13448|spider|crawl)', host ) is None
is true because host doesn't contain any of those substrings.
On 30/08/2010 17:09, Nik the Greek wrote:
On 30 Αύγ, 11:11, Gregory Ewing wrote:
Nik the Greek wrote:
Yes i will i just asked to know if i were to substitute what might be
the problem so to understand why i need the quoting.
Because if you use % to build a query string, the result must
be sy
On 30/08/2010 17:34, Alexander Kapps wrote:
Nik the Greek wrote:
cursor.execute(''' SELECT hits FROM counters WHERE page = %s and
date = %s and host = %s ''' , a_tuple )
and
cursor.execute(''' SELECT hits FROM counters WHERE page = %s and
date = %s and host = %s ''' , (a_tuple) )
are both sy
Peter Otten wrote:
My expectation of this is that if onerrors is left as None, names
yielded will be importable.
I would infer no such promise, especially as the generator also yields
modules, and no attempt at all is made to import those.
Really? I thought the __import__ fired over everythi
Hi Everyone,
I am using sqlite3 with python2.5 and the pysqlite wrapper. I am trying
to copy tables from one database (in memory) to another database (file)
using ATTACH. I looked on the internet and found a couple of sites that show
how to do this but the table schema is not copied.
def Save
On 30 Αύγ, 19:41, MRAB wrote:
> On 30/08/2010 04:33, Nik the Greek wrote:
>
>
>
>
>
>
>
> > On 30 Αύγ, 06:12, MRAB wrote:
>
> >> This part:
>
> >> ( not mycookie or mycookie.value != 'nikos' )
>
> >> is false but this part:
>
> >> re.search( r'(msn|yandex|13448|spider|crawl)', host )
On 30 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
> Nik the Greek wrote:
> >> Perhpas its doenst get loaded like that?
>
> >> # initialize cookie
> >> cookie = SimpleCookie()
> >> cookie.load( os.environ.get('HTTP_COOKIE', '') )
> >> mycookie = cookie.get('visitor')
>
> > Please someone else
On Aug 29, 8:46 pm, Lawrence D'Oliveiro wrote:
> In message
> <45e0772c-24a8-4cbb-a4fc-74a1b6c25...@n19g2000prf.googlegroups.com>,
>
> kevinlcarlson wrote:
> > I'm exploring the possibility of developing a helper app for an
> > existing internal company website. Basically, it would automatically
On 30 Αύγ, 19:41, MRAB wrote:
> On 30/08/2010 04:33, Nik the Greek wrote:
>
>
>
>
>
>
>
> > On 30 Αύγ, 06:12, MRAB wrote:
>
> >> This part:
>
> >> ( not mycookie or mycookie.value != 'nikos' )
>
> >> is false but this part:
>
> >> re.search( r'(msn|yandex|13448|spider|crawl)', host )
On 30/08/2010 3:24 PM, pyt...@bdurham.com wrote:
My understanding is that the only time one needs to use shell=True is
when they are 'executing' a non-executable file whose executable must be
discovered via file association rules? Does that sound accurate?
I'm not entirely sure what you mean by
On Mon, Aug 30, 2010 at 23:36, Nik the Greek wrote:
> # initialize cookie
> cookie = SimpleCookie()
> cookie.load( os.environ.get('HTTP_COOKIE', '') )
> visitor = cookie.get('visitor')
>
> This statement
>
> if (visitor.value != 'nikos') and re.search( r'(msn|yandex|13448|
> spider|crawl)', host
On 30/08/2010 18:16, Nik the Greek wrote:
On 30 Αύγ, 19:41, MRAB wrote:
On 30/08/2010 04:33, Nik the Greek wrote:
On 30 Αύγ, 06:12, MRABwrote:
This part:
( not mycookie or mycookie.value != 'nikos' )
is false but this part:
re.search( r'(msn|yandex|13448|sp
On 30/08/2010 18:36, Nik the Greek wrote:
On 30 Αύγ, 19:41, MRAB wrote:
On 30/08/2010 04:33, Nik the Greek wrote:
On 30 Αύγ, 06:12, MRABwrote:
This part:
( not mycookie or mycookie.value != 'nikos' )
is false but this part:
re.search( r'(msn|yandex|13448|sp
On 30 Αύγ, 20:53, MRAB wrote:
> > Why visitor.value is undefined?
>
> Because visitor is None. It's not seeing any cookie.
WHY NOT?!
THE COOKIE _DOES_EXIST !!!
What am i missing here?!
--
http://mail.python.org/mailman/listinfo/python-list
I just did 'make install' because according to the osx section of the
README:
On a clean OSX /usr/local does not exist. Do a
"sudo mkdir -m 775 /usr/local"
before you do a make install. It is probably not a good idea
to
do "sudo make install" which installs everythi
I'm a really strong front end web dev with an interest in becoming
more of a generalist web and app dev through Python. Anybody aware of
studios/agencies that actually prefer Python in Chicago I could keep
an eye on.
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger writes:
> On Aug 29, 8:33 am, Arnaud Delobelle wrote:
>> ernest writes:
>> > Hi,
>>
>> > The operator module provides separate functions for
>> > "in place" operations, such as iadd(), isub(), etc.
>> > However, it appears that these functions don't really
>> > do the operatio
Denis Gomes gmail.com> writes:
>
> Eventually my goal is to dynamically load and unload sections of a file based
database (could be tables or rows) in and out of memory for effeciency purposes.
Have you actually found this to be an useful optimization? SQLite already
internally caches database
On 8/30/2010 7:14 AM, Paul Rubin wrote:
example, tkinter has been part of the stdlib for at least a decade but
is totally undocumented in the Python library manual.
I have trouble equating 'totally undocumented' to about 400 lines + 200
for tix + 600 for ttk ;-). Yes, 400, while more than mos
On Mon, 30 Aug 2010 12:50:32 +0200, Thomas Jollans wrote:
>> Face the facts dude. The Python docs have some major problems.
>> They were pretty good when Python was a new, cool, project used
>> by a handful of geeks. They are good relative to the "average"
>> (whatever that is) open source proje
On 8/30/2010 12:23 AM, ru...@yahoo.com wrote:
The Python docs have some major problems.
And I have no idea what you think they are.
I have participated in 71 doc improvement issues on the tracker. Most of
those I either initiated or provided suggestions. How many have you
helped with?
--
T
On Mon, 30 Aug 2010 10:24:26 -0400, python wrote:
>> Kudos for avoiding shell=True
>
> My understanding is that the only time one needs to use shell=True is
> when they are 'executing' a non-executable file whose executable must be
> discovered via file association rules? Does that sound accurate
Hey Benjamin,
Take a look at this website I found about cached and in-memory databases.
I think the gist of the article is that caching is good if you are doing
SELECTs on data that is frequently used whereas in-memory speeds up
writes, (inserts and updates) to the db as well as querying. Maybe I
Hi,
Is there a python users group in the Research Triangle Park area
(North Carolina, USA)?
If there is not one and you're in the area and would be interested,
please send an email to jtim.arnold at gmail.com and I'll organize a
get-together to get one started.
I'll try to find a locale convenien
Denis Gomes gmail.com> writes:
>
>
> Hey Benjamin,
>
> Take a look at this website I found about cached and in-memory databases. I
think the gist of the article is that caching is good if you are doing SELECTs
on data that is frequently used whereas in-memory speeds up writes, (inserts and
On Mon, 2010-08-30 at 12:38 -0700, Tim Arnold wrote:
> Hi,
> Is there a python users group in the Research Triangle Park area
> (North Carolina, USA)?
Google "triangle python user's group"
--
http://mail.python.org/mailman/listinfo/python-list
Chris Withers wrote:
> Peter Otten wrote:
>>> My expectation of this is that if onerrors is left as None, names
>>> yielded will be importable.
>>
>> I would infer no such promise, especially as the generator also yields
>> modules, and no attempt at all is made to import those.
>
> Really?
Ye
On 8/30/2010 1:11 AM, Gregory Ewing wrote:
Nik the Greek wrote:
Yes i will i just asked to know if i were to substitute what might be
the problem so to understand why i need the quoting.
Because if you use % to build a query string, the result must
be syntactically valid SQL. The values that
Yep, I see what you are saying. I am going to do a bit more research to see
how sqlite3 works internally, ie. cache size, page size, etc, and then
decide if I will need to mess with in-memory databases.
Thanks for your insight, appreciate it.
Denis
On Mon, Aug 30, 2010 at 3:51 PM, Benjamin Pete
On 8/30/2010 12:00 PM, Benjamin Peterson wrote:
Denis Gomes gmail.com> writes:
Eventually my goal is to dynamically load and unload sections of a file based
database (could be tables or rows) in and out of memory for effeciency purposes.
Have you actually found this to be an useful optimiz
John Nagle animats.com> writes:
> "sqlite" has reasonably good SELECT performance on simple indices,
> but anything beyond that isn't all that great. Multiple processes
> updating the same sqlite database will have terrible performance,
> because the locking mechanism not only locks the entir
In message
<61894f54-90ff-4e0e-9c81-860b6e9cd...@p12g2000prn.googlegroups.com>,
kevinlcarlson wrote:
> On Aug 29, 8:46 pm, Lawrence D'Oliveiro
> wrote:
>>
>> In message
>> <45e0772c-24a8-4cbb-a4fc-74a1b6c25...@n19g2000prf.googlegroups.com>,
>> kevinlcarlson wrote:
>>>
>>> I'm exploring the poss
In message <7xr5hguzzi@ruckus.brouhaha.com>, Paul Rubin wrote:
> JHC (experimental Haskell compiler) recently started using a mixture of
> gc and region inference. It will be interesting to see how that works
> out.
That’s what people have been saying about garbage collection for about half
In article <878w3ogpvq@benfinney.id.au>,
Ben Finney wrote:
>a...@pythoncraft.com (Aahz) writes:
>>
>> That reminds me: one co-worker (who really should have known better ;-)
>> had the impression that sets were O(N) rather than O(1).
>
>For settling exactly this kind of confusion, Python's st
I may be having a brain fart, but is it at all possible to have a
function first return a value then continue its calculation. Like this
simple example:
my_var = 5
def my_function():
return my_var
my_var +=1
This obviously won't work as written but is there a cleaver way around this.
--
On 31/08/2010 01:05, Bradley Hintze wrote:
I may be having a brain fart, but is it at all possible to have a
function first return a value then continue its calculation. Like this
simple example:
my_var = 5
def my_function():
return my_var
my_var +=1
This obviously won't work as writt
Lawrence D'Oliveiro writes:
> Meanwhile, real-world programmers get on to writing real-world code that is
> productive and efficient on real-world systems.
It's pretty well established by now that GC doesn't have any significant
speed penalty compared with manual allocation. It does consume mor
a...@pythoncraft.com (Aahz) writes:
> Possibly; IMO, people should not need to run timeit to determine basic
> algorithmic speed for standard Python datatypes.
Indeed. Alex Stepanov (designer of C++ Standard Template Library) was
emphatic that algorithm complexity assertions should be part of the
I'm writing a short (200 lines) script that has half-a-dozen parameter
options, and using optionParser to process the options.
I try to write well-written procedural programmes with functions doing one
thing well, and so on. The problem I'm getting is that, inevitably, the
function that uses Opt
Hello,
Windows 2003, 64-bit, standard edition server with IIS 6.0. I
followed the MS instruction sheets on setting up CGI application with
Python as scripting engine. I'm just getting 404 for the test script,
whereas an html file in the same virtual directory is properly
displayed.
Here:
Creat
I'm interested in studying the itertools source code, especially the
permutations function.
However, I cannot find the library. Where could I find it?
Running Python 3.1
Thank you
--
http://mail.python.org/mailman/listinfo/python-list
In message <9aa266f0-be9b-4c9a-bfbd-6cdfc86ad...@t20g2000yqa.googlegroups.com>,
vsoler wrote:
> I'm interested in studying the itertools source code, especially the
> permutations function.
>
> However, I cannot find the library. Where could I find it?
l...@theon:python> apt-get source python3.
On Tue, Aug 31, 2010 at 7:30 AM, vsoler wrote:
> I'm interested in studying the itertools source code, especially the
> permutations function.
>
> However, I cannot find the library. Where could I find it?
>
> Running Python 3.1
>
> Thank you
>
Either you can download it or browse it on the net.
On 31 ago, 04:14, Lawrence D'Oliveiro wrote:
> In message
> <9aa266f0-be9b-4c9a-bfbd-6cdfc86ad...@t20g2000yqa.googlegroups.com>, vsoler
> wrote:
>
> > I'm interested in studying the itertools source code, especially the
> > permutations function.
>
> > However, I cannot find the library. Where c
vsoler writes:
> I was expecting an itertools.py file, but I don't see it in your list.
>> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c
looks promising. Lots of stdlib modules are written in C for speed or
access to system facilities.
--
http://mail.python.org/mailman/listinfo/python-l
On 31 ago, 04:42, Paul Rubin wrote:
> vsoler writes:
> > I was expecting an itertools.py file, but I don't see it in your list.
> >> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c
>
> looks promising. Lots of stdlib modules are written in C for speed or
> access to system facilities.
Lawr
On Aug 31, 3:45 am, NickC wrote:
> I'm struggling to see how you could refactor the option parsing function.
> After all, it has to process the options, so it has to do all the setup
> for those options, and then process them.
Perhaps plac could simplify your life, by removing most of the
boilerp
On Mon, Aug 30, 2010 at 11:06 PM, vsoler wrote:
> On 31 ago, 04:42, Paul Rubin wrote:
>> vsoler writes:
>> > I was expecting an itertools.py file, but I don't see it in your list.
>> >> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c
>>
>> looks promising. Lots of stdlib modules are writte
Bradley Hintze wrote:
I may be having a brain fart, but is it at all possible to have a
function first return a value then continue its calculation. Like this
simple example:
my_var = 5
def my_function():
return my_var
my_var +=1
This obviously won't work as written but is there a cleav
On Mon, Aug 30, 2010 at 22:06, vsoler wrote:
> On 31 ago, 04:42, Paul Rubin wrote:
> > vsoler writes:
> > > I was expecting an itertools.py file, but I don't see it in your list.
> > >> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c
> >
> > looks promising. Lots of stdlib modules are wri
On 8/30/2010 10:27 PM, vsoler wrote:
I was expecting an itertools.py file, but I don't see it in your
list.
The manual page has the original python source for each function.
I recommend you look at that.
Itertool was rewritten in C for speed but the C source will not tell you
any more about t
1 - 100 of 105 matches
Mail list logo