Re: Seeking IDE

2005-07-01 Thread Nick Mountford
Thanks a lot for all the suggestions. I´m ising IDLE and trying to get into eclipse. Cheers, Nick On 6/30/05, Nick Mountford <[EMAIL PROTECTED]> wrote: > Hi, > > Complete newb to Python and programming, looking for an open source > IDE to download. Any suggestions? >

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-07-04 Thread Nick Efford
d of "going", "bonny lass" instead of "pretty girl". The question "Do you know what I mean?" expressed phonetically in Geordie (one of the north-eastern dialects) becomes "Ya knaa what ah mean, leik?" Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Seeking IDE

2005-07-08 Thread Nick Vargish
ing between tools than you typically get with a monolithic IDE. Nick -- Nick Vargish :: http://nick.vargish.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Python scripts wont run - HELP

2005-07-18 Thread Nick Vargish
which will prevent you from looking at any output. Unless the program has a GUI, running it from the command-line is usually better than double-clicking it in a file browser. Nick -- #include/* sigmask (sig.c) 20041028 PUBLIC DOMAIN */ int main(c,v)char *v;{return !c?putchar(* /* cc -o sig sig

Replacing an XML element?

2005-09-20 Thread Nick Vargish
;COLTABLE'): newtable = coltable_to_rowtable(table) ## this is what I can't figure out doc.replace(table, newtable) output.write(doc.toxml('utf-8')) I'm pretty sure I'm missing something obvious, but haven't been able to find any examples. Someone please whack m

Re: Replacing an XML element?

2005-09-20 Thread Nick Vargish
Max Erickson <[EMAIL PROTECTED]> writes: > table.parentNode.replaceChild(newtable, table) I knew it had to be something simple (but not as simple as I am, apparently :^). Thanks much, Max, you've saved the rest of my day. Nick -- #include/* sigmask (sig.c) 20041028 PUBLIC

Re: empty classes as c structs?

