Re: Is there a programming language that is combination of Python and Basic?

2009-04-20 Thread Tim Rowe
lear that you know the difference. Sorry for the confusion. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a programming language that is combination of Python and Basic?

2009-04-20 Thread Tim Rowe
: int frodo() { int rval = 0; if ((bilbo() == 0) || (gandalf() == 0) { /* lot's of code here */ } else rval = -1; return rval; } I'd be inclined to do it that way even if multiple exits were allowed; it just seems so much clearer. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: best "void" return of a member function

2009-04-22 Thread Tim Rowe
top of that. Most Ada MS Windows thick wrappers (ie, ones that feel natural to Ada) are built on top of Win32Ada, which stays as close to the underlying C interface as it can. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Which one is best Python or Java for developing GUI applications?

2009-05-06 Thread Tim Rowe
2009/5/6 Dennis Lee Bieber : > (the "near" is because I feel Ada is > stricter than any other language) Try SPARK -- it's Ada based, but /much/ stricter. It's just right for some really critical stuff, but is no sort of an answer to "Which one is best Python or Jav

Can't get Python for Windows to run

2008-07-04 Thread Tim Rowe
;t a folder -- the relevant folder would have been C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Programming\\Python 2.5' but the installer never gave me the chance to choose that. That woudn't stop me running Pythonw directly from the folder in which it's installed,

Re: Can't get Python for Windows to run

2008-07-04 Thread Tim Rowe
e somewhere the fact that the pywin installer assumes a particular structure for the start menu, and fails to install shortcuts if it doesn't find that structure? I'm used to programs asking me where they want to put the shortcuts, and creating folders if they don't find them (creating *wi

Re: Can't get Python for Windows to run

2008-07-07 Thread Tim Rowe
t; > msiexec /i 'ProgramMenuFolder=C:\Documents and Settings\All > Users\StartMenu\Programs\Programming' Thanks, that looks like just what I need. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Written in C?

2008-08-01 Thread Tim Rowe
at the compromises that are appropriate choices for one task are inappropriate for another. Python is a great tool. So is C#. You /can/ do the same job with either, but the smart move is to choose the one that is best adapted to the task in hand. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimals not equalling themselves (e.g. 0.2 = 0.2000000001)

2008-08-07 Thread Tim Rowe
ith less sand and more dirt. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple values for one key

2008-08-28 Thread Tim Rowe
ot;999 over there","zip":"5"}, > ] I think I'd make a class with members name, address, zip, etc. Then make a list of instances of that class or (better for access) identify a primary key -- what *is* unique about each entry -- and use that as a dictionary key with class instances as values. Or use a DBMS. Certainly the original poster should read up on database design, or chances are he'll have a nightmare maintaining referential integrity. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Tim Rowe
ded to be instantiated. Instead of >>>> using the class to creating an instance and then operate on it, I use >>>> the class directly, with classmethods. Essentially, the class is used >>>> as a function that keeps state from one call to the next. Sounds to me

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Tim Rowe
for it (probably what led people off onto the sidetrack of thinking a singleton was called for). That's the classic way of implementing a "class [to be] used as a function". -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-23 Thread Tim Rowe
includes everything required to do OO. But maybe the original blogger meant by "fully OO" what I mean by "Pure OO"? The question I usually ask is "Does this language help me get the job done?" Python often does. That's all that really matters, isn't it? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Python style: exceptions vs. sys.exit()

2008-09-24 Thread Tim Rowe
27;t open this >> file"), > > Arrghll ! NO, DONT ! Can I put in a vote *for* the questioner's library dumping to sys.exit() on any abnormal condition? It would reduce employment competition for the rest of us. Why, yes, I am wearing my BOFH hat. How could you tell? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: problem updating variable in a module

2008-09-24 Thread Tim Rowe
print a < this does actually print a = 20 I'm surprised it runs at all -- as far as I can see "mod" in "mod.update(a)" and "print mod.a" is not defined. Did you mean "mod1"? If I change it to that, both print statements print "20" as

Re: problem updating variable in a module

2008-09-26 Thread Tim Rowe
are the problem is due to a typo or some such (happens to us all!) but without seeing the actual code there's not a lot we can do. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Building truth tables

2008-09-26 Thread Tim Rowe
] Each element in the result is the state of the parameters followed by the result of the function. I stress that this is quick and dirty -- I'm sure somebody will be along with something better soon! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Tim Rowe
n't see them as being the fault of python-list which seems to do a pretty good job of blocking them -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
;. Before now I've struggled for ages to write a Python program to do a job, then when I've tried C# all the problems have fallen away and the job was done in an hour or so. But other times it has been the other way around; I've done stuff in Python that I wouldn't know where to begi

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
urse I think I'm right!) because Python aims to be platform independent, and whilst that means gains in portability it means that in return it loses the ease-of-programming of a tightly integrated platform. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
critical systems. I don't think formal proof of program behaviour would be at all straightforward in Python (or C# for that matter, and although Spec# gets closer, it really needs a language like Spark Ada). -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
n me off C# but last time I looked it wasn't close. Maybe I should take another look and see how it's coming on. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-27 Thread Tim Rowe
far as I am concerned because I don't actually touch most of the GUI code. There could actually be hundreds of parameters, for all I care. They're not my concern. Most of the time I like that -- the tools are doing my work for me. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-28 Thread Tim Rowe
> no clue. Very tongue in cheek.) If you see C# as being in any way related to VB, it's no wonder you're down on it! > Python has a lot of things C# doesn't. Can we agree on that? And C# has things that Python doesn't (such as static typing). Can we agree on that, too? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: What is not objects in Python?

