New submission from Andreas Kostyrka:
import datetime, pprint
pprint.pformat({datetime.datetime.now(): 1, None: 1})
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.7/pprint.py, line 63, in pformat
return PrettyPrinter(indent=indent, width=width
Andreas Kostyrka added the comment:
This also applies to sets.
--
title: pprint not handline uncomparable dictionary keys well - pprint not
handline uncomparable dictionary keys, set members well
___
Python tracker rep...@bugs.python.org
http
On Sun, Dec 14, 2008 at 05:03:38PM +0100, David Hláčik wrote:
Hi guys,
#! /usr/bin/python
import random
import bucket2
data = [ random.randint(1,25) for i in range(5)]
print random data : %s % data
print result: %s %bucket2.sort(data)
How to write a test script which will outputs
Am Sun, 14 Dec 2008 20:38:58 -0800 (PST)
schrieb cm_gui cmg...@gmail.com:
hahaha, do you know how much money they are spending on hardware to
make
youtube.com fast???
yeah, as they do for basically all big sites, no matter what language
is used for implementation.
Next is the fact that
On Fri, Dec 12, 2008 at 06:17:43AM -0800, sturlamolden wrote:
None of those projects addresses inefficacies in the CPython
interpreter, except for psyco - which died of an overdose PyPy.
Bullshit. All that discussion about performance forgets that performance is a
function of the whole system,
Am Donnerstag, den 05.01.2006, 15:03 -0800 schrieb [EMAIL PROTECTED]:
I know this sounds like brutal, but I've been developing Python code for
a decade now, and I've almost never used pdb.py. OTOH I also use gdb
only for bt from a core file.
Sorry to sound harsh, I do not consider manually
Am Donnerstag, den 05.01.2006, 21:34 -0800 schrieb [EMAIL PROTECTED]:
[EMAIL PROTECTED] wrote:
Mike I don't use pdb a lot either - and I write a *lot* of Python.
Ditto. I frequently just insert prints or enable cgitb. Sometimes I enable
line tracing for a specific function and the
Am Mittwoch, den 30.11.2005, 08:15 -0700 schrieb Steven Bethard:
David Rasmussen wrote:
Harald Armin Massa wrote:
Dr. Armin Rigo has some mathematical proof, that High Level Languages
like esp. Python are able to be faster than low level code like
Fortran, C or assembly.
Faster
Am Montag, den 05.12.2005, 21:30 -0500 schrieb Ervin J. Obando:
Hi everyone,
Apologies if my question is a bit novice-ish. I was wondering if there
was a way of creating a Dynamic Link Library with Python.
Probably yes. But why would you want to do that? Actually the way would
be to create
On Thu, Oct 20, 2005 at 12:05:05PM +0530, Iyer, Prasad C wrote:
Do we have something like abstract methods Abstract class.
So that my class would just define the method. And the implementation
would be defined by somebody else.
class AbstractBase:
def method(self):
raise
Am Sonntag, den 28.08.2005, 21:36 + schrieb Chris Spencer:
Is there any library for Python that implements a kind of universal
number object. Something that, if you divide two integers, generates a
ratio instead of a float, or if you take the square root of a negative,
generates a
On Wed, Aug 24, 2005 at 09:49:01AM +0100, Richie Hindle wrote:
[Chris]
Not to be a shill, but I'd be interested in testimonials on
http://linode.org/
I wonder if virtualization is the next killer app.
Certainly blows the WTF my ISP? question away...
I can't speak for linode.org, but
Am Samstag, den 13.08.2005, 14:01 -0700 schrieb CG:
Well, you have described your problem nicely. One thing that's missing
is how to deal with incorrect input. (For example missing connect or
disconnect messages).
Furthermore, you can now:
a) try to find somebody who writes it for you. How you
Completly untested:
#!/usr/bin/env python
import sys, datetime
user = sys.argv[1]
starttime = None
for l in sys.stdin:
flds = l.strip().split()
datestr, timestr, prog, op, to, sname = flds
month, day, year = [int(x) for x in datestr.split(-, 2)]
hour, min, sec, ms = [int(x) for
Completly untested:
#!/usr/bin/env python
import sys, datetime
user = sys.argv[1]
starttime = None
for l in sys.stdin:
flds = l.strip().split()
datestr, timestr, prog, op, to, sname = flds
month, day, year = [int(x) for x in datestr.split(-, 2)]
hour, min, sec, ms = [int(x) for
I've just noticed that you didn't mention any details like OS, versions,
network infrastructure. You do not mention either how large the difference
is.
Andreas
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jul 22, 2005 at 07:40:00PM +0200, Ximo wrote:
Can I do a function which don't return anything?
The question is that, if I do a function that have a return or without
return, it returns always None, but i want that it doesnt return me
nothing
Define nothing :)
None is the
On Wed, Jul 20, 2005 at 04:22:10PM +0200, Fabien wrote:
Python is not about certificates or diplomas, so do not spend any
money on it (the other guy was only joking).
Even if Python is not about certificates, I think it's not the case for
some company. And when you say to a company that
Am Montag, den 11.07.2005, 06:29 -0700 schrieb [EMAIL PROTECTED]:
Hi,
Sorry to post what might seem like a trivial problem here, but its
driving me mad!
I have a simple https client that uses httplib to post data to a web
server.
When I post over http https using curl the data is
Am Montag, den 04.07.2005, 20:25 -0400 schrieb Roy Smith:
Steven D'Aprano [EMAIL PROTECTED] wrote:
Should we *really* be encouraging newbies to mess with globals() and
locals()? Isn't that giving them the tools to shoot their foot off before
teaching them how to put shoes on?
Why risk
Am Montag, den 04.07.2005, 15:36 -0400 schrieb Jeffrey Maitland:
Hello all,
Ok, first thing to consider is that time.sleep in Python does in reality
(on Debian Linux, Python2.3) a select syscall with 3 NULLs to wait the
time. (The real sleep POSIX call might have stupid interactions with
Am Dienstag, den 05.07.2005, 08:37 -0700 schrieb Jonathan Ellis:
In many ways, Python is an incredibly bad choice for deeply
multithreaded applications. One big problem is the global interpreter
lock; no matter how many CPUs you have, only one will run python code
at a time. (Many people
Am Donnerstag, den 07.07.2005, 22:56 + schrieb Grant Edwards:
Oh. I assumed that CPython used Posix threads on Posix
It does.
platforms. At least in my experience under Linux, libpthread
always creates an extra manager thread. Though in our case
It probably does. But it will probably
Am Mittwoch, den 06.07.2005, 04:00 + schrieb Dennis Lee Bieber:
{I'm going to louse up the message tracking here by pasting part of
your
follow-up into one response}
2 Upon further thought, that just can't be the case. There has
2 to be multiple instances of the intepreter because the
Am Mittwoch, den 06.07.2005, 14:38 + schrieb Grant Edwards:
Unfortunately that means you've got to debug a number cruncher
that's written in C.
If one is careful, one can use Pyrex :)
Andreas
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
--
Am Mittwoch, den 06.07.2005, 12:27 -0700 schrieb Jonathan Ellis:
Your sarcasm is cute, I suppose, but think about it for a minute. If
the opposite of what I assert is true, why would even the mainstream
press be running articles along the lines of multicore CPUs mean
programming will get
On Thu, Jul 07, 2005 at 10:21:19PM -0700, Jacob Page wrote:
Jeremy Moles wrote:
This is my first time working with some of the more lower-level python
stuff. I was wondering if someone could tell me what I'm doing wrong
with my simple test here?
Basically, what I need is an easy way
Am Freitag, den 01.07.2005, 10:53 -0700 schrieb Scott David Daniels:
Terry Hancock wrote:
I only just recently had a look at the shelve module
That would be handy if, for example, I wanted to couple
(and compress into the bargain) by putting my two
shelf files into a single zip
Am Freitag, den 01.07.2005, 18:55 +0200 schrieb Harry George:
Tom Anderson [EMAIL PROTECTED] writes:
On Fri, 1 Jul 2005, Adriaan Renting wrote:
I'm not a very experienced Python programmer yet, so I might be
mistaken, but there are a few things that would make me prefer C++
over
Am Samstag, den 02.07.2005, 15:11 +0100 schrieb Tom Anderson:
On Fri, 1 Jul 2005, Andreas Kostyrka wrote:
Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis:
Again, how? Is there a way to force that an external user of my lib can
not use my internal data/methods/classes
import os as realos
Names are nothing magic in Python, and quite easily manipulated:
import os
os.write(1, Hello World!)
class os:
pass
o = os()
import os
os.write(1, \n)
So basically this kind of name clashes usually do not happen in Python.
Or another usage:
os = SomeObject()
def
Am Freitag, den 01.07.2005, 13:50 +0100 schrieb Tom Anderson:
On Fri, 1 Jul 2005, Adriaan Renting wrote:
I'm not a very experienced Python programmer yet, so I might be
mistaken, but there are a few things that would make me prefer C++ over
Python for large (over 500.000 LOC) projects.
Just a guess, but setting __X__ special methods won't work in most cases
because these are usually optimized when the class is created.
It might work if a.__call__ did exist before (because class a: contained
a __call__ definition).
Andreas
On Wed, Jun 29, 2005 at 09:15:45AM +0100, Michael
Just out of curiosity, does the filesystem support seperate a/m/c times?
Andreas
On Fri, Jun 24, 2005 at 02:49:01PM +0300, Eser Çetinkaya wrote:
In your documentation, it is written :
os.path.getatime(path)
Return the time of last access of path. The return value is a
What's wrong with
(os.path.join(d, x) for x in os.listdir(d))
It's short, and easier to understand then some obscure option ;)
Andreas
On Thu, Jun 23, 2005 at 11:05:57AM +0200, Riccardo Galli wrote:
On Wed, 22 Jun 2005 11:27:06 -0500, Jeff Epler wrote:
Why not just define the function
On Tue, Jun 21, 2005 at 12:06:47PM +, Bue Krogh Vedel-Larsen wrote:
How do I delete a class instance created using PyInstance_New? I've tried
calling Py_CLEAR on the instance, but __del__ isn't called. I've also tried
calling PyObject_Del, but this gives an access violation in
On Sun, Jun 19, 2005 at 11:12:05PM -0700, Didier C wrote:
Hi!
I was wondering if we can pass some arguments to system(cmdline)?
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
which would instruct Perl to do an ls /home/cypher
But in python, doing
On Fri, Jun 17, 2005 at 01:03:14AM -0700, [EMAIL PROTECTED] wrote:
hi everyone
i'm newbie
i try to compile the pyrex module:
def controlla(char *test):
You cannot have a C datatype in a Python like that.
Much better to use def controlla(test):
Andreas
--
Well, It means that eval(repr(x)) == x if at all possible.
Basically:
repr('abc') - 'abc'
str('abc') - abc
You'll notice that 'abc' is a valid python expression for the string,
while abc is not a valid string expression.
Andreas
On Wed, Jun 15, 2005 at 02:46:04PM +0200, Jan Danielsson wrote:
On Tue, Jun 14, 2005 at 12:02:29AM +, Andrea Griffini wrote:
However I do not think that going this low (that's is still
IMO just a bit below assembler and still quite higher than
HW design) is very common for programmers.
Well, at least one University (Technical University Vienna) does it
On Mon, Jun 13, 2005 at 06:13:13AM +, Andrea Griffini wrote:
Andrea Griffini [EMAIL PROTECTED] writes:
So you're arguing that a CS major should start by learning electronics
fundamentals, how gates work, and how to design hardware(*)? Because
that's what the concrete level *really* is.
I'd consider taking a look at the re module ;)
Andreas
On Fri, Jun 10, 2005 at 02:57:21PM +0100, John Abel wrote:
Does anyone know of a quick way of performing this:
$testVar =~ s#/mail/.*$##g
The only way I can think of doing it, is:
mailPos = testVar.find( mail )
remainder =
I'm sure it's documented somewhere, but here we go :)
The correct usage is super(MyClass, self)
The idea is that super allows for cooperative calls. It uses MyClass to locate
what class above to call.
This way you can something like that:
class A(object):
def bar(self):
print A
On Sat, Jun 04, 2005 at 11:49:28PM -0700, Robert Kern wrote:
Well, the FSF at least thinks that internal use within an organization
does not constitute distribution.
Well, the problem are contractors. It's very important (for example in
Germany) for a number of legal reasons that contractors
On Mon, Jun 06, 2005 at 06:08:36PM -, max wrote:
I guess my argument is that with multiple contributors, the gpl, in
comparison to say, a BSD style license, grants power to the code. If 3
people work on a gpl project, they must agree to any changes. If 3
people work on a BSD style
On Thu, Jun 02, 2005 at 01:57:25AM -0700, Robert Kern wrote:
And for thoroughness, allow me to add even if they have no intention or
desire to profit monetarily. I can't explain exactly why this is the
case, but it seems to be true in the overwhelming majority of cases.
Academic projects
Am Donnerstag, den 02.06.2005, 17:52 + schrieb Karl A. Krueger:
Andreas Kostyrka [EMAIL PROTECTED] wrote:
*) GPL is not acceptable for library stuff, because as a software
developer I'm sometimes forced to do closed stuff.
(Yep, even nowadays there are place where it's basically
Ok, here are my results, all python Versions supplied by Debian:
[EMAIL PROTECTED]:~ python1.5 /usr/lib/python1.5/test/pystone.py
Pystone(1.1) time for 1 passes = 1.33
This machine benchmarks at 7518.8 pystones/second
[EMAIL PROTECTED]:~ python2.2 /usr/lib/python1.5/test/pystone.py
48 matches
Mail list logo