Re: Another newbie question

2005-12-10 Thread Alex Martelli
is the above-used self.getTheta (mostly a matter of style choice here). Really, I don't think this makes a good poster child for your "attribute mutators make life more difficult" campaign...;-) Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie question

2005-12-10 Thread Alex Martelli
could be wrong) that a Python implementation might be built with complex numbers disabled (just like, e.g., it might be built with unicode disabled). If that's indeed the case, I might not want to risk, for the sake of a little optimization, my 2D geometry framework not working

Re: Another newbie question

2005-12-10 Thread Alex Martelli
with immutable data, unsurprisingly;-). However, what if (e.g.) one anchor point within the spline is being moved interactively? I have no hard data, just a suspicion that modifying the spline may be more efficient than generating and tossing away a lot of immutable splines... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Inline Import

2005-12-10 Thread Alex Martelli
ouble digit percentage. > > Module importing is already idempotent. If you try to import an > already-imported module, inline or not, the second (or subsequent) > imports are no-operations. Hmmm, yes, but they're rather SLOW no-operations...: Helen:~ alex$ python -mtimeit -s'im

Re: Another newbie question

2005-12-10 Thread Alex Martelli
en if point held its x/y values as a complex -- just, e.g., def setX(self, x): x.c = complex(x, self.y) [[or use x.c.imag as the second argument if you prefer, just a style choice]]. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie question

2005-12-10 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > def setRho(self, rho): > > c = self.fromPolar(rho, self.getTheta()) > > self.x, self.y = c.x, c.y > > def setTheta(self, theta): > >

Re: Another newbie question

2005-12-11 Thread Alex Martelli
this busywork on all users of the class. If you further weaken your claim to "it's possible to design so badly that everybody involved faces more work and difficulties", I'll most obviously agree -- but such bad designs need not involve any attribute-setters, nor does including attribute-setters imply or even suggest that a design is bad in this way! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie question

2005-12-11 Thread Alex Martelli
t changing data (rather than always having to make new objects) sometimes affords better performance. Still, let's not optimize *prematurely*!-) Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
e users of your class to access attributes -- you will change an attribute to a property only in future versions of your class that do need some meaningful action upon the getting or setting or that attribute. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
he garbage collection issues) is "in Python, you cannot call arbitrary methods on None and expect them to be innocuous noops" (like in Java or C++, calling anything on None, aka a NULL pointer aka null, is a runtime error in Python too; the language without this restriction in this case is Objective C!-). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
work just as well as (in a better-designed class) would a.x = b.x + c.x - d.x It's just that the former style you force syntactic cruft and overhead which you may save in the latter. "Exporting a series of operators", which was an issue in the LOD thread, is not one here: once you have setter and getter, by whatever syntax, it's not germane. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Random Number Generation?

2005-12-11 Thread Alex Martelli
a fractional part that's exactly 0. If you do want integers as well as floats, you'll have to decide with what probability an integer must appear instead of a float, and do a second pass on r3k to enforce this. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
ike might check for this and issue a warning if needed... but I do wish we had better ways to prevent accidental naming conflicts (not that I can easily think of any). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie question