2008-09-28 Thread Tim Rowe
r? Or do you pick the tool that does the job in hand most effectively? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: One class per file?

2008-09-29 Thread Tim Rowe
2008/9/29 Roy Smith <[EMAIL PROTECTED]>: > That being said, the "one class per file" rule is a means to an end. Although in some languages, the "end" is "code that runs". But Python is not Java... -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: What is not objects in Python?

2008-10-03 Thread Tim Rowe
uot;of the string" after). Post modification in noun phrases has been measured to be much less frequent in spoken English than in written English, and it gets progressively more common as the writing style gets more formal. That suggests that "the string's length" is an easier phrase to produce and understand, but "the length of the string" sounds more official. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance but only partly?

2008-10-03 Thread Tim Rowe
to descend Y from X. Your present design is wrong, plain and simple. Working around it won't fix that. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: What is not objects in Python?

2008-10-03 Thread Tim Rowe
> ... Unless, there is some corresponding distinction in mechanics > between speaking and writing. That is, if something about the process > of generating writing makes it, post-modification, easier. I'm going > to assume that it's been observed across all modes of writing too, (in > addition to

Re: Haskell's new logo, and the idiocy of tech geekers

2009-10-03 Thread Tim Rowe
a fucking idiot... > motherfucking aggresive > it's just few of priest fuckheads > look at lojban's motherfucking idiotic logo If you really knew anything about social function you would be able to work out why people think you are a troll. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-14 Thread Tim Rowe
gt; And I know somebody, in other languages, thinks it's > a Best Practice to avoid using exceptions for flow control. > > Thankfully, python programmers are less dogmatic, and use whatever makes > sense to use. I hope. Absolutely. And it doesn't make sense to use exceptions for flow control :-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-14 Thread Tim Rowe
eption ) And with enough static analysis to guarantee that the break will be reached? I think it would be a bit much to expect Python to solve the halting problem! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-14 Thread Tim Rowe
cannot decrease indefinitely, if you can define a loop variant then you gurantee that the loop will terminate. Even if you are not being formal, just considering what the loop variants and invariants can save no end of trouble with tricky loops. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-15 Thread Tim Rowe
2009/10/11 Philip Semanchuk : > IMHO, break, goto, etc. have their place, but they're ripe for abuse which > leads to spaghetti code. Unrestricted goto can leat to spaghetti code, but surely break can't? AFAICS, any break construct will still be H-K reducible. -- T

