Re: using range() in for loops

2006-04-05 Thread Georg Brandl
Steven D'Aprano wrote: > On Wed, 05 Apr 2006 16:15:12 +0200, Georg Brandl wrote: > >> [EMAIL PROTECTED] wrote: >>> hi John, >>> Python doesn't provide for loop like C / C++ but using Range() or >>> Xrange() you can achive all the functionaliti

Re: efficiency of range() and xrange() in for loops

2006-04-05 Thread Georg Brandl
ted bytecodes to > answer questions like this one. I want to be cool too. Where can I find > information about how to get a bytecodes listing for my compiled Python? The "dis" module. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: efficiency of range() and xrange() in for loops

2006-04-05 Thread Georg Brandl
2, 3, 4] >>> xrange(5) xrange(5) >>> range is giving you a real list, while xrange is giving you an xrange object. Have you tried to slice an xrange object? Or using .append on it? Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: efficiency of range() and xrange() in for loops

2006-04-05 Thread Georg Brandl
Alan Morgan wrote: >>range is giving you a real list, while xrange is giving you an xrange object. >>Have you tried to slice an xrange object? Or using .append on it? > > No, I hadn't. I presume these could all be defined. How would xrange(100).remove(1) work? Georg --

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Georg Brandl
t I've missed ? class C(): is meant to be synonymous with class C: and therefore cannot create a new-style class. Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Georg Brandl
Peter Hansen wrote: > Georg Brandl wrote: >> class C(): >> >> is meant to be synonymous with >> >> class C: >> >> and therefore cannot create a new-style class. > > I think "looping" understands that, but is basically asking why any

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Georg Brandl
looping wrote: > Peter Hansen wrote: >> Georg Brandl wrote: >> > class C(): >> > >> > is meant to be synonymous with >> > >> > class C: >> > >> > and therefore cannot create a new-style class. >> >> I think &

Re: Python string.title Function

2006-04-11 Thread Georg Brandl
x.title(); > print x; > Here'S My Title! > > Notice the capitalization -- "Here'S". > Any feedback on this issue is much appreciated. str.title() isn't very sophisticated. It can't really make a difference between an apostroph and a single quote. If yo

Re: Best way to emulate ordered dictionary (like in PHP)?

2006-04-12 Thread Georg Brandl
x27;s also one in the Python Cookbook, at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/438823 HTH, Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: just one more question about the python challenge

2006-04-12 Thread Georg Brandl
7;d still like to > read a description of what to do, if one exists somewhere (can't find > one at all, though), but at this point I'd be happy with the next URL so > I can just move on. I've been stagnating for a few days and I need to > use Python again! :) Have y

Re: just one more question about the python challenge

2006-04-12 Thread Georg Brandl
John Salerno wrote: > Georg Brandl wrote: > >> Have you found the file? You'll have to distribute that file bytewise >> in 5 "piles". > > No, I haven't figured out anything for this puzzle. It seems I might > have to change the filename of the im

Re: just one more question about the python challenge

2006-04-12 Thread Georg Brandl
John Salerno wrote: > Just wrote: >> In article <[EMAIL PROTECTED]>, >> John Salerno <[EMAIL PROTECTED]> wrote: >> >>> Georg Brandl wrote: >>> >>>> Have you found the file? You'll have to distribute that file bytewise >>&

Re: list.clear() missing?!?

2006-04-12 Thread Georg Brandl
e best >> examples from this thread and turn it into a PEP? > > What are the usual arguments against adding it? That there should be one obvious way to do it. Yes, I know that it can be debated whether "del x[:]" is obvious, and fortunately I'm not the one to decide .

Re: just one more question about the python challenge

2006-04-12 Thread Georg Brandl
wing what the 'data' > is I need to move on to the next step of the puzzle. I now have 3 > images, along with gfx file. The images are perfect images, so there are chances there's no additional data hidden in them. The gfx file, however, isn't viewable yet. Hint, hint ;) Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-13 Thread Georg Brandl
list or clear it completely' would be a good change for 3.1.4. I added two examples of clearing a list to the section about slice assignment and del. Georg -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.2 alpha 4