2005-12-11 Thread Alex Martelli
e... if they did, I can assure you that the consequences might be interesting. (Good think I can and do trust them to say, should such a situation ever arise, "DUH! -- I just didn't think of it!", and go fix their code forthwith... just as they've often heard ME say, apologetically, in the much more frequent situations where my objections to some design were misconceived... so, my modest management abilities will not be put to such a difficult test in the foreseeable future;-). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
m tests, and customer acceptance tests (not to mention regression tests, once bugs are caught and fixed;-), just as much as code developed otherwise. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: no arguments expected

2005-12-11 Thread Alex Martelli
al -- you're missing very crucial parts of it. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
the resulting lack of polymorphism are part of what keeps me away from O'CAML and makes me stick to Haskell, I still wanted to make it;-). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-13 Thread Alex Martelli
#x27;s IB is not the only interface-painter which encodes the UI as a datafile, easily interpreted at startup by a suitable library for whatever language you're using to flesh it out -- it's such an obviously RIGHT idea!). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt not working well on Mac OS X

2005-12-13 Thread Alex Martelli
ave any ideas? Use pythonw, rather than python, to run any Python script that needs to have a GUI. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-13 Thread Alex Martelli
ure of "critical mass" -- and with django about equal to subway+turbogears, it does not appear to show any emerging dominance. A significant measure of "buzz" might be obtained by redoing the same search in, say, two weeks, and noticing the deltas... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Bad marshal data

2005-12-13 Thread Alex Martelli
y old Python releases. (sharing binary data across machines is no big deal anyway; and you can always b64-encode it if you must send it by email...). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Bad marshal data

2005-12-14 Thread Alex Martelli
ly be the wrong choice for speed if the app was I/O bound (as is likely when the files get large enough, or get pushed through some narrow bandwidth bottleneck, e.g. on a network filesystem): using Python and writing small binary files instead might easily get better optimization with less effort.

Re: Python packages on OS X vs Windows

2005-12-14 Thread Alex Martelli
as it is for Mac). If shelling out 250 pounds (plus VAT) is "much easier" for you than doing a little compilation, or you can't use the GPL version anyway, etc, etc, then, maybe. Me, I'd rather stick to the Mac...!-) Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-14 Thread Alex Martelli
e was done), and judging mostly from <http://research.microsoft.com/~simonpj/papers/meta-haskell/meta-haskell .ps> it doesn't seem unfair to call them "convoluted"... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-14 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > <[EMAIL PROTECTED]> wrote: > > > > > > those convoluted templates that were added to the language as > > > > an afterthought. > > > I don't see this in Haskell. >

tkinter: drop-down widget

2005-12-15 Thread Alex Hunsley
du/tcc/cgi/pre.cgi?file=/u/www/docs/tcc/help/lang/python/mapping/dropdown.py alex -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter: drop-down widget

2005-12-15 Thread Alex Hunsley
Alex Hunsley wrote: > Can anyone recommend some code for creating drop-down menus in tkinter? > To be absolutely clear, here's an example of a drop-down: > > http://www.google.co.uk/preferences?hl=en > (see the language selection widget) > > I've found the odd bit

Re: OO in Python? ^^

2005-12-15 Thread Alex Martelli
he next C++ standard will have "concepts" (in the generic programming sense of the word) as a first-class construct, rather than just as an abstraction to help you think of templates, so it may be that the current distinctions will blur even further... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
gene tani <[EMAIL PROTECTED]> wrote: > Ben Sizer wrote: > > Mike Meyer wrote: > > > [Not sure if this attribution is correct.] > > > > Alex Martelli wrote: > > > > Because of course if other languages have 1 or two frameworks, python > &

Re: Haskell Typeclasses

2005-12-15 Thread Alex Martelli
are more useful than ABCs by as much as ABC are more useful than (simply "syntactical") interfaces -- coupled with adaptation mechanisms, the overall result can be extremely handy (as any Haskell programmer might confirm). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Haskell Typeclasses

2005-12-15 Thread Alex Martelli
ing frameworks and partial implementations? It's > not very clear for what reasons he likes interfaces. Just read his blog on artima -- and maybe, if something there is unclear to you, comment about it to see if you can get him interested in explaining better. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
there; to evaluate properly 50 frameworks for Java or 20 for Python would have taken weeks or months... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
a fairy godmother, you're out of luck. To put it another way: one reason I love Python is that I strongly subscribe to the idea that there should preferably be only one obvious way to do something. Unfortunately, this principle is very badly broken by the multiplicity of Python web framew

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
Paul Rubin <http://[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > To put it another way: one reason I love Python is that I strongly > > subscribe to the idea that there should preferably be only one obvious > > way to do something. Unfor

Re: tkinter: drop-down widget

2005-12-16 Thread Alex Hunsley
James Stroud wrote: > Alex Hunsley wrote: > >> Can anyone recommend some code for creating drop-down menus in tkinter? >> To be absolutely clear, here's an example of a drop-down: >> >> http://www.google.co.uk/preferences?hl=en >> (see the language selec

Re: Haskell Typeclasses

2005-12-16 Thread Alex Martelli
re, if this was in a typeclass with the appropriate additions of self., I'd mark f as dependent on g only. No real purpose is served by allowing dependencies to be specified in a "cloaked" form, anyway -- nor in going out of one's way to impede vigorous attempts by a programmer t

Re: IsString

2005-12-17 Thread Alex Martelli
ense. Java's behavior is identical, excepting only Java's "primitives" (e.g. floats), but definitely identical e.g. for strings (also immutable) and class instances (normally mutable). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing next/prev element while for looping