Re: The rap against "while True:" loops

2009-10-16 Thread Tim Rowe
ry, not merely the only clean way to exit. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-16 Thread Tim Rowe
ppened that shouldn't have". If one uses it when something has happened that *should* have, because it happens to have the right behaviour (even if the overhead doesn't matter), then one is misrepresenting the program logic. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-17 Thread Tim Rowe
propriate. Same with warnings; they *probably* shouldn't happen but only the application programmer can know whether they should or not. The point is that an exception causes a change in program flow, so of course they're used for flow control. It's what they do. The question is in wh

Re: The rap against "while True:" loops

2009-10-19 Thread Tim Rowe
But my point remains that the authors of index can't know whether the item not being in the list is an error or not, can't know how to handle that case, and so passing it to the client as an exception is an appropriate response. > No, it's not being killed from outside the program -- it's being > *interrupted* from *inside* the program by the user. Who -- unless AI has advanced further than I thought -- is *outside* the program. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: The rap against "while True:" loops

2009-10-20 Thread Tim Rowe
ctfully suggest that in *all* cases you do whatever is *clearest*, then switch to the other one if and only if performance is unacceptable *and* profiling reveals this to be the bottleneck? That avoids your deadlock (or is it livelock?) state. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-06 Thread Tim Rowe
The hostility you've received to that idea is saddening, and indicative of why there's so much buggy software out there. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-08 Thread Tim Rowe
fostering good habits for the rest of their careers. Any hostility from the OP seems to be a response to the persistent refusal to accept his assurances that he is not using the assertions for run-time error checking, nor teaching the students to do that, -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Tim Rowe
are that you *don't* care about correctness. You *know* the input is often wrong, but you're not bothering to check it? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: language analysis to enforce code standards

2009-07-10 Thread Tim Rowe
a classic from a programming guru of old. An automatic checker that just checks that the comment exists without understanding its contents simply is not adding value but is rather petty bureaucracy that will annoy the programmers. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-11 Thread Tim Rowe
but if they're any use at all in the production run-time then there's something wrong with your development and testing processes. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling functions: Why this complicated ?

2009-07-15 Thread Tim Rowe
in Ada. I shall now enter a period of self-refelection to try to work out why I am so inconsistent :-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Help understanding the decisions *behind* python?

2009-07-23 Thread Tim Rowe
builds *very* heavily on the concept of dictionaries it's not obscure at all! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
or me. That and the fact that I couldn't stop laughing for long enough to learn any more when I read in the Pragmatic Programmer's Guide that "Ruby, unlike less flexible languages, lets you alter the value of a constant." Yep, as they say "Bug" = "Undocumented feature"! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a Python fanboy

2009-07-30 Thread Tim Rowe
2009/7/30 superpollo : > Tim Rowe wrote: >> Any language that gets any sort of real use has to have. For instance, >> I love Ada's numeric types (you can specify either the minimum number >> of significant figures or the maximum delta for a real type, and it >> wil

Re: Confessions of a Python fanboy

2009-07-31 Thread Tim Rowe
2009/7/31 Steven D'Aprano : > On Thu, 30 Jul 2009 18:47:04 +0100, Tim Rowe wrote: > >> That and the fact that I couldn't stop laughing for long enough to learn >> any more when I read in the Pragmatic Programmer's Guide that "Ruby, >> unlike less flexi

Re: An assessment of the Unicode standard

2009-09-17 Thread Tim Rowe
er with tentacles and fangs, that my language doesn't have a word for and that I have never seen. On your theory, how come I am thinking about it? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: An assessment of the Unicode standard

2009-09-20 Thread Tim Rowe
I was only 3 when it was released. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Tim Rowe
u lose compiler checks. That's the right balance for a lot of applications, but not for all. If it's really critical that the program be correct then you'll want a bondage-and-discipline language that does masses of check, you might even do separate static analysis, and you'll *st

<    1   2