Re: PyWart: The problem with print

2013-06-12 Thread Joshua Landau
On 4 June 2013 14:35, Mark Lawrence breamore...@yahoo.co.uk wrote: On 04/06/2013 14:29, rusi wrote: The Clash of the Titans Lé jmf chârgeth with mightƴ might And le Mond underneath trembleth Now RR mounts his sturdy steed And the windmill yonder turneth +1 funniest poem of the week :)

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Ian Kelly
On Wed, Jun 5, 2013 at 10:25 PM, Russ P. russ.paie...@gmail.com wrote: I recall reading a few years ago that Guido was thinking about adding optional type annotations. I don't know if that went anywhere or not, but I thought it was a good idea. Eventually I got tired of waiting, and I

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 12:29:44 +1000, Chris Angelico wrote: On Thu, Jun 6, 2013 at 11:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote: As for Python, my experience with it is that, as your application grows, you start getting

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Chris Angelico
On Thu, Jun 6, 2013 at 7:29 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Whatever benefit there is in declaring the type of a function is lost due to the inability to duck-type or program to an interface. There's no type that says any object with a 'next' method, for example.

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Serhiy Storchaka
06.06.13 12:45, Chris Angelico написав(ла): For the accept any object that has a next() method sorts of rules, I don't know of any really viable system that does that usefully. The concept of implementing interfaces in Java comes close, but the class author has to declare that it's implementing

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread rusi
On Jun 6, 6:45 am, Chris Angelico ros...@gmail.com wrote: On Thu, Jun 6, 2013 at 11:37 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What prevents bugs is the skill of the people writing the code, not the compiler. +1 QOTW. In many Indian languages there is a saying: A

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 12:09 AM, rusi rustompm...@gmail.com wrote: When we switched from to python (via Scheme and a haskell- predecessor), I dont remember ever getting a segmentation fault. Oh, it's easy to segfault Python. import sys sys.setrecursionlimit(9) def foo(): foo() foo()

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Robert Kern
On 2013-06-06 10:45, Chris Angelico wrote: For the accept any object that has a next() method sorts of rules, I don't know of any really viable system that does that usefully. The concept of implementing interfaces in Java comes close, but the class author has to declare that it's implementing

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread rusi
On Jun 6, 8:26 pm, Chris Angelico ros...@gmail.com wrote: On Fri, Jun 7, 2013 at 12:09 AM, rusi rustompm...@gmail.com wrote: When we switched from to python (via Scheme and a haskell- predecessor), I dont remember ever getting a segmentation fault. Oh, it's easy to segfault Python. import

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:36 AM, rusi rustompm...@gmail.com wrote: On Jun 6, 8:26 pm, Chris Angelico ros...@gmail.com wrote: On Fri, Jun 7, 2013 at 12:09 AM, rusi rustompm...@gmail.com wrote: When we switched from to python (via Scheme and a haskell- predecessor), I dont remember ever getting

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:35 AM, Robert Kern robert.k...@gmail.com wrote: On 2013-06-06 10:45, Chris Angelico wrote: For the accept any object that has a next() method sorts of rules, I don't know of any really viable system that does that usefully. The concept of implementing interfaces in

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 11:59:07 AM UTC-5, Chris Angelico wrote: Frankly, I don't think the language much matters. It's all down to the skill of the programmers and testers. Ada wasn't the source of the problem unless Ada has a bug in it... which is going to be true of pretty much any

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 1:49 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Wednesday, June 5, 2013 11:59:07 AM UTC-5, Chris Angelico wrote: Frankly, I don't think the language much matters. It's all down to the skill of the programmers and testers. Ada wasn't the source of the

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Robert Kern
On 2013-06-06 16:41, Chris Angelico wrote: Anyway, regardless of your language, there's always some criteria that can't be coded. Suppose the valid input for a function were integers whose square roots are integers but whose cube roots are not. You won't easily get compile-time checking of

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 6:18:13 PM UTC-5, Michael Torrie wrote: On 06/05/2013 12:11 AM, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine for many applications but certainly not for

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Devin Jeanpierre
On Thu, Jun 6, 2013 at 12:24 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: In Python, if you fail to use the return statement, then Python will return None, NOT some some value that just happens to be the last line executed in the function -- Ruby breaks the law of least astonishment.

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 2:15:57 AM UTC-5, Chris Angelico wrote: [...] I cannot name a single modern programming language that does NOT have some kind of implicit boolification. Congrats: Again you join the ranks of most children who make excuses for their foolish actions along the lines

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Chris Angelico
On Fri, Jun 7, 2013 at 2:49 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Wednesday, June 5, 2013 2:15:57 AM UTC-5, Chris Angelico wrote: [...] I cannot name a single modern programming language that does NOT have some kind of implicit boolification. Congrats: Again you join the

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread rusi
On Jun 6, 9:08 pm, Robert Kern robert.k...@gmail.com wrote: On 2013-06-06 16:41, Chris Angelico wrote: Anyway, regardless of your language, there's always some criteria that can't be coded. Suppose the valid input for a function were integers whose square roots are integers but whose cube

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Grant Edwards
On 2013-06-06, Chris Angelico ros...@gmail.com wrote: Would you say that doubling the testing period is a good thing or a bad thing? It could be a neutral thing (ignoring the costs involved). I once read read an article claiming that as you test (and fix) any large, complex piece of software,

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Mark Janssen
Whatever benefit there is in declaring the type of a function is lost due to the inability to duck-type or program to an interface. There's no type that says any object with a 'next' method, for example. And having to declare local variables is a PITA with little benefit. Give me a language

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Rick Johnson
On Wednesday, June 5, 2013 8:37:20 PM UTC-5, Steven D'Aprano wrote: On Wed, 05 Jun 2013 09:15:01 -0700, Russ P. wrote: On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote: On 05/06/2013 07:11, Russ P. wrote: What prevents bugs is the skill of the people writing the code, not

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Russ P.
On Thursday, June 6, 2013 2:29:02 AM UTC-7, Steven D'Aprano wrote: On Thu, 06 Jun 2013 12:29:44 +1000, Chris Angelico wrote: On Thu, Jun 6, 2013 at 11:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote: As for

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Rick Johnson
On Thursday, June 6, 2013 1:03:24 PM UTC-5, Rick Johnson wrote: The second covers type checking objects that enter into new namespaces. That would cover all functions/methods arguments (at a minimum). Yeah, before anyone starts complaining about this, i meant to say scope. Now you can

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Devin Jeanpierre
Super OT divergence because I am a loser nerd: On Thu, Jun 6, 2013 at 1:27 PM, rusi rustompm...@gmail.com wrote: Yes, all programming communities have blind-spots. The Haskell community's is that Haskell is safe and safe means that errors are caught at compile-time. I don't think Haskell

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread alex23
On Jun 7, 3:59 am, Mark Janssen dreamingforw...@gmail.com wrote: Okay, I'm going straighten out you foo(l)s once and for all. Gosh, really?! THANKS. Python has seduced us all into lazy typing.  That's what it is. Bulshytt. If you have no idea what polymorphism is, you shouldn't even be

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread alex23
On Jun 7, 2:39 am, Devin Jeanpierre jeanpierr...@gmail.com wrote: Languages do not exist in a vacuum. They do if all you use them for is academic point scoring over practical purposes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Dan Stromberg
On Thu, Jun 6, 2013 at 9:49 AM, Rick Johnson rantingrickjohn...@gmail.comwrote: Congrats: Again you join the ranks of most children who make excuses for their foolish actions along the lines of: Hey, they did it first! Well, the lemmings get what they deserve i suppose. Lemmings don't

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Mark Janssen
Python has seduced us all into lazy typing. That's what it is. Bulshytt. If you have no idea what polymorphism is, you shouldn't even be participating in this conversation. I am aware of what it means, but Python doesn't really have it (although it may evolve to it with annotations). But

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread alex23
On Jun 7, 11:44 am, Mark Janssen dreamingforw...@gmail.com wrote: Bulshytt. If you have no idea what polymorphism is, you shouldn't even be participating in this conversation. I am aware of what it means, but Python doesn't really have it You really need to stop commenting when you clearly

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Steven D'Aprano
On Thu, 06 Jun 2013 18:44:49 -0700, Mark Janssen wrote: Python has seduced us all into lazy typing. That's what it is. Bulshytt. If you have no idea what polymorphism is, you shouldn't even be participating in this conversation. I am aware of what it means, but Python doesn't really have

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread rusi
On Jun 6, 11:44 pm, Devin Jeanpierre jeanpierr...@gmail.com wrote: Unfortunately* the halting problem stands. When generalized to Rice theorem it says that only trivial properties of programs are algorithmically decidable: http://mathworld.wolfram.com/RicesTheorem.html And so the

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Mark Janssen
I am aware of what it means, but Python doesn't really have it (although it may evolve to it with annotations). No polymorphism huh? py len([1, 2, 3]) # len works on lists 3 py len((1, 2)) # and on tuples 2 py len({}) # and on dicts 0 py len('I pity the fool') # and on strings 15

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread rusi
On Jun 7, 8:14 am, Mark Janssen dreamingforw...@gmail.com wrote: I am aware of what it means, but Python doesn't really have it (although it may evolve to it with annotations). No polymorphism huh? py len([1, 2, 3])  # len works on lists 3 py len((1, 2))  # and on tuples 2 py

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Mark Janssen
Fairly definitive terms have existed since 1985: http://lucacardelli.name/Papers/OnUnderstanding.A4.pdf You are making an outside view of a function (until a better term is found). So that give you one possible view of polymorphism. However, *within* a class that I would write, you would

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread rusi
On Jun 7, 8:24 am, rusi rustompm...@gmail.com wrote: On Jun 7, 8:14 am, Mark Janssen dreamingforw...@gmail.com wrote: I am aware of what it means, but Python doesn't really have it (although it may evolve to it with annotations). No polymorphism huh? py len([1, 2, 3])  #

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-06 Thread Mark Janssen
On 6/6/13, alex23 wuwe...@gmail.com wrote: On Jun 7, 11:44 am, Mark Janssen dreamingforw...@gmail.com wrote: Bulshytt. If you have no idea what polymorphism is, you shouldn't even be participating in this conversation. I am aware of what it means, but Python doesn't really have it You

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Russ P.
On Tuesday, June 4, 2013 8:44:11 AM UTC-7, Rick Johnson wrote: Yes, but the problem is not my approach, rather the lack of proper language design (my apologizes to the anointed one. ;-) If you don't like implicit conversion to Boolean, then maybe you should be using another language --

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Chris Angelico
On Wed, Jun 5, 2013 at 4:11 PM, Russ P. russ.paie...@gmail.com wrote: On Tuesday, June 4, 2013 8:44:11 AM UTC-7, Rick Johnson wrote: Yes, but the problem is not my approach, rather the lack of proper language design (my apologizes to the anointed one. ;-) If you don't like implicit

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 12:15:57 AM UTC-7, Chris Angelico wrote: On Wed, Jun 5, 2013 at 4:11 PM, Russ P. wrote: On Tuesday, June 4, 2013 8:44:11 AM UTC-7, Rick Johnson wrote: Yes, but the problem is not my approach, rather the lack of proper language design (my apologizes

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Mark Lawrence
On 05/06/2013 07:11, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine for many applications but certainly not for critical ones. I want to launch this rocket with an expensive satellite on top. I

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Terry Jan Reedy
On 6/5/2013 2:11 AM, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine for many applications but certainly not for critical ones. I believe Shedskin, a Python *subset* compiler*, will reject that,

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote: On 05/06/2013 07:11, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine for many applications but certainly

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 2:15 AM, Russ P. russ.paie...@gmail.com wrote: On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote: I want to launch this rocket with an expensive satellite on top. I know it's safe as the code is written in ADA. Whoops :( So Python would have been a

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 9:59:07 AM UTC-7, Chris Angelico wrote: On Thu, Jun 6, 2013 at 2:15 AM, Russ P. wrote: On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote: I want to launch this rocket with an expensive satellite on top. I know it's safe as the code is

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Michael Torrie
On 06/05/2013 12:11 AM, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine for many applications but certainly not for critical ones. This comment shows me that you don't understand the

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 4:18:13 PM UTC-7, Michael Torrie wrote: On 06/05/2013 12:11 AM, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine for many applications but

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Michael Torrie
On 06/05/2013 05:52 PM, Russ P. wrote: My comment shows you nothing about what I understand about names, objects, and variables. Yes that probably is true. You have chosen to question my understanding apparently because my point bothered you but you don't have a good reply. Then you link me

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 09:15:01 -0700, Russ P. wrote: On Wednesday, June 5, 2013 1:59:01 AM UTC-7, Mark Lawrence wrote: On 05/06/2013 07:11, Russ P. wrote: But then, what would you expect of a language that allows you to write x = 1 x = Hello It's all loosey goosey -- which is fine

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 11:37 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What prevents bugs is the skill of the people writing the code, not the compiler. +1 QOTW. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Steven D'Aprano
On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote: I'm not an Ada guy, but Ada advocates claim that it reduces development time by half in the long run compared to C and C++ due to reduced debugging time and simpler maintenance. They may be right. Far too many people think that C and C++

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Chris Angelico
On Thu, Jun 6, 2013 at 11:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote: As for Python, my experience with it is that, as your application grows, you start getting confused about what the argument types are or are supposed

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-05 Thread Russ P.
On Wednesday, June 5, 2013 7:29:44 PM UTC-7, Chris Angelico wrote: On Thu, Jun 6, 2013 at 11:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 05 Jun 2013 14:59:31 -0700, Russ P. wrote: As for Python, my experience with it is that, as your application

Re: PyWart: The problem with print

2013-06-04 Thread Chris Angelico
On Tue, Jun 4, 2013 at 11:37 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: The print function is the very definition of a syntactic sugar. For example: print(some sting) is much more readable than: sys.stdout.write(some string+\n) ... Again, the removal of a print function

Re: PyWart: The problem with print

2013-06-04 Thread jmfauth
On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about professionalism. Let's consider a thought exercise shall we? The flexible string

Re: PyWart: The problem with print

2013-06-04 Thread rusi
On Jun 4, 5:23 pm, jmfauth wxjmfa...@gmail.com wrote: On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about professionalism. Let's consider a thought

Re: PyWart: The problem with print

2013-06-04 Thread Mark Lawrence
On 04/06/2013 14:29, rusi wrote: On Jun 4, 5:23 pm, jmfauth wxjmfa...@gmail.com wrote: On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Rick Johnson
On Tuesday, June 4, 2013 12:39:59 AM UTC-5, Steven D'Aprano wrote: On Mon, 03 Jun 2013 18:37:24 -0700, Rick Johnson wrote: Consider a simple thought experiment. Suppose we start with a sequence of if statements that begin simple and get more complicated: if a == 1: ... if a == 1 and b 2*c:

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 1:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: But we are really ignoring the elephant in the room. Implict conversion to Boolean is just a drop in the bucket compared to the constant shell game we are subjected to when reading source code. We so naively

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Fábio Santos
On 4 Jun 2013 17:04, Chris Angelico ros...@gmail.com wrote: On Wed, Jun 5, 2013 at 1:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: But we are really ignoring the elephant in the room. Implict conversion to Boolean is just a drop in the bucket compared to the constant shell game

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Rick Johnson
On Jun 4, 10:44 am, Rick Johnson rantingrickjohn...@gmail.com wrote: What we need is a method by which we can validate a symbol and simultaneously do the vaidation in a manner that will cast light on the type that is expected. In order for this to work, you would need validators with unique

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Rick Johnson
On Jun 4, 11:00 am, Chris Angelico ros...@gmail.com wrote: You know, if you want a language with strict type declarations and extreme run-time efficiency, there are some around. I don't like declaring types everywhere, i hate it. I prefer duck typed languages, HOWEVER, in order for duck typing

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Chris Angelico
On Wed, Jun 5, 2013 at 2:19 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Jun 4, 11:00 am, Chris Angelico ros...@gmail.com wrote: You know, if you want a language with strict type declarations and extreme run-time efficiency, there are some around. I don't like declaring types

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Ned Batchelder
On 6/4/2013 12:19 PM, Rick Johnson wrote: On Jun 4, 11:00 am, Chris Angelico ros...@gmail.com wrote: You know, if you want a language with strict type declarations and extreme run-time efficiency, there are some around. I don't like declaring types everywhere, i hate it. I prefer duck typed

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Jason Swails
On Tue, Jun 4, 2013 at 11:44 AM, Rick Johnson rantingrickjohn...@gmail.comwrote: This implicit conversion seems like a good idea at first, and i was caught up in the hype myself for some time: Hey, i can save a few keystrokes, AWESOME!. However, i can tell you with certainty that this

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Ian Kelly
On Tue, Jun 4, 2013 at 9:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: It is my firm belief that truth testing a value that is not a Boolean should raise an exception. If you want to convert a type to Boolean then pass it to the bool function: lst = [1,2,3] if bool(lst):

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Rick Johnson
On Jun 4, 12:42 pm, Ian Kelly ian.g.ke...@gmail.com wrote: By this manner, we can roll three common tests into one method: * Boolean conversion * member truthiness for iterables * type checking How exactly does this is_valid method perform the first two? Are you

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Mark Lawrence
On 05/06/2013 00:21, Rick Johnson wrote: [snip] Would you be kind enough not to smoke too much wacky baccy before posting, thanks. -- Steve is going for the pink ball - and for those of you who are watching in black and white, the pink is next to the green. Snooker commentator 'Whispering'

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread alex23
On Jun 5, 2:09 am, Rick Johnson rantingrickjohn...@gmail.com wrote: This is how you design a language for consistency and readability. Great! Now you can shut up and get back to work on RickPython4000. Come back and let us know all about it when it's done. --

Re: PyWart: The problem with print

2013-06-04 Thread Steven D'Aprano
On Tue, 04 Jun 2013 05:23:19 -0700, jmfauth wrote: How is is possible to arrive to such a situation ? The answer if far beyond my understanding Truer words have never been spoken. (although I have my opinion on the subject). http://en.wikipedia.org/wiki/Dunning–Kruger_effect -- Steven

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Michael Torrie
On 06/04/2013 05:21 PM, Rick Johnson wrote: If you still feel that this idea is garbage, then, keep on writing your sloppy code. My proposal is the best method to handle the problems that arise with duck typed languages in a manner that is not restrictive or laborious -- it's actually quite

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread Steven D'Aprano
On Wed, 05 Jun 2013 02:27:26 +1000, Chris Angelico wrote: On Wed, Jun 5, 2013 at 2:19 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Jun 4, 11:00 am, Chris Angelico ros...@gmail.com wrote: You know, if you want a language with strict type declarations and extreme run-time

Re: Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-04 Thread alex23
On Jun 5, 3:28 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: How many years has Rick been coming here, proclaiming loudly x [a]nd yet, he still has no clue what x actually means. It's not just duck typing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Heisenbugs? (was: Re: PyWart: The problem with print)

2013-06-03 Thread Devin Jeanpierre
On Mon, Jun 3, 2013 at 12:34 AM, Dan Sommers d...@tombstonezero.net wrote: On Mon, 03 Jun 2013 13:37:27 +1000, Tim Delaney wrote: With the increase in use of higher-level languages, these days Heisenbugs most often appear with multithreaded code that doesn't properly protect critical

Re: PyWart: The problem with print

2013-06-03 Thread Chris Angelico
On Mon, Jun 3, 2013 at 3:49 PM, Michael Torrie torr...@gmail.com wrote: On 06/02/2013 12:18 PM, Rick Johnson wrote: On Sunday, June 2, 2013 12:49:02 PM UTC-5, Dan Sommers wrote: On Mon, 03 Jun 2013 03:20:52 +1000, Chris Angelico wrote: On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson [...] Or use

Re: PyWart: The problem with print

2013-06-03 Thread Alister
On Mon, 03 Jun 2013 17:17:12 +1000, Chris Angelico wrote: On Mon, Jun 3, 2013 at 3:49 PM, Michael Torrie torr...@gmail.com wrote: On 06/02/2013 12:18 PM, Rick Johnson wrote: On Sunday, June 2, 2013 12:49:02 PM UTC-5, Dan Sommers wrote: On Mon, 03 Jun 2013 03:20:52 +1000, Chris Angelico

Re: PyWart: The problem with print

2013-06-03 Thread Mark Lawrence
On 03/06/2013 04:10, Dan Sommers wrote: On Sun, 02 Jun 2013 20:16:21 -0400, Jason Swails wrote: ... If you don't believe me, you've never hit a bug that 'magically' disappears when you add a debugging print statement ;-). Ah, yes. The Heisenbug. ;-) We used to run into those back in the

