Re: A faster shutil.rmtree or maybe a command.

2005-10-11 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Sometimes I must delete 2 very big directory's. > The directory's have a very large tree with much small file's in it. > > So I use shutil.rmtree() > But its to slow. > > Is there a faster method ? Is os.system("rm -rf %s&quo

Re: Some set operators

2005-10-15 Thread Giovanni Bajo
ding the widely-spread C and C++. Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Some set operators

2005-10-16 Thread Giovanni Bajo
etc). Such a module would be very useful, but I believe it's orthogonal to having an infix notation for common operations. We have a string module (and string methods), but we still have a couple of operators for strings like "+". -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Giovanni Bajo
, if pkg3 uses pkg1, pkg1 shouldn't use pkg3. It makes sense to think of pkg1 as the moral equivalent of a library, which pkg3 uses. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to organize Python files in a (relatively) big project

2005-10-19 Thread Giovanni Bajo
al/bin which adds /usr/local/myapp to sys.path[0], and "import main" to boot the application. I'm not sure I have answered your question though :) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding the arguments for SubElement factory in ElementTree

2005-10-30 Thread Giovanni Bajo
;) > subroot = SubElement(root, 'subroot', text='xyz') No, this creates: I believe the text ought to be set in a separate statement. Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Reuse base-class implementation of classmethod?

2005-10-31 Thread Giovanni Bajo
base-class classmethod to reuse its implementation, but I'd like to pass the derived class as first argument. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: 'super' to only be used for diamond inheritance problems?

2005-10-31 Thread Giovanni Bajo
uld just call them by name and forget > about super.) What is people's opinion on this? Does it make any > sense? I personally consider super a half-failure in Python. Some of my reasons are cited here: http://fuhm.org/super-harmful/ -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Reuse base-class implementation of classmethod?

2005-11-01 Thread Giovanni Bajo
>> @classmethod >> def foo(cls, a, b): >> A.foo(cls, a, b) # WRONG! >> >> I need to call the base-class classmethod to reuse its >> implementation, but I'd like to pass the derived class as first >> argument. -- >> Giovanni B

Re: Addressing the last element of a list

2005-11-08 Thread Giovanni Bajo
nable. You will end up always with objects with better semantic, and methods to modify them. So in the end you will always have a reference to the moral equivalent of a[42]["pos"], and that would be a well defined object with a method setThis() which will modify the moral equivalent of [-4

Re: LARGE numbers

2005-11-11 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > An early alpha-quality release is available at > http://home.comcast.net/~casevh/ Given the module named "Decimal" in Python 2.4, I'd suggest you to rename your library. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: sort the list

2005-11-21 Thread Giovanni Bajo
optimization. Even without it, you can still use "key": >>> L = [[1,4],[3,9],[2,5],[3,2]] >>> def mykey(e): ... return e[1] ... >>> L.sort(key=mykey) >>> L [[3, 2], [1, 4], [2, 5], [3, 9]] Using the "key" keyword argument can be easier to understand ("sorting against the second element" == "second element is the key"). -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-23 Thread Giovanni Bajo
ble__ = True or something like that. Or at least, I'd be grateful if someone explained me why this can't or shouldn't be done. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-23 Thread Giovanni Bajo
s an exception, rather than go unnoticed? I don't see your point, either. Why would you want to add attributes to an object documented to be immutable? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
es a way to behave like builtins, eg. explicitally and fully implement immutability. Immutability is an important concept in Python programs, and I'm impressed it does not have explicit support. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
#x27;t Python give me some way to enforce this so that, if I or some other dev do the mistake, it doesn't go unnoticed? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
tyles. > I'm not sure it's more important than > things like interned strings and the sharing of small integers. Most > of the discussion of immutables here seems to be caused by newcomers > wanting to copy an idiom from another language which doesn't have > immutable variables. Their real problem is usually with binding, not > immutability. I'm not such a newcomer, but (how funny) Python is *the* language that introduced me to the concept of immutable objects and their importance in design :) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
psulation with Python's immutable types, > which are immutable because the implementation demands it. (A fact I > hope will disappear at some point.) You seriously believe that strings, integers and tuples are immutable because of implementation details? I believe they are part of a language design -- and a good part of it. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
information. So why trying so hard to get into trouble? > It sounds like what you may want are opaque objects where you can > control access better No that's a different issue. One example of my immutable classes is Point2D (two attributes: x/y). Having it immutable gives it many useful properties, such as a real value semantic. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
instances, at least under some > conditions. There are no constructs for helping you do that with > user-defined objects. Should we add them for the sake of > orthogonality? I don't think so - not without a good use case. I don't think identity is important for immutable obj

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
Paul Rubin wrote: > "Giovanni Bajo" <[EMAIL PROTECTED]> writes: [pay attention to the quoting, I didn't write that :) ] >>> Mike Meyer wrote: >>> >>> However, when you prevent a client from adding an attribute, you're >>> not me

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
be key dictionaries (with their hash value being their id). -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest.assertRaise and keyword arguments?

2005-12-02 Thread Giovanni Bajo
rg2, arg3, arg4, abc=0, foo=1, bar="hello")) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Instances behaviour