2005-12-18 Thread Alex Martelli
else: yield ''.join(cache) + item cache = [] if cache: raise ValueError("extra continuations at end of sequence") [[or whatever you wish to do instead of raising if the input sequence anomalously ends with a ``to be continued'' line]]. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove duplicated elements in a list?

2005-12-19 Thread Alex Martelli
t; [3, 1, 2] > >>> A better way to exploit exactly the same idea is to use: new_list.sort(key=orig_list.index) Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-19 Thread Alex Martelli
en when it requires the overhead of a "database independence layer". But being able to rely on a relational underlying model remains an excellent idea in many cases, even when minute details of SQL dialects &c require such a layer... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: DecInt 0.4 and processor specific GMPY binaries

2005-12-19 Thread Alex Martelli
excellent gmail (with a dot and a com) is a much better way to reach me, whether for gmpy or any other issue... thanks! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: What is unique about Python?

2005-12-19 Thread Alex Martelli
gsteff <[EMAIL PROTECTED]> wrote: > The indentation-based syntax seems to be unique No, you can find it in Haskell too (independently developed), and older languages such as Occam. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: step argument for count

2005-12-19 Thread Alex Martelli
te length" so you won't know apriori where > the end is. But how would you be using count in a way that *couldn't* > use a step argument? I think it's a reasonable extra-feature request for Python 2.5 -- you should post it as such to sourceforge. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: adding vectors

2005-12-19 Thread Alex Martelli
o way. If you're not hung up on syntax, e.g. def elemadd(t1, t2): return tuple(i1+i2 for i1, i2 in zip(t1, t2)) or any of several other ways. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to use python to unit test C++ code?

2005-12-21 Thread Alex Stapleton
On 21 Dec 2005, at 09:33, [EMAIL PROTECTED] wrote: > Is it possible to use python to unit test C++ code? If yes, is there > any example available? > > Thank you. > > -- > http://mail.python.org/mailman/listinfo/python-list You could use Python to unittest a Python module written in C++ I sup

Re: How to check if a string "is" an int?

2005-12-21 Thread Alex Martelli
... do something with x ... this way, you avoid accidentally masking an unexpected ValueError in the "do something with x" code. Keeping your try-clauses as small as possible (as well as your except-conditions as specific as possible) is important, to avoid masking bugs an

Re: Which Python web framework is most like Ruby on Rails?

2005-12-21 Thread Alex Martelli
eady use proprietary scripting languages for the silliest reasons -- giving them another reason would be a disaster). At the same time Python also thrives in open-source apps such as OO.o, just about all Linux distros, and so on, and so forth. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-21 Thread Alex Martelli
upgrading from Python 2.2 ;-) We currently use multiple versions of Python, and I personally don't see that changing overnight. But, we'll see. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
le, nor the other organization above mentioned, have ever been "single-programming-language" cultures [net of the very early times when Basic was MS's only product, of course;-)]...). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
n" which I thought was worth answering, since you chose to phrase it so very generally, and since it appeared to be intended as a "rhetorical question" hinting at what I consider a wrong idea in the general case. Far from "there not being much you can do", if you're

Re: new style and classic style classes ?

2005-12-22 Thread Alex Martelli
ess, and allow you to use such powerful features as 'property' to full effect. Old-style classes exist only for backwards compatibility. The only good reason to decide to make a class old-style is when you're making an *exception* class, specifically: up to Python 2.4, excepti

Re: Guido at Google

2005-12-22 Thread Alex Martelli
ould be, and therefore imply that you can't really think that (and must have ulterior motives for so suggesting, etc etc). Rhetorical questions are a perfectly legitimate style of writing (although, like all stylistic embellishments, they can be overused, and can be made much less effective if murkily or fuzzily phrased), of course. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
gitimate style of writing although they can be overused, or weakened if they're fuzzy or badly expressed. More specifically, a rhetorical question may often be used "for effect" and emphasis, as several of the definitions you'll find on the web mention. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
ust takes as "improvement" any change that does enhance existing users' productivity (indeed, changes that do so without requiring any training or much work, such as compiling an unchanged language to faster code, might have more immediate impact than new language features, which would only enter into use slowly and gradually). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
) and Anaconda (OS > installer) are written in Python, too. BTW, Chip Turner (from RedHat, and deeply involved in those developments) happened to start at Google the same day I did;-). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
Nicola Musatti <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Renato <[EMAIL PROTECTED]> wrote: > > > > > all of the native administration tools of RedHat (all versions) and > > > Fedora Core are written in python (system-config-* and/or >

Re: Guido at Google

2005-12-22 Thread Alex Martelli
Bengt Richter <[EMAIL PROTECTED]> wrote: > On Thu, 22 Dec 2005 09:07:26 -0800, [EMAIL PROTECTED] (Alex Martelli) > wrote: > > >Renato <[EMAIL PROTECTED]> wrote: > > > >> all of the native administration tools of RedHat (all versions) and > >&g

Re: Guido at Google

2005-12-22 Thread Alex Martelli
r prefer Perl to Python) to Ruby fans, from the C++ intelligentsia to the Java in-crowd... hard to explain, for sure, but, there you are! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Alex Martelli
ive what, if any at > all, impact this will have on Python? I'll leave this to Guido to answer, if he wants to. > Maybe here? http://www.artima.com/weblogs/index.jsp?blogger=guido Is > this Guido's official blog? I believe so, yes. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Providing 'default' value with raw_input()?