2005-02-07 Thread Nick Coghlan
ll for instance methods as it does for class or static methods. Cheers, Nick. + from types import ClassType class namespace(object): """ namespace([namespace|dict]) => object namespace objects provide attribute access t

Re: variable declaration

2005-02-07 Thread Nick Coghlan
e to do it. So long as the committee consists of one member who has the initials GvR and is known as the Python BDFL, we should be OK ;) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia ---

Re: Multiple constructors

2005-02-07 Thread Nick Coghlan
s. The builtins and the standard library offer many examples of both situations. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.pyt

Re: declarations summary

2005-02-07 Thread Nick Coghlan
rridden, and the augmented assignment magic method is a convenience to allow the rebinding case of that operation to be optimised. Cheers, Nick. Do I really want to add another PEP to the snoozing PEP 338, though? -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia -

Re: variable declaration

2005-02-07 Thread Nick Coghlan
Antoon Pardon wrote: Op 2005-02-05, Nick Coghlan schreef <[EMAIL PROTECTED]>: [ ... ] With a rebinding operator, the intent of the last line can be made explicit: def collapse(iterable): it = iter(iterable) lastitem = it.next() yield lastitem for item in it: i

Re: variable declaration

2005-02-08 Thread Nick Coghlan
ybe a RESTORE_FAST could. STORE_FAST is set up to store a local as fast as is reasonably possible. The space for the local is preallocated in the fast locals C array. How is an instruction which does that *and something else* ever meant to be faster? Cheers, Nick. -- Nick Coghlan | [EMAIL PROT

Re: empty classes as c structs?

2005-02-08 Thread Nick Coghlan
to looking them). Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: variable declaration

2005-02-08 Thread Nick Coghlan
Just wrote: In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: Antoon Pardon wrote:ons already existing. The compilor might generate a RESTORE instruction. Whether it is done as a LOAD/STORE or a RESTORE, it has to perform the same work - check the name exists

Re: variable declaration

2005-02-08 Thread Nick Coghlan
operation *theoretically* be quicker for the other cases which involve a real dictionary (or something that looks like one)? Well, perhaps. Although I can't see how the rebinding operation would gain a benefit that a standard binding operation wouldn't gain if placed at the exact same point. C

Re: empty classes as c structs?

2005-02-08 Thread Nick Coghlan
Michael Spencer wrote: Nick Coghlan wrote: The other issue is that a namespace *is* a mutable object, so the default behaviour should be to make a copy I don't follow this argument. Why does mutability demand copy? Given that somedict here is either a throwaway (in the classic

Re: Is Python as capable as Perl for sysadmin work?

2005-02-08 Thread Nick Vargish
o write a quick script in Perl because Python isn't ubiquitous enough around here, and I often find myself thinking I the opposite... "Perl just isn't cutting it." And I spent several years putting food on the table with Perl, so it's not like I'm a noob with Perl. Ni

Re: python code with indention

2005-02-08 Thread Nick Vargish
"Xah Lee" <[EMAIL PROTECTED]> writes: > is it possible to write python code without any indentation? Not if Turing-completeness is something you desire. Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+c

Re: empty classes as c structs?

2005-02-09 Thread Nick Coghlan
s the use of class definition syntax for simple data structures - lookup chaining, allowing fallback to an 'outer scope'. Even though we'll probably end up dropping the last couple as overengineering things for the first pass, they're still interesting ideas t

Re: variable declaration

2005-02-09 Thread Nick Coghlan
Antoon Pardon wrote: Op 2005-02-08, Nick Coghlan schreef <[EMAIL PROTECTED]>: The CPython *_FAST opcodes relate to functions' local variables. Behind the scenes they are implemented as integer indexing operations into a pre-sized C array. Operations don't come much faster than

Re: variable declaration

2005-02-10 Thread Nick Coghlan
er than globals, generic objects would work for using those, too. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: empty classes as c structs?

2005-02-10 Thread Nick Coghlan
Alex Martelli wrote: Nick Coghlan <[EMAIL PROTECTED]> wrote: For bindings, you could just go with standard Python semantics - normal name binding always happens in the innermost scope, so binding a name in a namespace should happen in the directly referenced namespace. Then you can shadow

Re: Testing conditions.

2005-02-10 Thread Nick Coghlan
an one nested if statement due to the 'problem' of not being to do an embedded assignment. *shrug* The issue has never really bothered me in practice. Heck, I often don't use nested assignment even in C, since the buggers can be so damn hard to read. That's mainly due to

Re: That horrible regexp idiom

2005-02-10 Thread Nick Coghlan
'alternative patterns' case: if m using foo_pattern.search(subject) as m: pass elif m using bar_pattern.search(subject) as m: pass else: pass (Y'know, I'm pretty sure the impetus was regexp matching the *last*

Re: deepcopy chokes with TypeError on dynamically assigned instance method

2005-02-10 Thread Nick Coghlan
5ÛHH575-UAZWKVVP-7H2H48V3 wrote: class Foo(list): "Foo" def __init__(self, l=[]): Change this too: def __init__(self, l=None): if l is None: l = [] And see if your problem goes away. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane,

Re: convert list of tuples into several lists

2005-02-10 Thread Nick Coghlan
is actually zip(*tuple(zip(*tuple(iterable. That's potentially an awful lot of data copying for an identity operation :) Anyway, I think it does make a decent case for an itertools.iunzip or some such beast. Cheers, Nick. -- Ni

Re: lambda and for that matter goto not forgetting sugar

2005-02-10 Thread Nick Coghlan
'syntactic sugar' on these pages. All high level languages (Python included) are nothing but syntactic sugar designed to conceal the ugliness of what actually gets sent to the CPU to make it all happen. Yup, you're right. But 'syntactic sugar' often isn't used in a negat

Re: Is Python as capable as Perl for sysadmin work?

2005-02-10 Thread Nick Coghlan
That module is. . . a) impressive b) very, very, wrong c) both a) and b) I think I'm voting for c). . . Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.sk

Re: variable declaration

2005-02-10 Thread Nick Coghlan
obscured. x.=42 vsx:=42 seems a clear win for the second IMO. I'm forced to agree. So I'll use the latter syntax if I end up writing anything further about rebinding :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-11 Thread Nick Coghlan
that already, it just won't do what you want: r, g, b = col = dict(r = 4, g = 3, b = 12).values() The dict-based implementation means named tuples they ain't :) However, the namespaces module *would* provide a natural location for a NamedTuple class. Cheers, Nick. -- Nick Coghlan | [

Re: convert list of tuples into several lists

2005-02-11 Thread Nick Coghlan
ent looking function call. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: deepcopy chokes with TypeError on dynamically assigned instance method

2005-02-11 Thread Nick Coghlan
ce. If you actually copied them, they'd be bound to the *old* instance, rather than the new one. So I expect you'll need to provide a __deepcopy__ in order to correctly generate the instancemethods bound to the new instance. I also realised that the reason the use of a mutable default is OK here is

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-11 Thread Nick Coghlan
Hmm, I'm not so sure about this. I think that the right model is the way that a class instance is currently chained with its class. That is, assume we have the following: c = cls() ns = Namespace(vars(c), vars(cls)) # Using modified NS above nc = NamespaceChain(Namespace(vars(c)), Nam

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-11 Thread Nick Coghlan
Lists (i.e. namespaces with a defined field order) Cheers, Nick -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: a sequence question

2005-02-11 Thread Nick Coghlan
David Isaac wrote: "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Using zip(*[iter(l)]*N) or zip(*(iter(l),)*N) simply extends the above to the general case. Clearly true. But can you please go into much more detail for a newbie? I see that [iter(l)]

Re: Loading functions from a file during run-time

2005-02-11 Thread Nick Coghlan
;. The first is better when you do know the name of the module you want at coding time, but the latter is handy when you want to be dynamic about it. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia ---

Re: Statement coverage tools revisited

2005-02-11 Thread Nick Coghlan
_var_name" is "long_and_really_complicated_var_n ame" True Py> "long_and_really_complicated_non_var_name" is "long_and_really_complicated_n on_var_name" True Py> "long_and_really_complicated_non_var_name" * 20 is "long_and_really_complica ted_non_v

Re: PyINI : Cross-Platform INI parser

2005-02-11 Thread Nick Coghlan
Peter Maas wrote: I think that a new config utility is worth the effort if it has the potential to put an end to roll-your-own config formats and parsers. http://www.python.org/moin/ConfigParserShootout Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia

Re: Is this a bug? BOM decoded with UTF8

2005-02-11 Thread Nick Coghlan
UTF-8 data? WTF do you need a byte order marker for when you have 8-bit data?" It also clarifies Martin's comment about the UTF-8 codec ignoring the existence of this piece of silliness :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] |

Re: a sequence question

2005-02-12 Thread Nick Coghlan
ting the docs to include that information would probably be a bigger issue, as it involves behaviour which is currently not defined by the library. Cheers, Nick. [1] http://www.python.org/dev/doc/devel/lib/built-in-funcs.html -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-12 Thread Nick Coghlan
other highlights are: NamespaceView supports Namespace instances in the constructor NamespaceChain inherits from NamespaceView (as per my last message about that) LockedView is a new class that supports 'locking' a namespace, so you can only modify existing names, and cannot add or remove

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-12 Thread Nick Coghlan
descriptor machinery a bit further in order to design a lookup scheme that is most appropriate for namespaces, but the above example has convinced me that object.__getattribute__ is NOT it :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-12 Thread Nick Coghlan
Nick Coghlan wrote: Py> class NS(namespaces.Namespace): ... x = prop ... Oops - c&p error here. This was actually: Py> class NS(namespaces.Namespace): ... x = prop ... __x__ = prop ... Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane,

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-12 Thread Nick Coghlan
designed to be inheritance friendly. Though I'd like it to have a shorter name. I'm lazy. 'from namespaces import Namespace as ns' :) I thought about suggesting simply 'space' as a name, but I think that's way too vague. We're using it as a namespace, so we migh

Re: a sequence question

2005-02-12 Thread Nick Coghlan
David Isaac wrote: "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] A bug report on Sourceforge would help in getting the problem fixed for the 2.5 docs Done. Bug 1121416, for anyone else interested. Looks Raymond agrees with me about the left-to-rig

Re: deepcopy chokes with TypeError on dynamically assigned instance method

2005-02-12 Thread Nick Coghlan
more familiar with the guts of copy.py than I am might be able to give a better answer if they happen to see the question. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomand

Re: Alternative to raw_input ?

2005-02-12 Thread Nick Coghlan
Try this: print "Hit a key!" cekaj() print "Nap time!" time.sleep(15) print "Hit another key!" cekaj() with the two different implementations, and see what happens if you hit a key when the 'Nap Time!' prompt appears. Cheers, Nick. P.S. You probably act

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-12 Thread Nick Coghlan
27;y.z': 1} Py> vars(ns.y) {'x': <__main__.C object at 0x009EB8D0>} Py> vars(ns.y.x) {'z': 2} Combined with the update change, it means this code does the right thing: Py> settings = { ... "x" : 1, ... "y" : namespaces.Namespace(),

Re: For American numbers

2005-02-12 Thread Nick Coghlan
nt(10**i) ... 10.000 bytes 10.000 bytes 10.000 kilobytes 9.766 kibibytes 10.000 megabytes 9.537 mebibytes 10.000 gigabytes 9.313 gibibytes 10.000 terabytes 9.095 tebibytes 10.000 petabytes 8.882 pebibytes 10.000 exabytes 8.674 ebibytes 10.000 zettabytes 8.470 zebibytes 10.000 yottabytes 8.272 yobibyte

Re: For American numbers

2005-02-12 Thread Nick Coghlan
kes for better marketing copy. . . Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-12 Thread Nick Coghlan
Nick Coghlan wrote: class Namespace(object): # etc def _update_dict(self, other): for k in other: setattr(self, k, other[k]) This doesn't work, as it doesn't allow the sequence of 2-tuples. So I copied the relevant check for a keys() attr

Re: Kill GIL

2005-02-12 Thread Nick Coghlan
d in the last couple of paragraphs simple and easy to use, rather than on a misguided effort to "Kill the GIL". Cheers, Nick. P.S. If the GIL *really* bothers you, check out Stackless Python. As I understand it, it does its best to avoid the C stack (and hence thread

Re: [NooB] a Variable in multiple quotes...

2005-02-13 Thread Nick Coghlan
Michael Hoffman wrote: This is a fairly friendly group and they will answer even newbie questions amicably. Albeit with the occasional pointed comment about not at least skimming the tutorial when it covers the question asked ;) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED

Re: For American numbers

2005-02-13 Thread Nick Coghlan
code - it's 'exbi' not 'ebi': http://en.wikipedia.org/wiki/Binary_prefix#IEC_standard_prefixes Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredoman

Re: builtin functions for and and or?

2005-02-13 Thread Nick Coghlan
it as often as I do). What do people think? I have never done this, would I just write up a PEP? I've posted a question to py-dev about it. If Raymond (the itertools maintainer) is supportive, then a PEP may not be needed. If not. . . yeah, a PEP would probably be required. Cheers, Nick. -- Ni

Re: Kill GIL

2005-02-13 Thread Nick Coghlan
to a different platform without having to port the far more platform specific GUI. This would have been much harder if we weren't already using a CSP model for communication between different parts of the system) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane,

Re: custom classes in sets

2005-02-14 Thread Nick Coghlan
nge the hash method to use the size of the file or something else that has to be equal for the comparison to be equal (like the hash of the first line, or of the entire file), and you should see much better behaviour. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTEC

Re: For American numbers

2005-02-14 Thread Nick Coghlan
where avoiding the ambiguity tends to matter more - in a conversation, if the difference actually matter, you can just ask. With a written document, requesting clarification often isn't so simple. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] |

Re: [PATCH] allow partial replace in string.Template

2005-02-14 Thread Nick Coghlan
a) Patches are more likely to be looked at if placed on the SF patch tracker. b) I don't quite see the point, given how easy these are to spell using the basic safe_substitute. You're replacing one liners with one-liners. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] |

Re: Considering python - have a few questions.

2005-02-14 Thread Nick Vargish
or the data-handling backend. Data files are portable between machine architectures and within major version numbers, and it avoids a lot of the setup and maintanence of the database systems mentioned above (no need for a running server process, etc). http://sqlite.org/ Just a happy user, Nick --

Re: [PATCH] allow partial replace in string.Template

2005-02-15 Thread Nick Coghlan
Stefan Behnel wrote: Nick Coghlan wrote a) Patches are more likely to be looked at if placed on the SF patch tracker. see your own b), I wanted to discuss them first. Fair enough. Still, when I first tried out the Template class, I immediately stumbled over the fact that the substitute methods

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Nick Vargish
and I would like to know about this potential problem. If you want to do force a conversion before the join, you can use a list comp: ', '.join([str(x) for x in l]) Nick "Explicit is better than Implicit" -- # sigmask || 0.2 || 20030107 || public domain || feed t

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Coghlan
e found too many weird corner cases we weren't quite sure what to do with. At that point, "explicit is better than implicit" kicked in :) A shame, since it was both faster and more convenient than using a list comp. But the convenience wasn't worth the ambiguity of the s

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Vargish
e item 1: expected string, int found Which pretty much supports my initial argument -- if a non-string got into the list, something needs to be fixed, and it isn't the behavior of the join() method! Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?') -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Coghlan
f the available options. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Coghlan
news.sydney.pipenetworks.com wrote: Nick Vargish wrote: "news.sydney.pipenetworks.com" <[EMAIL PROTECTED]> writes: Really ? Then why are you using python. Try "import this" at a Python prompt. I didn't invent "Explicit is better than implicit." Thank

Re: [EVALUATION] - E02 - ULTIMATE RECIPE TO RESOLVE ALL ISSUES

2005-02-17 Thread Nick Vargish
and learning that this is a community of intelligent, friendly, humorous, and insightful people. Come with suggestions, and not demands. Show us how you would like a community to behave, instead of acting like we owe you something. That's how we make the world a better place. Nick -- #

Re: Why doesn't join() call str() on its arguments?

2005-02-17 Thread Nick Vargish
quite willing to go on at great length about the obvious answer to just about any question... You get a dozen obvious answers with every twelve philosophers. Nick p.s. I've been working on a philosophy degree for about... 15 years now. -- # sigmask || 0.2 || 20030107 || public domain |

Re: [OT]: Re: Why doesn't join() call str() on its arguments?

2005-02-18 Thread Nick Vargish
had time to finish ? or you have been > studying philosophy for 15 years ? Sort of an extended break, really. Every year I plan to finish up, but then can't find the time and/or money to do it. Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python p

Re: Why doesn't join() call str() on its arguments?

2005-02-19 Thread Nick Coghlan
at's a long way away, though. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: multimethod (or rather overloading) in Python

2005-02-19 Thread Nick Coghlan
/__init__.html I'm compelled to point out that PEAK should still be considered a 'work in progress', but PJE's ideas should help you out :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia

Re: global var

2005-02-19 Thread Nick Coghlan
cation global it's wrong. Given the nature of the question, I suspect the latter. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode encoding usablilty problem

2005-02-19 Thread Nick Coghlan
b"" to get a byte string instead of a character string. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-19 Thread Nick Coghlan
a (+ 1 2 3 4)) Which language has the lower barrier for entry? That should be a fairly important consideration for a language that is going to sit at the heart of an OS. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia -

Re: [Fwd: Re: [Uuu-devel] languages] <-- Why Python

2005-02-19 Thread Nick Coghlan
Paul Rubin wrote: Nick Coghlan <[EMAIL PROTECTED]> writes: Compare out-of-the-box Python: a = 1 + 2 + 3 + 4 And out-of-the-box Lisp: (setq a (+ 1 2 3 4)) Which language has the lower barrier for entry? That should be a fairly important consideration for a language that is going to sit

Re: unicode encoding usablilty problem

2005-02-20 Thread Nick Coghlan
e a bytes builtin which is a mutable byte sequence Alternately, add array.bytes as a subclass of array.array, that provides a nicer API for dealing specifically with byte strings. The main point being, the replacement for 'str' needs to be immutable or the upgrade

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Nick Coghlan
er than providing diff's and submitting appropriate patches to improve MinGW support in the main Python CVS. *shrug* Their call. Cheers, Nick. P.S. if Ilias volunteers, or offers to pay someone to do this, instead of just complaining, will hell freez

Re: [ANN] Python 2.4 Quick Reference available

2005-02-20 Thread Nick Coghlan
the BDFL gave for preferring 'open' - it may be extended to opening other types of objects than files. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skyst

Re: unicode encoding usablilty problem

2005-02-20 Thread Nick Coghlan
needs to discuss: What happens to __str__ and __unicode__? Is there a new __bytes__ slot? I wonder if Skip is still up for championing this one. . . Cheers, Nick. One PEP's enough for me (even though 338 doesn't seem to generate much interest) -- Nick Coghlan | [EM

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Nick Vargish
"BrainDead" <[EMAIL PROTECTED]> writes: > I believe that you are wasting your time. Looking at your email > address, this may well be relevant. [ 4-line URL snipped ] Thanks for the historical reference. Please consider a visit to tinyurl.com before posting a monster

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-20 Thread Nick Vargish
ts, but you don't get to unilaterally declare a discussion over. Just not how it works, though in this case an exception might be welcomed... Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti

Re: - E02 - Support for MinGW Open Source Compiler

2005-02-21 Thread Nick Vargish
it's time consuming and kind of tedious. I use an open-source terminal app (iTerm under OS X), so I guess I could hack the "open in browser" function to remove the backslashes... Hmm... Side projects aside, URLs less than 79 characters long are just easier to handle in many ways

Re: subclassing Decimal

2005-02-22 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: yea-though-I-walk-thru-the-valley-of-__new__-I-will-fear-no-super-ly That's beautiful }:> Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia ---

Re: Problem with the sort() function

2005-02-22 Thread Nick Coghlan
if key is not None: seq = [elem for (key, i, elem) in seq] if reverse: seq.reverse() return seq list = mysort([[3,'fork',0.3,1],[2,'fork',0.1,2],[3,'exec',0.2,2]], key=lambda x: x[0]) (Taken from Raymond's code in: http://mail

Re: Style guide for subclassing built-in types?

2005-02-23 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: p.s. the reason I'm not sticking to reversed or even reverse : suppose the size of the list is huge. Reversed is an iterator - it does NOT copy the list. In other words, reversed already does pretty much what you want. Cheers, Nick. -- Nick Coghlan | [EMAIL PROT

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-23 Thread Nick Vargish
unity. To really get a sense of the Python "community" (at least the Usenet branch), you should see how it responds to typical questions and requests for help. The response you received is not really typical, because your attitude has been atypical. Just sayin', Nick -- # sigm

Re: Style guide for subclassing built-in types?

2005-02-24 Thread Nick Coghlan
diter(range(11) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] Those benchmarks I mentioned earlier will let you know which approach is best. No-optimisations-without-measurements-'ly, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia

Re: Dynamically pass a function arguments from a dict

2005-02-24 Thread Nick Coghlan
27; are the names of the * and ** arguments or None. 'defaults' is an n-tuple of the default values of the last n arguments. Don't-forget-the-std-lib'ly, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia ---

Compile time evaluation (aka eliminating default argument hacks)

2005-02-24 Thread Nick Coghlan
code which doesn't depend on the functions arguments inside a 'use' block. For modules, data structures initialised inside a using block could simply be unmarshalled rather than built anew. Cheers, Nick. P.S. I didn't search the archive, because I couldn

Re: How to write a ping client

2005-02-24 Thread Nick Vargish
"Harlin Seritt" <[EMAIL PROTECTED]> writes: > ? #!/bin/sh ping $1 Enjoy, Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?') -- http://mail.pytho

Code evaluation at function definition execution time (was Re: Compile time evaluation (aka eliminating default argument hacks))

2005-02-25 Thread Nick Coghlan
orth having, finding a decent syntax is the next trick :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Code evaluation at function definition execution time (was Re: Compile time evaluation (aka eliminating default argument hacks))

2005-02-25 Thread Nick Coghlan
Nick Coghlan wrote: Basically, yeah. Although I later realised I got the name of the feature I want wrong - default arguments are evaluated when the def statement is executed, not when the code is compiled. So it's a matter of being able to execute some code in the functions local namespa

Re: Trees

2005-02-25 Thread Nick Coghlan
structures. All it would take to make it happen is a PEP, an implementation and a champion with some persuasive ability :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http

Re: Code evaluation at function definition execution time (was Re: Compile time evaluation (aka eliminating default argument hacks))

2005-02-25 Thread Nick Coghlan
instead of the bytecode. If that happens, they might become less hackish. So I guess I should wait and see what the next few months holds in terms of AST-hacks :) Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane,

Re: rounding problem

2005-02-25 Thread Nick Coghlan
Dan Bishop wrote: Your statement is misleading, because it suggests that your processor stores digits. It doesn't; it stores *bits*. And where does the word 'bit' come from, hmm? It couldn't possibly be an abbreviation of Binary digIT, could it? Cheers, Nick. -- Nick

Re: Canonical way of dealing with null-separated lines?

2005-02-25 Thread Nick Coghlan
ly lost. Actually making it happen needs someone to step up and offer a patch to the relevant C code and documentation, though. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Nick Coghlan
hon module/package that implements that? Just Does SciPy do what you want? Specifically Scientific.Functions.FindRoot [1] & Scientific.Functions.Polynomial [2] Regards, Nick. [1] http://starship.python.net/~hinsen/ScientificPython/ScientificPythonManual/Scientific_9.html [2] http://starship.pyth

Re: any Python equivalent of Math::Polynomial::Solve?

2005-02-26 Thread Nick Coghlan
? Actually, I was curious whether the 'zeros' method in [2] did the right thing. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listinfo/python-list

Re: function expression with 2 arguments

2005-02-26 Thread Nick Coghlan
people to start out by at least skimming the freaking tutorial. . . Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --- http://boredomandlaziness.skystorm.net -- http://mail.python.org/mailman/listi

Re: string methods (warning, newbie)

2005-02-26 Thread Nick Coghlan
ension: Py> "".join([c for c in 'The Beatles - help - 03 - Ticket to ride' if c.isalpha( )]) 'TheBeatleshelpTickettoride' Py> Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia

<    1   2   3   4   5   6   7   8   9   10   >