Re: PyWart: The problem with print

2013-06-03 Thread Robert Kern
On 2013-06-03 05:20, Dan Sommers wrote: On Sun, 02 Jun 2013 23:23:42 -0400, Jason Swails wrote: ... (And yes, a good portion of our code is -still- in Fortran -- but at least it's F90+ :). I am a huge proponent of using the right tool for the job. There is nothing wrong with some

Re: PyWart: The problem with print

2013-06-03 Thread Dave Angel
On 06/03/2013 04:49 AM, Mark Lawrence wrote: On 03/06/2013 04:10, Dan Sommers wrote: On Sun, 02 Jun 2013 20:16:21 -0400, Jason Swails wrote: ... If you don't believe me, you've never hit a bug that 'magically' disappears when you add a debugging print statement ;-). Ah, yes. The Heisenbug.

Re: PyWart: The problem with print

2013-06-03 Thread Ian Kelly
On Sun, Jun 2, 2013 at 6:16 PM, Jason Swails jason.swa...@gmail.com wrote: I'm actually with RR in terms of eliminating the overhead involved with 'dead' function calls, since there are instances when optimizing in Python is desirable. I actually recently adjusted one of my own scripts to

Re: PyWart: The problem with print

2013-06-03 Thread Jason Swails
On Mon, Jun 3, 2013 at 1:12 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Jun 2, 2013 at 6:16 PM, Jason Swails jason.swa...@gmail.com wrote: I'm actually with RR in terms of eliminating the overhead involved with 'dead' function calls, since there are instances when optimizing in