2010-11-16 Thread Georg Brandl
e found at: http://docs.python.org/3.2/ Please consider trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors)

[RELEASED] Python 3.2 beta 1

2010-12-06 Thread Georg Brandl
g/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAkz9WcgACgkQN9GcIYhpnLBRYwCeMmH1GMmKOx9fVk8a/F0/TOzj Vp0AoIHYBNcxV/U0AXIwMGWFHi1bAB+a =KB

[RELEASED] Python 3.2 beta 2

2010-12-21 Thread Georg Brandl
g/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk0Q/aAACgkQN9GcIYhpnLDf8gCgkLGAsE+T3R505jZc1RxXDYsa NSsAnRGaFjeTm9o2Z5O8FuIzTUG8t1PT =hH

[RELEASED] Python 3.2 rc 1

2011-01-15 Thread Georg Brandl
der trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.

[RELEASED] Python 3.2 rc 2

2011-01-31 Thread Georg Brandl
der trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v1.

[RELEASED] Python 3.2 rc 3

2011-02-13 Thread Georg Brandl
ing Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v1.

[RELEASED] Python 3.2

2011-02-20 Thread Georg Brandl
notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.2 alpha 1

2010-08-01 Thread Georg Brandl
r code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE- Version: GnuPG v2.

[RELEASED] Python 3.2 alpha 2

2010-09-06 Thread Georg Brandl
python.org/3.2/ Please consider trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGIN PGP SIGNATURE-

[RELEASED] Python 3.2 alpha 3

2010-10-12 Thread Georg Brandl
http://docs.python.org/3.2/ Please consider trying Python 3.2 with your code and reporting any bugs you may notice to: http://bugs.python.org/ Enjoy! - -- Georg Brandl, Release Manager georg at python.org (on behalf of the entire python-dev team and 3.2's contributors) -BEGI

Literate Programming

2011-04-07 Thread Hans Georg Schaathun
maths of a problem completely unambiguously. TIA -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Literate Programming