2005-12-22 Thread Alex Martelli
enhanced that into the 2nd edition of the printed (O'Reilly) Python Cookbook, too. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Herds of cats

2005-12-23 Thread Alex Martelli
t; > in that direction). > > I was only half joking, actually. Compare Python to Delphi. If a > company wanted to acquire control over Delphi, they'd try and buy > Borland; to acquire control over Python what are they to do? Well, > hiring Guido and Alex is probably a step in th

Re: Providing 'default' value with raw_input()?

2005-12-23 Thread Alex Martelli
dited), you may end up requiring the user to press enter at your prompt to indicate he or she's done editing, or some such semi-kludge. I cannot think of a sufficiently general solution, given the variety of editors around, to just magically divine the crucial "done with editing" condition... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting with expensive compares?

2005-12-23 Thread Alex Martelli
Dan Stromberg <[EMAIL PROTECTED]> wrote: ... > I'm wanting to sort a large number of files, like a bunch of output files > from a large series of rsh or ssh outputs on a large series of distinct > machines, a music collection in .ogg format (strictly redistributable and > legally purchased music

Re: Indentation/whitespace

2005-12-23 Thread Alex Martelli
some work for the purpose. Coding the preprocessor is the easy part -- the work is mostly in doing the PEP, including a variety of strong use cases for a general purpose preprocessor. (Of course, forking Python to hardcode your preprocessor is easier, but forking always has other problems). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: What is unique about Python?

2005-12-23 Thread Alex Martelli
x27;s also Ruby, but then we know Ruby did get some ideas from Python (and the letter 'y' is one of them). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Herds of cats

2005-12-23 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > > Alex Martelli wrote: > >> Not a bad point at all, although perhaps not entirely congruent to > >> open > >> source: hiring key developers has always been a possibil

Re: Bad people management

2005-12-23 Thread Alex Martelli
ugh managing software projects is a huge challenge, yet I would place the #1 cause of failure at *bad specs*... doing SW that doesn't really meet the target audience's needs, no matter how well it might be executed... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: What is unique about Python?

2005-12-23 Thread Alex Martelli
Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Alex Martelli) wrote: > > > gsteff <[EMAIL PROTECTED]> wrote: > >... > > > that's not really what I'm looking for. So I'm wondering,

Re: Indentation/whitespace

2005-12-23 Thread Alex Martelli
to Python (they have something called "the offside rule" which is at least as subtle as the one in soccer;-) but practical effects that are quite close. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting with expensive compares?

2005-12-23 Thread Alex Martelli
hat potential duplication. In this case, the tricks I already (though dubiously;-) suggested in order to avoid any avoidable comparisons might pay for themselves and then some, if comparisons are indeed extremely costly. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check if a string "is" an int?

