Re: idea for testing tools

2007-02-08 Thread Jens Theisen
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > http://codespeak.net/py/current/doc/test.html#assert-with-the-assert-statement Ok, I didn't come across this before. I didn't work for me though, even the simple case #!/usr/bin/python a = 1 b = 2 def test_some(): assert a == b

idea for testing tools

2007-02-07 Thread Jens Theisen
Hello, I find it annoying that one has to write self.assertEqual(x, y) rather than just assert x == y when writing tests. This is a nuisance in all the programming languages I know of (which are not too many). In Python however, there appears to be a better alternative. The piece of code below

beginner's refcount questions

2006-10-29 Thread Jens Theisen
Hello, python uses gc only where refcounts alone haven't yet done the job. Thus, the following code class Foo: def __del__(self): print "deled!" def foo(): f = Foo() foo() print "done!" prints deled! done! and not the other way round. In c++, this is a central technique used

Re: Another try at Python's selfishness

2006-02-04 Thread Jens Theisen
n.estner wrote: > Yes, I 100% agree to that point! > But the point is, the current situation is not newbie-friendly (I can > tell, I am a newbie): I declare a method with 3 parameters but when I > call it I only pass 2 parameters. That's confusing. If I declare a > member variable, I write: "self.

Graphical introspection utilities?

2006-02-04 Thread Jens Theisen
Hello, as it would be so obviously a good thing to have a graphical (or maybe curses-base) browser through the dynamic state of a Python program, it's probably there. Can someone point me to something? Cheers, Jens -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-01-31 Thread Jens Theisen
Paul wrote: > Or should I be looking for some other context here? Three people were looking at the wrong one, thanks for putting this right. I really should not have given my point that briefly. Jens -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-01-31 Thread Jens Theisen
Jay wrote: > You can do both, but why? *Especially* in a language like C++, where > thanks to pointers and casting, there really isn't any type safety > anyway. How much time in your C/C++ code is spent casting and trying to > trick the compiler into doing something that it thinks you shouldn't be

Re: Python vs C for a mail server

2006-01-29 Thread Jens Theisen
Alex wrote: > > > Since Robert Martin and Bruce Eckel (the authors of the two documents > linked above) are both acknowledged gurus of statically typechecked > languages such as C++, the convergence

Re: Python vs C for a mail server

2006-01-29 Thread Jens Theisen
Nicolas wrote: > http://nicolas.lehuen.com/ > My two latest problems with coding in C++ are due to the environments : > libraries using different string types and the whole problem with the > building system. I love the language, but I get a much better leverage > through Python and Java due to t

Re: writing large files quickly

2006-01-28 Thread Jens Theisen
Ivan wrote: > ext2 is a reimplementation of BSD UFS, so it does. Here: > f = file('bigfile', 'w') > f.seek(1024*1024) > f.write('a') > $ l afile > -rw-r--r-- 1 ivoras wheel 1048577 Jan 28 14:57 afile > $ du afile > 8 afile Interesting: cp bigfile bigfile2 cat bigfile > bigfile3 du big

Re: Python vs C for a mail server

2006-01-28 Thread Jens Theisen
Nicolas wrote: > If it's just a way to throw a programming challenge at your friend's > face, then you should check whether it's okay to use Python rather than > C/C++, otherwise he could be charged of cheating by using a more > productive language :). Though this comment of mine is likely to sta

Re: writing large files quickly

2006-01-28 Thread Jens Theisen
Donn wrote: > Because it isn't really writing the zeros. You can make these > files all day long and not run out of disk space, because this > kind of file doesn't take very many blocks. The blocks that > were never written are virtual blocks, inasmuch as read() at > that location will cause t

Re: writing large files quickly

2006-01-28 Thread Jens Theisen
Ivan wrote: > Steven D'Aprano wrote: >> Isn't this a file system specific solution though? Won't your file system >> need to have support for "sparse files", or else it won't work? > Yes, but AFAIK the only "modern" (meaning: in wide use today) file > system that doesn't have this support is FAT

Re: writing large files quickly

2006-01-28 Thread Jens Theisen
Donn wrote: >> How the heck does that make a 400 MB file that fast? It literally takes >> a second or two while every other solution takes at least 2 - 5 minutes. >> Awesome... thanks for the tip!!! > Because it isn't really writing the zeros. You can make these > files all day long and not run

Re: calling python from C#...

2006-01-23 Thread Jens Theisen
There is IronPython which compiles to .NET. And there was another project bridging the .NET runtime with the standard Python interpreter of which I forgot the name. Jens -- http://mail.python.org/mailman/listinfo/python-list