On Sat, 10 Dec 2005 11:54:47 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>> On Sat, 10 Dec 2005 02:21:39 -0700, Shane Hathaway <[EMAIL PROTECTED]> wrote:
>>>How about PyLint / PyChecker? Can I configure one of them to tell me
>>
uot;,)
>>> type(t2)
>>> t3 = "blah",
>>> type(t3)
>>>
It's the comma that makes it a tuple. The parenthesis are only required in
cases where the expression might mean something else without them.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
de that mostly calls
>into C libraries that release the GIL. For example, a threaded spider
>scales nicely on SMP.
Yes. Nearly as well as a single-threaded spider ;)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
tion("News Site")
webserver = appserver.NevowSite(NewsIndex(cp))
internet.TCPServer(80, webserver).setServiceParent(application)
# Run with twistd -noy
For more information about Nevow, checkout the Wiki -
<http://divmod.org/trac/wiki/DivmodNevow> - or the mailing list -
<http://twist
On 18 Dec 2005 12:27:55 -0800, [EMAIL PROTECTED] wrote:
>Hi Jean-Paul,
>
>I am a bit lost in you code. Is it possible for you to step through
>it?
For in depth-assistance, it would probably be best to continue on [EMAIL
PROTECTED] You might also want to check out some of the lin
7;t a web
framework, though it includes an HTTP server.
>Webware : Python licence
>Zope : ZPL (Zope Public Licence)
>
>There doesn't seem to be an obvious choice, but the GPL isn't used much
>here
>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
.
You might also address it as a deployment issue, and run fewer programs on the
host in question, or reboot it more frequently.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ple pieces, pass parts of it around as real, live objects with
introspectable APIs, allow for mutation of portions of the query,
re-arrange it, etc. All this is possible with strings too, just way
harder :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
seg(x):return urllib2.urlopen('http://7seg.com/'+x).read()
>>
>And another one from me as well.
>
>class a:
> def __eq__(s,o):return 1
>seven_seg=lambda i:a()
>
This is shorter as "__eq__=lambda s,o:1".
But I can't find the first post in this thread... What are you
guys talking about?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
rue,
outlineColor=(1, 1, 1),
fillColor=(0, 0, 0.25)):
...
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
or like this:
import copy
tmp = copy.copy(myList)
This is as opposed to a deep copy, which is like this:
import copy
tmp = copy.deepcopy(myList)
What "tmp = myList" does is to create a new *reference* to the
very same list object.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
bit processor, and Python ints appear to be 64-bit as well, so even
>if len() only works with ints, it should still be able to handle 64-bit
>values.
Conspicuous timing:
<http://mail.python.org/pipermail/python-dev/2005-December/059266.html>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
seHTTPServer in the standard library
will address /this/ particular issue (there are lots of other solutions, too,
not just these four). Some of them may address other issues better or worse
than others.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
he list calling
join on each one. join will block until the thread's function
returns.
>
> # How do I print "order" after all the threads are complete?
> print "\nThreads were processed in the following order:"
> for i, person in enumerate(order): print "%d. %s" % (i+1,person)
>
>if __name__ == "__main__":
> main()
>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ne 10, in testSomeName
self.assertEquals(x.someName, "bye")
twisted.trial.unittest.FailTest: 'hello' != 'bye'
-
Ran 1 tests in 0.278s
FAILED (failures=1)
[EMAIL PROTECTED]:~$
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
d -- hence the funny interface
for lock, where a function is called once the lock is aquired.
If you are looking for a mutex suitable for multithreaded use, see the
threading module.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
its" or "license" for more information.
>>> import sys
>>> sys.setrecursionlimit(10)
__main__:1: DeprecationWarning: integer argument expected, got float
>>> (lambda f: f(f))(lambda f: f(f))
Segmentation fault
[EMAIL PROTECTED]:~$
I could probably dig up a few more, if you want. So what's ctypes on top of
this?
Jean-Paul
>
>Neil
>--
>http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
It's
important to keep the two kinds of tests separate. Integration
tests are great for telling you that something has gone wrong,
but if you get rid of all your unit tests in the process of writing
integration tests, you will have a more difficult time determining
*what* has gone wrong.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
r, it
won't work for anything:
>>> iter(5)
Traceback (most recent call last):
File "", line 1, in ?
TypeError: iteration over non-sequence
This is "duck typing" in action.
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
#x27;) will do the same job without the security
>hole:
Using marshal at all introduces a similar security hole, so security is not an
argument against repr()/eval() in this context.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
re a multiple of the filesystem block size, would it guarantee
reads on block-boundaries (where possible)?
* How would it handle EOF? Would it stop iterating immediately after the
first short read or would it wait for an empty return?
* What would the buffering behavior be? Could one interlea
e on a platform with statvfs(2):
>>> import os
>>> s = os.statvfs('/')
>>> s.f_bavail * s.f_bsize
59866619904L
>>>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
+ a
else:
a = _x
else:
a = b + a
else:
if hasattr(a, '__iadd__'):
_x = a.__iadd__(b)
if _x is NotImplemented:
a = b + a
else:
a = _x
else:
a = b + a
Roug
On 20 Jan 2006 06:01:15 -0800, datbenik <[EMAIL PROTECTED]> wrote:
>How can i write a program that supports simultaneous multipart
>download. So i want to open multiple connections to download one file.
>Is this possible. If so, how?
http://twistedmatrix.com/
>
>--
>http://mail.python.org/mailman
s, they will fail
and you will know you need to fix your code.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ple: thread receives a
>message, stops everything, and processes the message.
>
And what happens if the thread was halfway through a malloc call and
the data structures used to manage the state of the heap are in an
inconsistent state when the interrupt occurs?
This has been discussed m
On Mon, 24 Jul 2006 13:51:07 -0700, "Carl J. Van Arsdall" <[EMAIL PROTECTED]>
wrote:
>Jean-Paul Calderone wrote:
>> On Mon, 24 Jul 2006 11:22:49 -0700, "Carl J. Van Arsdall" <[EMAIL
>> PROTECTED]> wrote:
>>
>>> Steve Ho
esolv.conf then the browsers only
>recognize the hosts we want
Twisted includes a DNS server which is trivially configurable to perform
this task. Take a look.
http://twistedmatrix.com/
http://twistedmatrix.com/projects/names/documentation/howto/names.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
the solution is simple: don't do things like this ;)
It is allowed at all because, to the runtime, "x.someattr = someval" is
no different from "self.someattr = someval". The fact that a different
name is bound to a particular object doesn't matter.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ack
>a backtrace in case of errors in the python code.
I think you'd have more luck with the traceback module, which has such
methods as format_exception and print_tb.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ising an exception in your own thread is pretty trivial. SIGALRM does
no good whatsoever here. :)
Besides, CPython will only raise exceptions between opcodes. If a
misbehaving thread hangs inside an opcode, you'll never see the exception
from SIGALRM.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
.gmane.org/gmane.comp.python.devel/82129
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
;>> list.append = lambda self, value: 'hello, world'
>>>> x = []
>>>> x.append(10)
'hello, world'
>>>> x
[]
>>>>
As alternate implementations become more widely used, it will be important
to nail down ex
combined with the fact that in Python you
/still/ cannot handle a signal until the interpreter is ready to let you
do so (a fact that seems to have been ignored in this thread repeatedly),
signals end up not being a solution to this problem.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
try:
return threading.Thread.run(self)
except Exception, e:
print 'Exiting', e
def main():
threads = []
for f in timeSleep, childSleep, catchException:
t = KillableThread(target=f)
t.start()
threads.a
p but lead to misunderstandings.
>to *really* suspend the stack at a given time and do a bunch of crazy
>stuff, but doesn't currently support 'full continuations'.
>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
l don't think meaningful indentation is good.
If your example were actually valid (which it isn't), all it would
demonstrate is that Python should be even stricter about indentation,
since it would have meant that there is still some whitespace which
has no meaning and therefore can be adjusted in meaingless ways by
each programmer, resulting in unreadable junk.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
k when all the other
# Deferreds in this list have been called back.
d = defer.DeferredList(completionDeferreds)
# And tell it to stop the reactor when it fires
d.addCallback(lambda result: allConnectionsLost())
# Start the reactor so things can start happening
reactor.ru
thod(fromPickleFile)
You can then use this like so:
inst = Obj.fromPickleFile('obj.dat')
Jean-Paul
>
>Anton
>--
>http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
On 12 Aug 2006 10:44:29 -0700, zxo102 <[EMAIL PROTECTED]> wrote:
>Jean-Paul,
>Thanks a lot. The code is working. The python twisted is new to me too.
>Here are my three more questions:
>1. Since the code need to be started in a wxpyhon GUI (either by
>clicking a button or up
On 12 Aug 2006 21:59:20 -0700, zxo102 <[EMAIL PROTECTED]> wrote:
>Jean-Paul,
>I just start to learn Twisted. Here is my simple case: I can find
>the data sent by clients in dataReceived but I don't know which
>client/which port the data is from. After I know where the
On 15 Aug 2006 10:06:02 -0700, KraftDiner <[EMAIL PROTECTED]> wrote:
>How can you tell if the host processor is a big or little endian
>machine?
>
sys.byteorder
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
nd from google searches are not really as
>> robust as I need them to be.
>
>Would email.Utils.parseaddr() fit the bill?
>
>http://docs.python.org/lib/module-email.Utils.html#l2h-3944
>
This is for RFC 2822 addresses.
http://divmod.org/trac/browser/sandbox/exarkun/smtp.
buf = ''
def dataReceived(self, bytes):
self.buf += bytes
exit = self.buf.find('exit')
if exit != -1:
self.transport.write(self.buf[:exit])
self.buf = self.buf[exit + 4:]
reactor.stop()
else:
self.transport.write(self.buf)
self.buf = ''
f = protocol.ServerFactory()
f.protocol = Server
reactor.listenTCP('192.168.1.101', 8080, f)
reactor.run()
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On 5 Oct 2006 07:01:50 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote:
> [snip]
>
>Jean-Paul many thanks for this and your effort.
>but why is it every time I try to do something with 'stock' python I
>need another package?
Maybe you are trying to do things that a
unsupported operand type(s) for &: 'set' and 'instance'
the hard olution would add the following behavior:
>>>(s&ws).__class__() is WeakSet
True
Any hint for the easy solution ?
for the hard one ?
Jean-Philippe
--
http://mail.python.org/mailman/listinfo/python-list
and AFAIK, the original urllib
>code is irreversibly overwritten. Am I right?
Mostly. However, Try importing urllib first, grabbing the open_https function,
then importing M2Crypto, then reversing what M2Crypto did by putting the
original open_https function back onto URLopener.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
opIteration:
... break
...
0
2
4
6
8
10
12
14
16
18
>
>Now, I was expecting that to be 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20.
>
>What am I missing here?
Your code was calling next and send, when it should have only been calling
send.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
7;header.html').read()
>
>Not quite as elegant as include('header.html'), but it seems like it
>would work.
def include(filename):
print open(filename).read()
include('header.html')
Behold, the power of a general purpose programming language.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
uccessful result. If all of your processing is synchronous,
then you simply need to return twisted.internet.defer.succeed(None) at the
end of the function. If you have asynchronous processing to do (it does not
appear as though you do), you will need to return a Deferred which only fires
once that processing has been completed.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
check the current time against the top element's time.
You could also use Twisted, which provides time-based primitives in addition
to supporting network multiplexing without threads.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 13 Oct 2006 18:44:35 +0200, Jan Bakuwel <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>
>> The return value of eomReceived is used to determine whether to signal to
>> the SMTP client whether the message has been accepted. Regardless of your
>>
on the relevant mailing list for people talking about using ZODB with
>Python 2.5.
>
>2) Just try it. Install Python 2.5 alongside 2.4, install ZODB, run the test
>suite.
>
These are pretty good suggestions, though, particularly the latter.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
interpolation mechanism. Typically,
you cannot use them with database, table, or column names. Likewise,
this won't work:
execute("SELECT foo ? bar WHERE baz", ("FROM",))
The rule is difficult to express simply (at least, I have never seen
it expressed simply), but it goes something like "bind parameters only
work on values, not schema elements or syntactic constructs".
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
/originalgamer.cvs.sourceforge.net/originalgamer/originalgamer/originalgamer/ansi.py?revision=1.12&view=markup
may be of some interest.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
and it probably even makes sense
to recommend the high-level interface for most applications). Python doesn't
always do a good job of keeping the high and low levels separate though, and
this seems like an area in which Python could stand some improvement.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 22 Oct 2006 19:58:44 +0200, Irmen de Jong <[EMAIL PROTECTED]> wrote:
>Jean-Paul Calderone wrote:
>> I think everyone can agree that Python shouldn't crash.
>
>Well, it doesn't really crash in a bad way, in my example:
>it doesn't work because it s
se
> workarounds. That would make user code a lot cleaner and less
> error prone, and more portable. What do other people think?
>
>
> Regards
> --Irmen de Jong
Jean-Francois Pieronne
--
http://mail.python.org/mailman/listinfo/python-list
Irmen de Jong a écrit :
> Jean-François Piéronne wrote:
>
>> Which Python version, OpenVMS version, IP stack and stack version?
>
> OpenVMS 7.3-2, Python 2.3.5, no idea about IP stack version.
>
Thanks, may be upgrade to Python 2.5 will solve the problem.
>> If yo
Irmen de Jong wrote:
> Martin v. Löwis wrote:
[snip]
>> Perhaps you had some different work-around in mind?
>
> Nope, I was indeed thinking about splitting up the recv() into
> smaller blocks internally.
> Maybe a more elaborate check in Python's build system (to remove
> the MSG_WAITALL on VMS) w
oop you'll find debugging and testing much easier.
4) Use an existing library instead of developing a new one.
5) (Only included so I don't look like a _complete_ jerk. If you get this
far and you haven't fixed the problem yet, consider this a booby prize.)
http://divmod.org/trac/browser/trunk/Epsilon/epsilon/spewer.py
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
hand, if all you do is write them to stdout, your actual terminal
should handle them. You'll only need an extra layer if you want to do extra
interpretation.
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
?:
>http://twistedmatrix.com/documents/current/api/twisted.python.dispatch.EventDispatcher.html
Note, however:
>>> from twisted.python import dispatch
__main__:1: DeprecationWarning: Create your own event dispatching mechanism,
twisted.python.dispatch will soon be no more.
Take a look at
<http://twistedmatrix.com/documents/current/api/twisted.enterprise.adbapi.html>.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
;> raise ValueError
collected
Traceback (most recent call last):
File "", line 1, in ?
ValueError
>>>
>
>And some other minor question: Is there a way to query the use count
>of an object? This would be useful for debugging and testing.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
;> Is the only solution to use a threaded server to let my clients make
>> their requests and receive a response in the fastest possible time?
>
>Maybe. Probably not. It's all good -- multi-threading is your friend.
>
Multithreading is _someone's_ friend. Probably not the OP'
but I would expect it does too. Are you certain you need this complexity?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 2 Nov 2006 14:15:58 -0500, Jean-Paul Calderone <[EMAIL PROTECTED]>
wrote:
>On Thu, 02 Nov 2006 19:32:54 +0100, robert <[EMAIL PROTECTED]> wrote:
>>I'd like to use multiple CPU cores for selected time consuming Python
>>computations (incl. numpy/scipy) in
that would probably benefit from something more correct
than what's at the above URL.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
o find out what specific file name is causing the problem
>(whereas when listdir failed completely, you could not easily find
> out the cause of the failure).
>
>How would you propose listdir should behave?
Umm, just a wild guess, but how about raising an exception which includes
the name of the file which could not be decoded?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
nd don't deserve
outbursts like this one, regardless of what you think of their responses.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
/setsid',
['setsid', '/usr/bin/vi'])
self.transport.loseConnection()
f = protocol.ServerFactory()
f.protocol = ViRunner
reactor.listenTCP(, f)
reactor.run()
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
> Anybody think this would be fun?
Use Twisted instead. It supports every protocol you mentioned, and
rate limiting too.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
me size!"
>else:
>print "They're not the same size!"
>
No, this is wrong.
>>> a = range(100)
>>> b = range(100)
>>> len(a) is len(b)
False
Use "is" to determine if two variables refer to exactly the same
object, never to determine if two objects are equal.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
... s[vbl] = ''
>
Hey Tim,
Actually this doesn't work for locals at all:
>>> def f():
... x = 'x'
... locals()['x'] = 'y'
... print x
...
>>> f()
x
>>>
Locals cannot be mod
ands for it to run. Of course, xterm isn't a very
good win32 program to run but I couldn't think of a better example.
You could also write a program to send command requests to this
server, instead of using telnet.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
s
which use this feature and go to the trouble of modifying your own
site.py for them, you won't be able to, since there can only be one
default system encoding. Only one will be able to work at a time.
The default encoding is ascii and should always be ascii. If you want
another encoding, specify it in a call to .encode() or .decode().
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ted subtest.imptest. Since the first
imptest was imported by the name imptest, subtest.imptest was determined
to be a different module and re-executed.
Set __name__ to 'subtest' as it would be if you had really imported
subtest and the import system will correctly name the modules, causing
imptest to be imported only once.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
much difference.
If you look at the capabilities gmail's POP3 server publishes, you even
see they are declaring a five minute login delay. This is intended as
a hint to clients that logins more frequent than one per five minutes are
not allowed.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
uot; would be great as I am
>a "baby python" who is very green with threading..
Threaded programming is extremely difficult. Most good newbie introductions
to it consist of warnings not to use it.
Do you have a particular application in mind? Perhaps someone can suggest
a more spec
i.e. MySQL.
See these Python 2.5 docs:
http://docs.python.org/dev/lib/module-sqlite3.html
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
i.list.org/display/DEV/Summer+of+Code
>
Just pointing out that there is no RFC 8222. I assume you mean
RFC 2822. I wouldn't mention it but this mistake is repeated
several times on the wiki page.
Jean-Paul
http://divmod.org/
--
http://mail.python.org/mailman/listinfo/python-list
escribe them in more detail (for example, what does "high
performance" mean to you?) someone can make a more useful recommendation.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
ted.internet import reactor
def main():
reactor.spawnProcess(
None,
'/usr/bin/fluidsynth',
['fluidsynth', '-ni', '/home/mysndfont.sf2', 'mymidi.mid'])
reactor.run()
Your Gtk app won't block and you won't have to worry about the
threading/forking/signal interaction that is messing you up now.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
def lineReceived(self, line):
print 'Received line:', repr(line)
factory = protocol.ServerFactory()
factory.protocol = LineEcho
reactor.listenTCP(12345, factory)
reactor.run()
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
Another solution which might be better is to select a data type for this
column which can handle arbitrary bytes. This will let you avoid mangling
the input completely. Different databases have different column types
for handling this. For PostreSQL, you might want to look at BYTEA.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
sible to do something similar with
>generators. The best way to explain is by code example:
>
>def add_generators(gen1, gen2):
>for x in gen1:
>yield x
>for y in gen2:
>yield y
>
>Just a thought...
You can chain any iterators using itertools.chain(
t;denotes the name of an *instance*, in contrast to a *class* which is
>named with TitleCase.
>
>The camelCase style is less popular in the Python world, where (as per
>PEP 8) instances are named with all lower case, either joinedwords or
>separate_by_underscores.
Not that this pre
input. The flush method only relates to output. The
*other* side of the file has to flush *its* output in order for you to
see it as input.
On Linux, the termios module provides a way to tell the system not to do
any buffering on a file descriptor. pywin32 may expose equivalent
functionality for W
t. It will speed up your development time and reduce the
amount of defects you need to deal with. It will
>
>If it makes a difference: Depending on performance parts of this app may
>well
>end up as a prototype for a final (...alternative?) C++ implementation.
>
>Thanks for consideration,
Hope this helps,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
56623L, None)
> >>> class A(object):
>... def __getitem__(self, s):
>... print s
>...
> >>> A()[0:3**33]
>slice(0, 555906056623L, None)
> >>>
Note that it _does_ happen with current [EMAIL PROTECTED]:
Python 2.6a0 (trunk:51698M, Sep 3 2006, 12:40:55)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> slice(0, 3 ** 33)
slice(0, 555906056623L, None)
>>> class x:
... def __getitem__(self, idx): print idx
...
>>> x()[:3**33]
slice(0, 2147483647, None)
>>>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
use it, so if most people
don't use it, then it may be removed from Py 3.0.
If you really need division, you may use:
x * (y ** -1)
Bye,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
by that fact that I have since written one Py script (in
>IDLE) which creates and populates a db, and another that can retrieve
>the data. But...
Just make sure everyone who should be able to read and write the database
has read and write permissions on the database file. Nothing more is
necessary.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
at while
they are blocked on the network or the disk, another thread can continue
to execute. Extension modules which perform computationally intensive
tasks can also release the GIL to allow better exploitation of SMP
resources.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
le "", line 1, in ?
TypeError: () takes no arguments (1 given)
>>>
In which case, staticmethod() is actually the solution you want:
>>> class w(object):
... w = staticmethod(lambda: None)
...
>>> w().w()
>>>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
I just prefer specific to non-specific.
Hope to see you over on the Twisted list,
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
)
> File "/usr/local/lib/python2.4/asyncore.py", line 122, in poll
>r, w, e = select.select(r, w, e, timeout)
>KeyboardInterrupt
What does /proc/ say about the server's open file descriptors? What
about r, w, e, and timeout? What are their values?
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
alf as much time were spent cutting code as is spent
discussing the matter, we might learn if there were any value in doing so.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
itly shows the semantics actually desired. Not that
>"huge" a benefit as far as I can tell. Lisp programmers have gotten
>along fine without it for 40+ years...
Uh yea. No lisp programmer has ever written a with-* function... ever.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
or change. There is no such guarantee right now; there is just an
>implementation artifact in CPython that has led to careless habits
>among some users.
Actually, there is an API for instructing the GC how frequently to run,
in addition to the explicit API for causing the GC to run when you invoke
it. See the gc module for more information.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
oesn't require modules to be importable to examine them and it is
significantly faster.
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
701 - 800 of 1970 matches
Mail list logo