2005-12-23 Thread Alex Martelli
ore than one empty-set, but I'm pretty sure that's because I never really dwelled into the intricacies of modern theories such as modal logic (I would expect modal logic, and intensional logic more generally, would please Dodgson far better than extensional logic... but, as I said, I don't

Re: Indentation/whitespace

2005-12-24 Thread Alex Martelli
lot of attention to small details get attracted to programming (and, more generally, engineering and even science), in preference to other careers... Alex -- http://mail.python.org/mailman/listinfo/python-list

any Adobe Reader like apps written in python, for examination?

2005-12-24 Thread Alex Gittens
Is anyone aware of any applications that handle font and graphics display--- something like Adobe Reader--- that are written in Python, and the code is available for examination? It doesn't matter what GUI toolkit is used. Thanks, Alex -- ChapterZero: http://tangentspace.net/cz/ --

Re: python coding contest

2005-12-25 Thread Alex Martelli
counted if they are not >needed as part of the code I would suggest that all whitespace (except within string literals) should be ignored, as well. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-25 Thread Alex Martelli
, since submitting at 14:00 UTC is WAY easier for Europe residents (residents of the Americas would have to go to bed VERY late, get up VERY early, or spend extra effort setting up cron jobs), and that would bias everything in a most unfair manner. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-25 Thread Alex Martelli
I don't think having the prize is really that important -- one does it for fun and kudos (a nicely designed, color-printed certificate of victory, suitable for framing and displaying prominently, would be better, if there are funds to make it, than a keyboard which one might not use...;-). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-25 Thread Alex Martelli
the "first tied winner to submit" (since I'm not particularly keen to get the keyboard, just the fun and kudos of claiming I'm the/a winner, in the unlikely event my submission should be among the shortest;-). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-25 Thread Alex Martelli
rface of the function, so > > it's a little bogus, but test.py doesn't check. (Personally I prefer > > that if be illegal, but if it's legal I'll have to do it). > > isn't the word 'input' a special word anyway??? No, just the name of a builtin -- no problem overriding it. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Hypergeometric distribution

2005-12-26 Thread Alex Martelli
he hypergeometric using the factorials too, so the problem subsist. Is > there any other libray or an algorithm to calculate > the hypergeometric distribution? The statistical package R can handle > such calculations but I don't want to use python R binding since I wan

Re: csv file how to modify the row

2005-12-27 Thread Alex Martelli
-- you just need to have an explicit 'delimiter' (the comma is just the default value for this); indeed, class csv.excel_tab has an explicit delimiter set to '\t'. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: csv file how to modify the row

2005-12-27 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 27 Dec 2005 19:24:57 -0800, Alex Martelli wrote: > > > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > > >> Why are you calling it a Comma Separated Values file when there are no > >>

Re: any Adobe Reader like apps written in python, for examination?

2005-12-27 Thread Alex Gittens
Grail: I'm sure as a browser it has to address these problems. But I'm open to further suggestions. Thanks, Alex On 12/26/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Alex Gittens <[EMAIL PROTECTED]> wrote: > > Is anyone aware of any applications that handle fo

Re: fetching images from web?

2005-12-27 Thread Alex Martelli
pen( "http://aspn.activestate.com/ASPN/img/komodo_aspn_other.gif";) > >>> #was looking through cookbook, so i used that as a sample image > >>> data = data.read() > >>> file = open("f:/test.gif", "w") Since you appear to want to wri

Re: Strange interaction between exec, dictionary subtypes, and global variables in 2.4

2005-12-30 Thread Alex Martelli
mailing list may be more appropriate for this discussion, btw, since it IS about the development of Python). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2006-01-01 Thread Alex Martelli
some input from me and others), and he says it's to avoid (human) ambiguity, much like the reason the parentheses are mandatory in [(a,b) for ...]. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Java or maybe PHP?

2006-01-01 Thread Alex Martelli
umstances. Similarly, Apple's WebObjects have also been widely praised, but they would shackle you to Apple systems (language choice directly supported by Apple for WebObjects is Objective C, Java, and WebScript, a proprietary very-high-level language; but I believe that thanks to

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-01 Thread Alex Martelli
ll, they ARE all rather public figures... TIA! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: Examples of Quality Technical Writing

2006-01-01 Thread alex . gman
http://en.wikipedia.org/wiki/Image:Dattebayo.jpg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Java or maybe PHP?