Re: PyWart: The problem with print

2013-06-03 Thread Jason Swails
On Mon, Jun 3, 2013 at 1:12 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Jun 2, 2013 at 6:16 PM, Jason Swails jason.swa...@gmail.com wrote: I'm actually with RR in terms of eliminating the overhead involved with 'dead' function calls, since there are instances when optimizing in

Re: PyWart: The problem with print

2013-06-03 Thread Jason Swails
ack, sorry for the double-post. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: The problem with print

2013-06-03 Thread Steven D'Aprano
On Mon, 03 Jun 2013 15:09:48 -0400, Jason Swails wrote: But unlike RR, who suggests some elaborate interpreter-wide, ambiguous ignore-rule to squash out all of these functions, I'm simply suggesting that sometimes it's worth commenting-out debug print calls instead of 'just leaving them there

Re: PyWart: The problem with print

2013-06-03 Thread Chris Angelico
On Tue, Jun 4, 2013 at 6:31 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: ... quite frankly I have no sympathy for the view that CPU cycles are so precious that we mustn't waste them. If that were the case, Python is the wrong language. CPU cycles *are* valuable still,

Re: PyWart: The problem with print

2013-06-03 Thread Rick Johnson
On Sunday, June 2, 2013 1:58:30 PM UTC-5, Steven D'Aprano wrote: On Sun, 02 Jun 2013 10:04:00 -0700, Rick Johnson wrote: Oh Steven, you've really outdone yourself this time with the theatrics. I hope you scored some cool points with your minions. Heck, you almost had me convinced until i slapped