2005-12-04 Thread Giovanni Bajo
have methods that A doesn't. Then, add those methods to A too, but not implement them: def foo(self): """Foo this and that. Must be implemented in subclasses.""" raise NotImplementedError -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: CDDB.py binaries for Python 2.4

2005-12-04 Thread Giovanni Bajo
in32-py2.4.exe -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie - needing direction

2005-12-04 Thread Giovanni Bajo
lications: http://www.pygame.org/ Then you can use pywin32 (http://sourceforge.net/projects/pywin32) to bind to the Windows API and accomplish what you need. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Giovanni Bajo
xternal libraries for specific purposes, but I'd rather the standard library to stay focused on provided a possibly restricted set of common features with a decent interface/implementation. This said, I'd also like to see ElementTree in the standard library. We already have a SAX and

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Giovanni Bajo
Giovanni Bajo wrote: > One thing I really fear about the otherwise great EasyInstall (and > Python Eggs) is that we could forget about... ... how important is to have a standard library. The fact that it's easy to install external modules shouldn't make us drop the standard lib

Re: pyqt

2005-12-10 Thread Giovanni Bajo
: "self.kProgress1 = > KProgress(self,"kProgress1") NameError: global name 'KProgress' is not > defined"). > Are the not implemented there or I should install some additional > software? PyKDE. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: set, dict and other structures

2005-01-31 Thread Giovanni Bajo
anything wrong in providing an abstraction for this, especially since we already decided that set-like abstractions are useful. So, FWIW, I would find set-like operations on dictionaries an useful addition to Python. Besides, I guess they can be easily experimented and studied by subclassing dict. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

pythonXX.dll size: please split CJK codecs out

2005-08-20 Thread Giovanni Bajo
itting out the CJK codecs. Thanks, Giovanni Bajo [1] See also my page on PyInstaller: http://www.develer.com/oss/PyInstaller -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonXX.dll size: please split CJK codecs out

2005-08-21 Thread Giovanni Bajo
ich are really core, like sys and os". This would also provide guidance to future modules, as they would simply go in external modules (I don't think really core stuff is being added right now). At this point, my main goal is getting CJK out of the DLL, so everything that lets me achieve this goal is good for me. Thanks, -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Revamping Python build system (Was: pythonXX.dll size: please split CJK codecs out)

2005-08-21 Thread Giovanni Bajo
e made clear. I know portability among several UNIX flavours is one, for instance. What are the others? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Revamping Python build system (Was: pythonXX.dll size: please split CJK codecs out)

2005-08-21 Thread Giovanni Bajo
d a dynamic library, you have to add a single line. This would take care of both Windows and UNIX, both compilation, packaging and installation. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyInstaller 1.0 in the works: package your Python app into a single-file executable

2005-09-03 Thread Giovanni Bajo
plans. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe 0.6.1 released

2005-09-06 Thread Giovanni Bajo
). How can I debug it? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyInstaller 1.0 in the works: package your Python app into asingle-file executable

2005-09-06 Thread Giovanni Bajo
announcement happened after my mail was already posted. I'll update PyInstaller's website ASAP to fix the now incorrect information in there. Thanks, -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe 0.6.1 released

2005-09-06 Thread Giovanni Bajo
import > _gdi.pyd. Next would be to debug through _memimported.pyd, but I > don't have a debug build of wxPython. OK. Do you believe that _memimported.pyd can eventually converge to something stable? Emulating LoadLibrary for all versions of Windows is not an easy task after all. Wine