2011-04-08 Thread Hans Georg Schaathun
far(i) Highlighting tends to break starting from `else', and indentation breaks at the second or third level. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Literate Programming

2011-04-08 Thread Hans Georg Schaathun
On Fri, 8 Apr 2011 05:22:01 -0700 (PDT), Jim wrote: : On Apr 7, 2:09 pm, Hans Georg Schaathun wrote: : > Has anyone found a good system for literate programming in python? : : Are you aware of pyweb http://sourceforge.net/projects/pywebtool/ ? Interesting tool, but it solves only part

Re: Literate Programming

2011-04-09 Thread Hans Georg Schaathun
ight code and markup programming concepts (methods/classes/variables)? If I may ask ... -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Literate Programming

2011-04-09 Thread Hans Georg Schaathun
What features? Standardised and well thought-out markup for functions/methods/classes etc., as well as highlighting. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 vs Java 1.6

2011-04-09 Thread Hans Georg Schaathun
rmance is much better for apples, as I do not waste any time peeling. For similar reasons, I get much better performance out of python than I get with Java ... -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: About threads in python

2011-04-25 Thread Hans Georg Schaathun
, the bottleneck is likely to be deeply embedded in some library like numpy or scipy already. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

sockets: bind to external interface

2011-04-25 Thread Hans Georg Schaathun
only one of which I am root.) Thus, the standard solution of binding to whatever socket.gethostname() returns does not work. Has anyone found a simple solution that can be administered without root privileges? I mean simpler than passing the ip address manually :-) TIA -- :-- Hans Georg -- http

Re: sockets: bind to external interface

2011-04-25 Thread Hans Georg Schaathun
was not mentioned in the tutorial I used ... -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: sockets: bind to external interface

2011-04-25 Thread Hans Georg Schaathun
On Mon, 25 Apr 2011 21:14:51 +0100, Hans Georg Schaathun wrote: : : The way you talk of "the" external interface, I'm assuming this : : computer has only one. Is there a reason for not simply binding to : : INADDR_ANY aka 0.0.0.0? : : Ah. That's what I really wante

Re: sockets: bind to external interface

2011-04-25 Thread Hans Georg Schaathun
he lack of detail. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

client-server parallellised number crunching

2011-04-26 Thread Hans Georg Schaathun
Now, understanding the parallelisable subproblems better, I could try again, if I can trust that these libraries can robustly handle lost clients. That I don't know if I can. Any ideas? TIA -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: De-tupleizing a list

2011-04-26 Thread Hans Georg Schaathun
stood even by readers with no experience with python. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: client-server parallellised number crunching

2011-04-26 Thread Hans Georg Schaathun
I get the client/server parallellisation working, I shall be able to reuse it at negligible cost on other subproblems, whereas the profiling and C reimplementation would cost almost as much time for every subsystem. Does that answer your question, Chris? -- :-- Hans Georg -- http://mail.python.org

Re: De-tupleizing a list

2011-04-26 Thread Hans Georg Schaathun
On Tue, 26 Apr 2011 13:37:40 -0700, Ethan Furman wrote: : Hans Georg Schaathun wrote: : > List comprehension is understood even by readers with no experience : > with python. : : There's nothing magically understandable about a list comp -- the first : time I saw one (which wa

Re: client-server parallellised number crunching

2011-04-26 Thread Hans Georg Schaathun
new, massively more sophisticated MPI library around now, I would certainly have to do my own code to cope with lost clients. Hadoop sounds intresting. I had encountered it before, but did not think about it. However, the liveCD is clearly not an option. Thanks for the tip; I'll read u

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
remembering for any fully-funded project in the future. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
regular ping messages from the client. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Wed, 27 Apr 2011 23:35:06 +1000, Chris Angelico wrote: : On Wed, Apr 27, 2011 at 10:21 PM, Hans Georg Schaathun : wrote: : > That's correct.  And the client initiates the connection.  At the : > moment, I use one thread per connection, and don't really want to :

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
is that it works, so why change it? But, I am aware that some more technical adept programmers think otherwise, and I am quite happy with that :-) -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] From svn to something else? (was: VCS tools)

2011-04-29 Thread Hans Georg Schaathun
loosing the version history would ... I am particularly interested in git, not because of any qualities it may have but because that's what my colleague pushes, and he seems to be pushing our students into it, so it would be useful for me to be familiar with it. -- :-- Hans Georg --

Re: [OT] From svn to something else?

2011-04-29 Thread Hans Georg Schaathun
then push changesets back : up when they have a patch they're happy with. I am not sure I get the implications right. Are you suggesting that I could keep my svn server, switch to a DVCS client, and reap the benefits? -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Development tools and practices for Pythonistas

2011-04-29 Thread Hans Georg Schaathun
true nightmare when directories are involved. The rumour is that git handles this much better. I call it a rumour not because I doubt it (I don't), but because I have not seen for myself. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-04-29 Thread Hans Georg Schaathun
re efficient in being O(n) whereas OP had (I think) O(2^n), but that's not a property of iteration. You can make a recursive implementation which is O(n). Any undergraduate textbook teaching recursion in any depth is likely to give it as an example; see e.g. Simon Thompson's Haskell

Re: Development tools and practices for Pythonistas

2011-04-30 Thread Hans Georg Schaathun
late. You need time to learn the thinking. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-04-30 Thread Hans Georg Schaathun
nt it without recursion within python. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-04-30 Thread Hans Georg Schaathun
winding of the recursion to a : loop, but the code is typically less clear. Sure. And you have to live with your less clear code when you maintain the system later. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-01 Thread Hans Georg Schaathun
would think that if you can fit the data in memory, then you can also fit the call stack. I can also /imagine/ that one might run into a limit, but I cannot see any concrete examples where it is likely. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-01 Thread Hans Georg Schaathun
sly, since it measures the number of items on the stack and not their size. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-01 Thread Hans Georg Schaathun
than because the recursion gets to deep. Consequently, because recursion is usually a clearer form of expression than iterative loops, recursion may actually be /less/ dangerous. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-01 Thread Hans Georg Schaathun
nto python without further ado. In order to express the one-liner in python, as iteration, you need to introduce additional elements, namely a state (index variable). Hence, recursion is clearer by being close to the language you would normally use to describe the problem. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
e same page. And it is becoming increasingly clear how bizarre this discussion is in a python context. The overhead which may be caused by recursion in hardware is only one of many sources of overhead which one accepts when opting to use python in order to gain other benefits. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
se cases as you do. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
o leave for the compiler. :and 3) Python has a better way to : process collections that removes essentially all the boilerplate in the : recursive-call and while-loop versions: -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
t it is not an issue. Sometimes it isn't, but sometimes it is. The other arguments are valid. And they make me lean more towards more static, compiled languages without the excessive run-time dynamism of python. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: Fibonacci series recursion error

2011-05-02 Thread Hans Georg Schaathun
language for you. It isn't the trade-off per se which bothers me, but certain features which seem to make compilation harder without making development any easier. But then, it probably depeds on what kind of development you are doing. -- :-- Hans Georg -- http://mail.python.org/mailman/

Re: Fibonacci series recursion error

2011-05-03 Thread Hans Georg Schaathun
#x27;ll produce better code. THAT is what distinguishes the : master from the novice. That depends on /what/ your career is, and what you need to master. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-03 Thread Hans Georg Schaathun
t my hand around exactly what this means: Simula has three ways of transmitting arguments, namely transmission by name, by value, and by reference. Is transmission by name the same as call by object? Anyway, I have never seen anyone counting more than three ways of doing this ... -- :-- Hans

Re: What other languages use the same data model as Python?

2011-05-03 Thread Hans Georg Schaathun
n different ways. Whether you use C or Simula, transmission by reference, that is what python appears to be doing, seems to be the normal approach for any composite data type. Thus python does not seem to do anything out of the ordinary at all. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-03 Thread Hans Georg Schaathun
l mutually exclusive though. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
sharing in Wikipedia. What Wikipedia calls call by reference is transmission by name in the Simula context. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
inking in this model for years. Maybe : I'm brainwashed. :) You are. You explain Python in terms of C. That's useful when you talk to other speakers of C. If you want to explain the language to a broader audience, you should use terminology from the language's own level of abst

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
make sense. And pass-by-value where the value is a reference is just confusing. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
table. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
lid for that one interpreter. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
On Wed, 04 May 2011 14:33:34 -0500, harrismh777 wrote: : Hans Georg Schaathun wrote: : > In C it is pass by value, as the pointer : > is explicit and do whatever you want with the pointer value. : : You clearly are not a C programmer. I am not really a programmer period. I am many

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
e, this is useful as /one/ way to consider python variables. As long as one is aware that this is just an example, one approach out of many, then it enhances understanding. If one blindly extrapolates from one implementation, it enhances misunderstanding. -- :-- Hans Georg -- http://mail.python.o

Re: What other languages use the same data model as Python?

2011-05-04 Thread Hans Georg Schaathun
function. Well, call-by-name is not the same as transmission by name either. Transmission by name is what most posters here call call by reference, and transmission by reference is what this thread calls object sharing or call by object. No wonder I started off confused :-) It is better now. --

Re: What other languages use the same data model as Python?

2011-05-05 Thread Hans Georg Schaathun
the better result, but relying on human input when the work can be automated is ridiculously expensive. Now, python is only one level above C in abstraction, but that's a different matter. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-05 Thread Hans Georg Schaathun
On Wed, 04 May 2011 20:11:02 -0500, harrismh777 wrote: : A reference is a pointer (an address). : : A value is memory (not an address). Sure, and pointers (from a hardware or C perspective) are memory, hence pointers are values. -- :-- Hans Georg -- http://mail.python.org/mailman

Re: What other languages use the same data model as Python?

2011-05-05 Thread Hans Georg Schaathun
You cannot reference nor manipulate a reference in python, and that IMHO makes them more abstract. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-08 Thread Hans Georg Schaathun
ned by the languagedefined by the language. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-09 Thread Hans Georg Schaathun
7;t perfect, is that it creates the illusion that references are boxes (objects) just like data objects, leading the reader to think that we could have a reference to a reference. If they are all boxes, by can't we make reference thereto? -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-09 Thread Hans Georg Schaathun
text. Analogies, even imperfect ones, are good when we are clear about the fact that they are analogies. Using C pointers to illustrate how to use bound names in python may be useful, but only if we are clear about the fact that it is an analogy and do not pretend that it explains it in full. -- :-- Hans

Re: Overuse of try/except/else?

2011-05-10 Thread Hans Georg Schaathun
and the information could be passed through the return value instead. Exceptions is a very flexible, but also rather expensive means of communications. You can, actually, write any program using raise instead of return. That would be overuse. -- :-- Hans Georg -- http://mail.python.org/mailman/listinf

Re: What other languages use the same data model as Python?

2011-05-10 Thread Hans Georg Schaathun
don't have universal meanings. :-) -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-10 Thread Hans Georg Schaathun
types (as in haskell or ada)? I think there are too many meanings and too few words ... That's why some languages support overloading. I am afraid we just need to cope with it, overloading I mean. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: scipy

2011-05-10 Thread Hans Georg Schaathun
st painful. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: vertical ordering of functions

2011-05-10 Thread Hans Georg Schaathun
alls may be circular or otherwise convolved in a way that does not allow consistent sorting of caller before/after callee. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
and much more flexible. Just x is as generic as it gets, but depends on python's convolved rules for duck processing and if you aim at legibility it is better avoided. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
of an arbitrary object as a boolean is peculiar for python. An empty list is a real, existing object, and the supposition that [] be false is counter-intuitive. It can be learnt, and the shorthand may be powerful when it is, but it will confuse many readers. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
oping ideas in a large and complex community, where perfect universal mastery of one language is not an option, because half the community do not normally use that language or aren't really programmers at all. The less you assume about the skill of the reader, the better it is. -- :-- Hans Geor

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
amming. The audience I am concerned about is the ones who are over-educated into using and having used a score of different meanings of the same symbols. They will be used to their intuition being wrong when they move into a new context. Being explicit will help them. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
reader and not the writer. What could elif mean other than else: if? if x could, for instance, mean "if x is defined". -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
needs to see your program is a python programmer, then your approach works as well as mine. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
knows how the computation has to be done without specialising in talking to the computer. : This discussion is giving me some insight into some of the crap : programming I see these days. I wonder if you would do a better job at programming the software to crack equations from quantum physics th

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
ing theory is reading this? I better dumb it down." That depends on the purpose of that particular paper, but the real question is, who writes the software to test that string theory empirically? Please tell. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
ntial, one would simply not be able to keep up with the application discipline. If all you do is to write software for computer illiterate users, YMWV. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
ndeed, so why don't we exploit the revolution and write the programs to be as accessible as possible? (Although, python is not the most revolutionary in this respect.) -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
On Wed, 11 May 2011 10:31:59 -0600, Ian Kelly wrote: : (x + 3 for x in xs if x % 2 == 1) Interesting. Thanks. That might come in handy some time. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
: I may not have made the point well, but I cannot see any advantage : for trying to program for the lowest common denominator. Common to what? I'd try the lowest common denominator of legibility and effictiveness. It is just KISS. -- :-- Hans Georg -- http://mail.python.org/mailma

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
tion or is expected to learn enough Python to understand it. That's fair enough. You know your code, so it is probably true. It would not be true for the code I am writing. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
t oriented programming is to bestow the objects with properties reflecting known properties from the domain being modelled. Lists do not have truth values in the application domain, and therefore truth values in the implementation domain is complicated. -- :-- Hans Georg -- http://mail.python.o

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
stitute functional/logical/whatever for imperative. You would not be completely clueless moving to ada/fortran/C/pascal/simula. There may be new concepts, and some concepts which must be adapted to another level of abstraction, but you do have a clue about the core concepts. -- :-- Hans Georg --

Re: checking if a list is empty

2011-05-11 Thread Hans Georg Schaathun
On 11 May 2011 21:47:27 GMT, Steven D'Aprano wrote: : On Wed, 11 May 2011 20:13:35 +0100, Hans Georg Schaathun wrote: : > One principle of object oriented programming is to bestow the objects : > with properties reflecting known properties from the domain being : > modelled. Lis

<    1   2   3   4   5   >