Re: PyWart: The problem with print

2013-06-03 Thread Vito De Tullio
Rick Johnson wrote: Take your standard yes/no/cancel dialog, i would expect it to return True|False|None respectively, you clearly mean True / False / FileNotFound. ( http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx ) -- ZeD -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWart: The problem with print

2013-06-03 Thread Rick Johnson
On Monday, June 3, 2013 10:16:13 PM UTC-5, Vito De Tullio wrote: Rick Johnson wrote: Take your standard yes/no/cancel dialog, i would expect it to return True|False|None respectively, you clearly mean True / False / FileNotFound. No, i clearly meant what i said :-). FileDialogs only

Re: PyWart: The problem with print

2013-06-03 Thread Steven D'Aprano
On Tue, 04 Jun 2013 05:16:13 +0200, Vito De Tullio wrote: Rick Johnson wrote: Take your standard yes/no/cancel dialog, i would expect it to return True|False|None respectively, you clearly mean True / False / FileNotFound. ( http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx )

Bools and explicitness [was Re: PyWart: The problem with print]

2013-06-03 Thread Steven D'Aprano
On Mon, 03 Jun 2013 18:37:24 -0700, Rick Johnson wrote: On Sunday, June 2, 2013 1:58:30 PM UTC-5, Steven D'Aprano wrote: On Sun, 02 Jun 2013 10:04:00 -0700, Rick Johnson wrote: A wise programmer may think he's solved the problem by writing a function called debugprint that looks like this:

PyWart: The problem with print

2013-06-02 Thread Rick Johnson
Note to those of you who may be new to Python: I will refer to print as a function -- just be aware that print was a statement before Python3000 was introduced. Introduction:

Re: PyWart: The problem with print

2013-06-02 Thread Chris Angelico
On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: * Woefully inadequate because: Switching on or off the debug messages is only valid in the current module that the function was imported. What if you want to kill all debugprint messages EVERYWHERE? Do

Re: PyWart: The problem with print

2013-06-02 Thread Andrew Berg
I don't think you go far enough. Obviously we need way more flexibility. A simple on/off is okay for some things, but a finer granularity would be really helpful because some things are more important than others. And why stop at stdout/stderr? We need to add a consistent way to output these

Re: PyWart: The problem with print

2013-06-02 Thread Chris Angelico
On Mon, Jun 3, 2013 at 3:30 AM, Andrew Berg robotsondr...@gmail.com wrote: I don't think you go far enough. Obviously we need way more flexibility. A simple on/off is okay for some things, but a finer granularity would be really helpful because some things are more important than others. And

Re: PyWart: The problem with print

2013-06-02 Thread Dan Sommers
On Mon, 03 Jun 2013 03:20:52 +1000, Chris Angelico wrote: On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: * Woefully inadequate because: Switching on or off the debug messages is only valid in the current module that the function was imported. What if