Re: Python xml.dom, help reading attribute data

2005-09-06 Thread Giovanni Bajo
; from elementtree import ElementTree >>> node = ElementTree.fromstring("""1""") >>> node.text '1' >>> node.attrib["role"] 'success' -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: What XML lib to use?

2005-09-19 Thread Giovanni Bajo
;t fit some scenarios. So, why did it not make it to the standard library yet, given that it's so much better than the alternatives? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyInstaller 1.0 - build single-file distributions for your Python programs

2005-09-19 Thread Giovanni Bajo
PyInstaller a normal distutil package. Happy packaging! -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting tired with py2exe

2005-09-20 Thread Giovanni Bajo
gt; > That's one short "indefinitely": > > Not Found > The requested URL /pyinstaller was not found on this server. > Apache/2.0.53 (Fedora) Server at pyinstaller.hpcf.upr.edu Port 80 Yes, we had a short offline period today due to maintenance on the server, sorry for tha

Re: Getting tired with py2exe

2005-09-20 Thread Giovanni Bajo
once downloaded? Some people like the idea of "absolutely no installation process needed". -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting tired with py2exe

2005-09-20 Thread Giovanni Bajo
by PyInstaller will dump some stuff into your temp directory, but it won't run into compatibility problem when run on that computer or with that DLL. Anyway, I'm not against adding things to PyInstaller in principle: if there is enough request for such a feature, we might as w

Re: PyInstaller 1.0 - build single-file distributions for your Python programs

2005-09-20 Thread Giovanni Bajo
Giovanni Bajo wrote: > PyInstaller 1.0 is out: > http://pyinstaller.hpcf.upr.edu/pyinstaller For the logs, the correct URL is: http://pyinstaller.hpcf.upr.edu The other was a redirector which is no longer valid after a site maintenance session. I apologize for the inconvenience. -- Gi

Re: PyINI : Cross-Platform INI parser

2005-02-11 Thread Giovanni Bajo
value3". I also > made a c++ binding to PyINI with elmer toolkit. The most useful feature would be to be able to write INI files back without affecting their formatting, without removing user commands, etc. This is what Windows APIs do, and it is what I am missing from most INI parsing libr

Re: PyINI : Cross-Platform INI parser

2005-02-12 Thread Giovanni Bajo
ither with pywin32, or with > ctypes for those functions that aren't wrapped in pywin32. Sure, but we were speaking of doing that in a portable library. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

multiple inheritance with builtins

2005-03-05 Thread Giovanni Bajo
A.__init__ [] >>> class C(list, A): ... def __init__(self): ... print "C.__init__" ... super(C, self).__init__() ... >>> C.__mro__ (, , , ) >>> C() C.__init__ [] It seems weird to me that I have to swap the order of bases to get the expected be

Re: Turning String into Numerical Equation