2006-01-01 Thread Alex Martelli
en-handed, judgments (apparently, by considering "a mere syntax sugar issue" the fact that in Python you code, e.g., "if a>b: c=d", while in Ruby you may code the other way 'round, "c=d if a>b", I must have insulted some gods at whose altar such fanatics worship...); if you choose to listen to such fanatics, you should then definitely get a second opinion rather than trust my own assessment of these issues. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-01 Thread Alex Martelli
n you cannot set arbitrary attributes on arbitrary objects. The workaround is to use a dict, indexed by the id of the object you want to "set arbitrary attributes on"; this has the helpful consequence that separate namespaces are used, so your arbitrary setting of metadata cannot interfere with the `true' attributes of the object in question. I'm unable to understand what you're trying to do in the "extend talker code" box following that one. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: reading files into dicts

2006-01-01 Thread Alex Martelli
" pickle.py implements just the same job, in pure Python, and it's easily found within your Python's standard library, so you may want to study it to see how it does perform its task. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-02 Thread Alex Martelli
bject in question. > > => possible workaround: use dict. > > > I'm unable to understand what you're trying to do in the "extend talker > > code" box following that one. > > Someone has posted this code, to solve "Applying metadata (or > attributes, as you prefere) to Class, Object, ...". > > I understand that the poster has send code which does not work. You mean something like...: Talker.meta = "Class meta information" john.meta = "Instance meta information" Talker.sayHello.meta = 'method meta information" You can't do that on an integer, because an integer is immutable; you can't do it on 'Talker.name', because there IS no such thing as 'Talker.name' (if that's a limitation, it's also a limitation that you can't do it on 'rumpelstiltskin.meta' either, and the reason is just the same: there IS no such thing as rumpelstiltskin in this code). There's no need to define this 'meta' attribute anywhere, it just springs into existence when you assign to it. Once you've set these, you can "print Talker.meta" etc etc. > If you (or any reader) like, please provide the concrete code to solve > the open limitations (the simple ones, like e.g. get/set). Hope I've done that in the few cases where I understood what your intentions were, but there must be more in which I didn't, such as the strange "without code" specification. > Thank you for taking the time to answer. You're welcome. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-02 Thread Alex Martelli
icular standard of ability is used as the basis by which political leadership is determined or accrues to an existing elite. """ Note the connection with "elite", which in turn gives us "elitism". I do like "meritocracy" because it specifically mentions *ability*, but of course ability (including technical skill, which in turn is enhanced by appropriate experience, AND 'softer' character/personality issues) is what a successful firm bases its "elite" on (or tries to; if it fails, and hires people bereft of sufficient ability, it won't prosper long). Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Java or maybe PHP?

2006-01-02 Thread Alex Martelli
Peter Hansen <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > One great programming principle is "Dont' Repeat Yourself": when you're > > having to express the same thing over and over, there IS something > > wrong. I believe the &

Re: Why is 'None' not assignable but 'True'/'False' are?

2006-01-02 Thread Alex Martelli
ing something like True = 1 False = 0 at the very start. In Python 3.0, when backwards compatibilities can be introduced, True and False will become keywords (as will None); see <http://www.python.org/peps/pep-3000.html>. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: "Humane" programmer interfaces

2006-01-02 Thread Alex Martelli
With > one simple, obvious, general interface, these special cases only add > unneeded complexity. first and last make sense (though it's debatable whether they should exist or not, it's not obvious that they're design errors, not at all); second, penultimate, and other variations, would be gilding the lily. Just like startswith and endswith may (debatably) make sense, but, say, hasrightinthemiddle would be surely inappropriate;-) Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Java or maybe PHP?

2006-01-02 Thread Alex Martelli
doing the same convincing on enthusiasts of languages whose cultural values include enthusiastic, exhuberant acceptance of individual variation. But I do not think that such "cultural and philosophical differences" as they apply to a whole community are more than a secondary factor in d

Re: "Humane" programmer interfaces

2006-01-02 Thread Alex Martelli
s" for which Python offers more readable synonyms may require (or at least be best expressed with) some len(...) call is hardly a big sub-issue -- some do, like e.g. L[len(L):]=... as the equivalent of L.extend(...), some don't, like e.g. del L[a:b] as the equivalent of L[a:b]=[], and yet the "alternative readable synonym" gets offered anyway. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Python or Java or maybe PHP?

2006-01-02 Thread Alex Martelli
erfectly sufficient, but I hope this suffices to show what we mean... Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON INTERPRETER

2006-01-02 Thread Alex Martelli
terpreter? There are ways to package up your Python code with the needed runtime, such as freeze for Unix, py2app for the Mac, py2exe for Windows, and many more besides. Alex -- http://mail.python.org/mailman/listinfo/python-list

<    5   6   7   8   9   10   11   12   13   14   >