Re: PyWart: The problem with print

2013-06-02 Thread Rick Johnson
On Jun 2, 12:20 pm, Chris Angelico ros...@gmail.com wrote: On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson * Woefully inadequate because: Switching on or off the debug messages is only valid in the current module that the function was imported. What if you want to kill all

Re: PyWart: The problem with print

2013-06-02 Thread Rick Johnson
On Sunday, June 2, 2013 12:49:02 PM UTC-5, Dan Sommers wrote: On Mon, 03 Jun 2013 03:20:52 +1000, Chris Angelico wrote: On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson [...] Or use the logging module. It's easy to get going quickly (just call logging.basicConfig at startup time), and with a

Re: PyWart: The problem with print

2013-06-02 Thread Steven D'Aprano
On Sun, 02 Jun 2013 10:04:00 -0700, Rick Johnson wrote: Many languages provide a function, method, or statement by which users can write easily to stdout, and Python is no exception with it's own print function. However, whilst writing to stdout via print is slightly less verbose than

Re: PyWart: The problem with print

2013-06-02 Thread Steven D'Aprano
On Sun, 02 Jun 2013 11:09:12 -0700, Rick Johnson wrote: Maybe you don't care about destroying someone's CPU, however, i do! And yet here you are, destroying millions of people's CPUs by sending them email or usenet messages filled with garbage. -- Steven --

Re: PyWart: The problem with print

2013-06-02 Thread Chris Angelico
On Mon, Jun 3, 2013 at 4:09 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Jun 2, 12:20 pm, Chris Angelico ros...@gmail.com wrote: On Mon, Jun 3, 2013 at 3:04 AM, Rick Johnson * Woefully inadequate because: Switching on or off the debug messages is only valid in the current

  1   2   >