2005-03-14 Thread Giovanni Bajo
("sin(pi/2)") 1.0 >>> calc("sys.exit()") Traceback (most recent call last): File "", line 1, in ? File "", line 2, in calc File "", line 2, in safe_eval File "", line 0, in ? NameError: name 'sys' is not defined >>> calc("0x1000 | 0x0100") 4352 -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-15 Thread Giovanni Bajo
ally access any of the func_globals attributes: When __builtin__ is not the standard __builtin__, Python is in restricted execution mode. In fact, I believe my solution to be totally safe, and I otherwise would love to be proved wrong. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-16 Thread Giovanni Bajo
7;, the current globals are copied into globals before expression is parsed. This means that expression normally has full access to the standard __builtin__ module and restricted environments are propagated """ In fact, the documentation for eval() could be improved to explain the

Re: Turning String into Numerical Equation

2005-03-16 Thread Giovanni Bajo
to show is that my simple one-liner is no worse than a multi-page full-blown expression parser and interpreter. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-16 Thread Giovanni Bajo
sad to send patches to Python and have them ignored for years (not even an acknowledge). Really sad. This is why I'm not going to do that again. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython vs. pyQt

2005-03-17 Thread Giovanni Bajo
total flexibility and orthogonality of provided features, incredible portability. I would suggest wxPython only if you cannot meet PyQt license requirements (and this is going to change soon, since Qt4 will have a GPL version for Windows too). -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrade woes: Numeric, gnuplot, and Python 2.4

2004-12-11 Thread Giovanni Bajo
ave everything you need to build your extensions. I saw patches floating around to build Python itself with the free version (a couple of small nits). -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Grouping code by indentation - feature or ******?

2005-03-27 Thread Giovanni Bajo
;m just showing that there are simple and reasonable examples of cases where you would like to indent your code in different ways and you can't. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr Dobbs "with" keyword

2005-04-16 Thread Giovanni Bajo
elf.mutex.lock, self.mutex.unlock): pass Either that, or "with" could call adapt() implicitly so I can register my conversion functions. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Managing import statements

2005-12-11 Thread Giovanni Bajo
Shane Hathaway wrote: > Here's the real problem: maintaining import statements when moving > sizable blocks of code between modules is hairy and error prone. You can also evaluate a solution like this: http://codespeak.net/py/current/doc/misc.html#the-py-std-hook -- Giovanni Bajo

Re: split string saving screened spaces

2005-12-16 Thread Giovanni Bajo
Sergey wrote: > Which module to use to do such thing: > "-a -b -c '1 2 3'" -> ["-a", "-b", "-c", "'1 2 3'"] >>> import shlex >>> shlex.split("-a -b -c '1 2 3'") ['-a', '-b', '-c', '1 2 3'] -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

distutils: build scripts as native executables?

2005-12-16 Thread Giovanni Bajo
clude paths and whatnot, but nothing is exposed at a higher level. I was going to subclass build_ext and find a way to piggy-back link_executable() into it instead of link_shared_object(), but I thought I asked before doing useless / duplicate work. -- Giovanni Bajo -- http://mail.python.org/m

Re: reading files into dicts

2005-12-29 Thread Giovanni Bajo
x27;: 1135900994, ... '.\\New Text Document.txt': 1135900552} >>> file("foo", "w").write(repr(d)) >>> data = file("foo").read() >>> data "{'.sync_pics.py': 1135900993, '.file_history.txt': 1135900

Re: PyQt calling an external app?

2006-01-10 Thread Giovanni Bajo
Python with popen[1234]/subprocess). You also get nice signals from the process which interact well in a Qt environment. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Giovanni Bajo
mparable. I'd say breaking that > is a bad thing. But if you don't break that, then having "x == y" > raise an exception for user classes seems wrong. The comparison should > be False unless they are the same object - which is exactly what > equality based on id gives us.

Re: import module and execute function at runtime

2006-01-13 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > I'm trying to import a module at runtime using variables to specify > which module, and which functions to execute. for example: > > mStr = "sys" > fStr = "exit" > > # load mod > mod = __import__(mStr) > # call funct

Re: Why can't I "from module import *" except at module level?

2006-01-13 Thread Giovanni Bajo
Mudcat wrote: > Is there any way to do this or am must I load all modules by function > name only if it's after initialization? Not sure. globals().update(mod.__dict__) might do the trick. Or just design a better system and be done with it. -- Giovanni Bajo -- http://mail.python.

Re: Marshal Obj is String or Binary?

2006-01-13 Thread Giovanni Bajo
\x01\x02' >>> len(bytes) 3 >>> ord(bytes[0]) 0 >>> rb = repr(bytes) >>> rb "'\\x00\\x01\\x02'" >>> len(rb) 14 >>> rb[0] "'" >>> rb[1] '\\' >>> rb[2] 'x' >>> rb[3] '0' >>> rb[4] '0' >>> bytes2 = eval(rb) >>> bytes == bytes2 True -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Giovanni Bajo
ost a quarter of the space, compared to > your method (stored as TEXT). Sure, but he didn't ask for the best strategy to store the data into the database, he specified very clearly that he *can't* use BLOB, and asked how to tuse TEXT. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread Giovanni Bajo
to provide more flexibility in adaptation: >>> partial(capture, "a", _1, _2)("b", "c") ("a", "b", "c") >>> partial(capture, "a", _2, _1)("b", "c") ("a", "c", "b") I don't see mention of this in the PEP, but it's a nice feature to have IMO. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 309 (Partial Function Application) Idea

2006-01-15 Thread Giovanni Bajo
tion, compared to the numbered placeholders solution. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: zipfile decompress problems

2006-01-16 Thread Giovanni Bajo
Waguy wrote: > import zipfile > file = zipfile.ZipFile("c:\\chessy.zip", "r") Use "rb". -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-16 Thread Giovanni Bajo
e DLL should contain the minimum set of modules needed to run the following Python program: --- print "hello world" --- There's probably some specific exception I'm not aware of, but you get the big picture. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: zipfile decompress problems

2006-01-16 Thread Giovanni Bajo
Waguy wrote: > I tried that to and it didn't work, got the same message > Thanks though, Can you send / provide a link to a minimal zip file which reproduces the problem? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing files -- pyparsing to the rescue?

2006-01-16 Thread Giovanni Bajo
gt; Data > Data > Data > > Data > Data > Data > Data > Given your description, pyparsing doesn't feel like the correct tool: secs = {} for L in file("foo.txt", "rU"): L = L.rstrip("\n") if re.match(r"<.*>", L): name = L[1:-1] secs[name] = [] else: secs[name].append(L) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Shrinky-dink Python (also, non-Unicode Python build is broken)

2006-01-17 Thread Giovanni Bajo
rform some optimizations. It'd be worthwhile > seeing if the DLL would speed up or shrink if whole program > optimization was turned on. There is no way whole program optimization can produce any advantage as the modules are totally separated and they don't have direct calls that

Re: magical expanding hash

2006-01-17 Thread Giovanni Bajo
t;>> a["foo"]["bar"] = 2 >>> a["foo"]["dup"] = 3 >>> print a["foo"]["bar"] 2 >>> print a {'foo': {'dup': 3, 'bar': 2}} So I advise using this class, and suggest the OP to try using setdefault() explicitally to better understand Python's philosophy. BTW: remember that setdefault() is written "setdefault()" but it's read "getorset()". -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: magical expanding hash

2006-01-18 Thread Giovanni Bajo
int of view. Instead of trying to write a Python data structure which behaves like Perl's, convert a Perl code snippet into Python, using the *Pythonic* way of doing it, and then compare things. Don't try to write Perl in Python, just write Python and then compare the differences. -- Gio

Re: list(...) and list comprehensions (WAS: Arithmetic sequences in Python)

2006-01-18 Thread Giovanni Bajo
- use *args instead for the > list-constructor. > > list(a,b,c) No, you can't. That's ambigous if you pass only one argument, and that argument is iterable. This is also the reason why set() doesn't work this way. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

getopt.gnu_getopt: incorrect documentation

2006-01-18 Thread Giovanni Bajo
rch turned up that its addition was mentioned in Python 2.3 release notes. This should be fixed in the documentation. Thanks! -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: getopt.gnu_getopt: incorrect documentation

2006-01-19 Thread Giovanni Bajo
anything. Can you please email > the > address shown in the documentation ([EMAIL PROTECTED]), or by using the > Python bug tracker? Sure, I'll use e-mail. My previous attempt at using the Python bug tracker was a failure (totally ignored after years) so I'm keen on trying some other way. Thanks! -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning a tuple-struct

2006-01-19 Thread Giovanni Bajo
last): File "", line 1, in ? AttributeError: 'named_tuple_class' object has no attribute 'z' >>> t = NamedTuple(("p", "pos", "position", 12.4)) >>> t (12.4,) >>> t.p 12.4 >>> t.pos 12.4 >>> t.position 12.4 >>> t = NamedTuple(("p", "pos", 12.4), length="foo") >>> t (12.4, 'foo') >>> t.p 12.4 >>> t.pos 12.4 >>> t.length 'foo' -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Some thougts on cartesian products

2006-01-22 Thread Giovanni Bajo
Christoph Zwerschke wrote: > Sometimes I was missing such a feature. > What I expect as the result is the "cartesian product" of the strings. I've been thinking of it as well. I'd like it for lists too: >> range(3)**2 [(0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2

Python 2.5b2 Windows binaries

2006-07-17 Thread Giovanni Bajo
s) for the following packages: - NumPy 0.98 - Numeric 24.2 - PyOpenGL 2.0.2.01 (with Numeric 24.2) - Pyrex 0.9.4.1 (with a Python 2.5 compatibility patch posted in its mailing list) I plan to update this page later as I build more installers (but don't hold your breath). Hope this helps everybody! --

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
would not be enough. If the PSF committee lowers its requests to a more realistical amount of effort, I'm sure we will see many more people willing to help. I think many people (including myself) would be willing to half-half-help with loose ends, but when faced with an abnormous "6-10

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
s (and I have not raised this point before because, believe me if you can, I really thought it was obvious and implicit). So, if your remarks apply to me, I think you are misrepresenting my mails and my goals. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
quot;being written in Python" has a requirement for the tracker. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
nonfree after people were > already using it. Moreover, this looked like a very good chance to have this nuisance sorted out. Too bad some people don't value free software enough. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
d with closed-source tools is not a problem since people can still compile it with different free compilers. > IMHO, using Jira presents risks that are manageable: > [...] > > * A data export is available if we decide to switch. [...] Out of curiosity, how is this obtaine

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
t number of volunteer admins (roughly 6 - 10 people) who can help set up and maintain the Roundup installation. """ This is *NOT* a perfectly reasonable offer, because you do not see 6-10 people stepping up at the same time for almost *anything* in the open source world. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Giovanni Bajo
tion, and no more than 1 person to maintain it afterwards. *IF* there are more volunteers, that's good, they can offload the maintenance work from a single maintainer; but I think it's unfair to put such a high *requisite*. We do not have 6-10 people maintaining SVN afterall, even if you wish we had :) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Giovanni Bajo
weird things are being done behind the curtain. I think the point of uncertainty araises only if you totally trust someone else to do the job for you. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-06 Thread Giovanni Bajo
ptable for Python development? It looks like an overexaggeration. People easily cope with 2-3 days of SVN freezing, when they are politically (rather than technically) stopped from committing to SVN. I guess they can wait 48 hrs to be able to close that bug, or open that other one, or run that query. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-07 Thread Giovanni Bajo
e 3-days delay in administrative issues because our single administrator is sleeping or whatever, and then have 2-3 people doing regular bug processing. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: n-body problem at shootout.alioth.debian.org

2006-10-07 Thread Giovanni Bajo
ss. Has anybody an explanation for the difference? It's pure > math so I expected Perl and Python to have about the same speed. Did you try using an old-style class instead of a new-style class? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-07 Thread Giovanni Bajo
ot "you are not entitled to have opinions because you do not act"? Your sarcasm is getting annoying. And since I'm not trolling nor flaming, I think I deserve a little bit more of respect. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

New-style classes slower than old-style classes? (Was: n-body problem at shootout.alioth.debian.org)

2006-10-07 Thread Giovanni Bajo
using new-style classes. Anyway, this is a bug on its own I believe. I don't think new-style classes are meant to be 25% slower than old-style classes. Can any guru clarify this? -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-07 Thread Giovanni Bajo
respect. > > IMO, regardless of whether you are trolling or flaming, you are > certainly being disrespectful. Why should we treat you with any more > respect than you give others? Disrespectful? Because I say that I don't agree with some specific requirement, trying to discuss a

Re: Python to use a non open source bug tracker?

2006-10-07 Thread Giovanni Bajo
s the bar for new developers: it's much harder to just "pick one" and fix it. I know because I tried sometimes, and after half an hour I couldn't find any bug that was interesting to me and "complete" enough to work on it. I also noticed that most bugs are totally uncommented like nobody cared at all. This is where my thought about Python missing bug triaging started. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: Find interface associated with default route?

2006-11-12 Thread Giovanni Bajo
t;>> import csv >>> def get_default_if(): ... f = open('/proc/net/route') ... for i in csv.DictReader(f, delimiter="\t"): ... if long(i['Destination'], 16) == 0: ... return i['Iface'] ... return None ... >>> >>> get_default_if() 'ppp0' -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

genexp performance problem?

2006-05-30 Thread Giovanni Bajo
hieve the same speed. -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

Re: genexp performance problem?

2006-05-31 Thread Giovanni Bajo
00 loops, best of 3: 3.6 msec per loop >> >> I thought the two constructs could achieve the same speed. > > hint: how many times to the interpreter have to look up the names > "int" > and "L" in the two examples ? Ah right, thanks! -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >