Re: Python for philosophers

2013-05-13 Thread Jake Angulo
On Tue, May 14, 2013 at 9:32 AM, Citizen Kant wrote: > Do I want to learn to program? > I didn't say I've wanted to learn to program neither said the > opposite. I've said that I wasn't sure. H... i'd say you'll make very good business applications analyst. In fact i'd hazard to say you can

Re: Python for philosophers

2013-05-13 Thread Steven D'Aprano
On Tue, 14 May 2013 01:32:43 +0200, Citizen Kant wrote: > An entity named Python must be somehow as a serpent. Don't forget that > I'm with the freeing up of my memory, now I'm not trying to follow the > path of what's told but acting like the monkey and pushing with my > finger against the skin o

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Steven D'Aprano
On Mon, 13 May 2013 21:17:41 +, Alister wrote: > I would then still write it as not (x == y) to make it clear to myself & > avoid any possible confusion although I think that X != Y is much > cleaner. I think that is sad. If I read "not (x == y)" I would assume that the person writing the co

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Steven D'Aprano
On Mon, 13 May 2013 19:22:24 -0400, Dave Angel wrote: > So which special methods should the <> operator call? By rights it > ought to call both __gt__ and __lt__ and return True if either of them > is True. The <> operator comes from Pascal, where it was used as "not equal" since ASCII doesn't

Re: Python for philosophers

2013-05-13 Thread llanitedave
On Monday, May 13, 2013 4:32:43 PM UTC-7, Citizen Kant wrote: >An entity named Python must be > somehow as a serpent. Moe like a dead parrot, actually. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Off topic] Software epigrams

2013-05-13 Thread Chris Angelico
On Tue, May 14, 2013 at 1:08 PM, Dan Sommers wrote: > And if I've designed my program the right way, what's relevant in one > place (package, module, function, line of code) is different from what's > relevant in another. Absolutely. Layered systems FTW! Nothing matters but your current layer and

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Cameron Simpson
On 13May2013 21:41, Dave Angel wrote: | On 05/13/2013 07:30 PM, Cameron Simpson wrote: | >On 13May2013 19:22, Dave Angel wrote: | >| On 05/13/2013 06:53 PM, Mark Lawrence wrote: | >| >I much prefer the alternative <> for != but some silly people insisted | >| >that this be removed from Python3.

Re: [Off topic] Software epigrams

2013-05-13 Thread Dan Sommers
On Tue, 14 May 2013 04:12:53 +1000, Chris Angelico wrote: > On Tue, May 14, 2013 at 4:02 AM, Skip Montanaro wrote: >>> 8. A programming language is low level when its programs require >>> attention to the irrelevant. >> I think "irrelevant" in this context means stuff like memory >> management.

Re: Python's sad, unimaginative Enum

2013-05-13 Thread Steven D'Aprano
On Mon, 13 May 2013 13:00:36 +0200, Jean-Michel Pichavant wrote: > - Original Message - >> That's the title of this little beast >> http://www.acooke.org/cute/Pythonssad0.html if anybody's interested. >> >> -- >> If you're using GoogleCrap™ please read this >> http://wiki.python.org/moin/

Re: Python for philosophers

2013-05-13 Thread Dave Angel
On 05/13/2013 07:32 PM, Citizen Kant wrote: Am I getting closer to the point? Depends on whom you think you're talking to. Clearly, you've replied to yourself, and top-posted besides. That's not a conversation, it's a monologue. -- DaveA -- http://mail.python.org/mailman/listi

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Dave Angel
On 05/13/2013 07:30 PM, Cameron Simpson wrote: On 13May2013 19:22, Dave Angel wrote: | On 05/13/2013 06:53 PM, Mark Lawrence wrote: | >I much prefer the alternative <> for != but some silly people insisted | >that this be removed from Python3. Just how stupid can you get? | | So which special m

Re: Writing a blog post on the new Enum.

2013-05-13 Thread Ethan Furman
On 05/13/2013 02:44 PM, Fábio Santos wrote: I have followed the process of the new PEP closely, and as such I know that there is a repository containing the reference implementation, a link to which was posted on the python-dev list. Is it okay to link to this repository in my new blog post about

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Ian Kelly
On Mon, May 13, 2013 at 5:27 PM, Andrew Berg wrote: > On 2013.05.13 17:53, Mark Lawrence wrote: >> I much prefer the alternative <> for != but some silly people insisted >> that this be removed from Python3. > It's not removed from Python 3, though: > > Python 3.3.1 (v3.3.1:d9893d13c628, Apr 6 20

Re: Writing a blog post on the new Enum.

2013-05-13 Thread Fábio Santos
On Tue, May 14, 2013 at 12:09 AM, Ethan Furman wrote: > I just checked my settings there, and it looks like you're okay since the > folks reading your blog would just be downloading, not logging and directly > manipulating the repository. > > -- > ~Ethan~ Okay, so I'm good. I'll go ahead and pub

Re: Python for philosophers

2013-05-13 Thread Citizen Kant
I'm amazed with your feedback, even when due to a lack of knowledge I'm not able to discuss some of them. I've been inspecting the stuff about rewriting and that drew my attention to my first intuition of Python being economic. Maybe could it support my impression about a thing thats behind the lan

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Cameron Simpson
On 13May2013 19:22, Dave Angel wrote: | On 05/13/2013 06:53 PM, Mark Lawrence wrote: | >I much prefer the alternative <> for != but some silly people insisted | >that this be removed from Python3. Just how stupid can you get? | | So which special methods should the <> operator call? By rights i

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Andrew Berg
On 2013.05.13 17:53, Mark Lawrence wrote: > I much prefer the alternative <> for != but some silly people insisted > that this be removed from Python3. It's not removed from Python 3, though: Python 3.3.1 (v3.3.1:d9893d13c628, Apr 6 2013, 20:30:21) [MSC v.1600 64 bit (AMD64)] on win32 Type "hel

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Dave Angel
On 05/13/2013 06:53 PM, Mark Lawrence wrote: On 13/05/2013 22:17, Alister wrote: On Mon, 13 May 2013 19:28:29 +0100, Fábio Santos wrote: I think it is more readable. When doing more complicated statements I use != instead, but when it's a single test I prefer not … == It's a personal thing. I

Re: Writing a blog post on the new Enum.

2013-05-13 Thread Mark Lawrence
On 13/05/2013 22:44, Fábio Santos wrote: I have followed the process of the new PEP closely, and as such I know that there is a repository containing the reference implementation, a link to which was posted on the python-dev list. Is it okay to link to this repository in my new blog post about th

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Mark Lawrence
On 13/05/2013 22:17, Alister wrote: On Mon, 13 May 2013 19:28:29 +0100, Fábio Santos wrote: I think it is more readable. When doing more complicated statements I use != instead, but when it's a single test I prefer not … == It's a personal thing. It may also have to do with the fact that I did

Writing a blog post on the new Enum.

2013-05-13 Thread Fábio Santos
I have followed the process of the new PEP closely, and as such I know that there is a repository containing the reference implementation, a link to which was posted on the python-dev list. Is it okay to link to this repository in my new blog post about the Enum, so my readers can try it out? I wil

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Fábio Santos
On Mon, May 13, 2013 at 10:17 PM, Alister wrote: > On Mon, 13 May 2013 19:28:29 +0100, Fábio Santos wrote: > >> I think it is more readable. When doing more complicated statements I >> use != instead, but when it's a single test I prefer not … == >> >> It's a personal thing. It may also have to do

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Alister
On Mon, 13 May 2013 19:28:29 +0100, Fábio Santos wrote: > I think it is more readable. When doing more complicated statements I > use != instead, but when it's a single test I prefer not … == > > It's a personal thing. It may also have to do with the fact that I > didn't know python had != when I

Re: [Off topic] Software epigrams

2013-05-13 Thread Fábio Santos
On 13 May 2013 19:48, "Neil Cerutti" wrote: > > On 2013-05-13, Skip Montanaro wrote: > >> 8. A programming language is low level when its programs > >> require attention to the irrelevant. > >> > >> So much a matter of debate. Indentation is irrelevant, why > >> should Python programs pay attenti

Re: in need of some help regarding my rock paper scissors game

2013-05-13 Thread Denis McMahon
On Sun, 12 May 2013 20:33:44 +0100, Alex Norton wrote: > 'Traceback (most recent call last): File "C:\Users\Me\Desktop\testy.py", > line 174, in bWater.clicked.connect( water_clicked ) AttributeError: > 'int' > object has no attribute 'clicked'' appears when i run the module. It looks to me as if

Re: [Off topic] Software epigrams

2013-05-13 Thread Neil Cerutti
On 2013-05-13, Skip Montanaro wrote: >> 8. A programming language is low level when its programs >> require attention to the irrelevant. >> >> So much a matter of debate. Indentation is irrelevant, why >> should Python programs pay attention to it? Block delimiters >> are irrelevant too, the inter

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Fábio Santos
I think it is more readable. When doing more complicated statements I use != instead, but when it's a single test I prefer not … == It's a personal thing. It may also have to do with the fact that I didn't know python had != when I was a novice. On 13 May 2013 19:08, "Ned Batchelder" wrote: > >

Re: Python for philosophers

2013-05-13 Thread rusi
On May 13, 9:24 pm, Chris Angelico wrote: > > Your final conclusion is of course correct; nothing we build can be > truly infinite. But we can certainly give some very good > approximations, if we're prepared to pay for them. The reality is, > though, that we usually do not want to pay for approxi

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Chris Angelico
On Tue, May 14, 2013 at 4:08 AM, Ned Batchelder wrote: > > On 5/13/2013 1:26 PM, Fábio Santos wrote: > > > On 13 May 2013 11:04, "Alister" wrote: >> this looks to me like an issue with operator precidence >> >> you code is evaluating as (Not x) == y >> rather than not (x == y) > > I can say for s

Re: [Off topic] Software epigrams

2013-05-13 Thread Chris Angelico
On Tue, May 14, 2013 at 4:02 AM, Skip Montanaro wrote: >> 8. A programming language is low level when its programs require >> attention to the irrelevant. >> >> So much a matter of debate. Indentation is irrelevant, why should >> Python programs pay attention to it? Block delimiters are irrelevant

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Ned Batchelder
On 5/13/2013 1:26 PM, Fábio Santos wrote: On 13 May 2013 11:04, "Alister" > wrote: > this looks to me like an issue with operator precidence > > you code is evaluating as (Not x) == y > rather than not (x == y) I can say for sure that the precedence is as ex

Re: [Off topic] Software epigrams

2013-05-13 Thread Skip Montanaro
> 8. A programming language is low level when its programs require > attention to the irrelevant. > > So much a matter of debate. Indentation is irrelevant, why should > Python programs pay attention to it? Block delimiters are irrelevant > too, the interpreter should be able to figure them out fro

Re: [Off topic] Software epigrams

2013-05-13 Thread Chris Angelico
On Mon, May 13, 2013 at 7:20 PM, Steven D'Aprano wrote: > My, it's been a long time since I've seen these: > > http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html > > They pre-date the Zen of Python by at least a decade, and quite frankly I > think many of them miss the mark. But whether yo

Re: Python's sad, unimaginative Enum

2013-05-13 Thread Chris Angelico
On Mon, May 13, 2013 at 8:17 PM, Steven D'Aprano wrote: > Let's look at his major criticisms: > > 1) values aren't automatically generated. > > True. So what? That is the *least* important part of enums. I stopped following the -ideas threads about enums, but IIRC autogeneration of values was in

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Fábio Santos
On 13 May 2013 11:04, "Alister" wrote: > this looks to me like an issue with operator precidence > > you code is evaluating as (Not x) == y > rather than not (x == y) I can say for sure that the precedence is as expected. I always use "not ... == ..." Instead of !=. -- http://mail.python.org/mai

Re: [Chicago] Getting ASCII encoding where unicode wanted under Py3k

2013-05-13 Thread Carl Karsten
On Mon, May 13, 2013 at 10:59 AM, Jonathan Hayward wrote: That is way too much code for me to try and dig into. Remove everything not needed to demo it. Replace big strings with little strings. My guess is it should be 1-3 lines, like >>> print('123%(a)s' % {'a': u'\u0161' } ) 123š But that

Re: Getting ASCII encoding where unicode wanted under Py3k

2013-05-13 Thread MRAB
On 13/05/2013 16:59, Jonathan Hayward wrote: I have a Py3k script, pasted below. When I run it I get an error about ASCII codecs that can't handle byte values that are too high. The error that I am getting is: |UnicodeEncodeError: 'ascii' codec can't encode character'\u0161' in position 1442

Re: Getting ASCII encoding where unicode wanted under Py3k

2013-05-13 Thread Peter Pearson
On Mon, 13 May 2013 10:59:33 -0500, Jonathan Hayward wrote: > --e89a8f3b9db145cbab04dc9b9a23 > Content-Type: text/plain; charset=windows-1252 > Content-Transfer-Encoding: quoted-printable > [snipped many lines of quoted-printable muck] > My code is below. What should I be doing differently to be,

Re: Python for philosophers

2013-05-13 Thread Chris Angelico
On Tue, May 14, 2013 at 12:53 AM, rusi wrote: > int fact(int n, int acc) > { > return !n? acc : fact(n-1,acc*n); > } > - > When I run these, the C happily keeps giving answers until a million > > However examined closely we find that though the C is giving answers

Re: global variable not working inside function. Increment

2013-05-13 Thread Andreas Perstinger
"feather.duster.kung.fu" wrote: >I'm just learning Python and NONE of the tutorials I read said >anything about that . In fact they all say a global can be called from >inside a Function. If possible please contact the ppl that write these >things. Well, we don't know which tutorials you read. So

Getting ASCII encoding where unicode wanted under Py3k

2013-05-13 Thread Jonathan Hayward
I have a Py3k script, pasted below. When I run it I get an error about ASCII codecs that can't handle byte values that are too high. The error that I am getting is: UnicodeEncodeError: 'ascii' codec can't encode character '\u0161' in position 1442: ordinal not in range(128) args = ('ascii',

Re: global variable not working inside function. Increment

2013-05-13 Thread Jean-Michel Pichavant
> Thank You for setting that straight. I'm just learning Python and > NONE of the tutorials I read said anything about that . In fact they > all say a global can be called from inside a Function. If possible > please contact the ppl that write these things.I've heard of > Ocam's razor but not H

Re: [Off topic] Software epigrams

2013-05-13 Thread mar...@python.net
On Mon, May 13, 2013, at 05:20 AM, Steven D'Aprano wrote: > My, it's been a long time since I've seen these: > > http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html > > They pre-date the Zen of Python by at least a decade, and quite frankly I > think many of them miss the mark. But whet

Re: Python for philosophers

2013-05-13 Thread rusi
On May 13, 7:41 am, Steven D'Aprano wrote: > Python is not well-modelled as a Finite State Machine. Python is > equivalent in computing power to a Turing Machine, while Finite State > Machines are much weaker, so there are things that Python can do that a > FSM cannot. Consider the following. Py

Re: Python for philosophers

2013-05-13 Thread Grant Edwards
On 2013-05-13, Steven D'Aprano wrote: > Your premise that Python tries to be "economical" is incorrect. If > anything, Python is the opposite: it is often profligate with resources > (memory mostly) in order to save the human programmer time and effort. IOW, Python is designed to be economical,

Re: global variable not working inside function. Increment

2013-05-13 Thread feather.duster.kung.fu
On Monday, May 13, 2013 7:10:50 AM UTC-7, charles benoit wrote: > On Friday, September 4, 2009 4:52:11 PM UTC-7, Rami Chowdhury wrote: > > > > global no_picked > > > > no_picked = 0 > > > > > > > > def picked(object, event): > > > > no_picked += 1 > > > > print

Re: global variable not working inside function. Increment

2013-05-13 Thread charles benoit
On Friday, September 4, 2009 4:52:11 PM UTC-7, Rami Chowdhury wrote: > > global no_picked > > no_picked = 0 > > > > def picked(object, event): > > no_picked += 1 > > print no_picked > > In order to be able to affect variables in the global scope, you need to > dec

Re: global variable not working inside function. Increment

2013-05-13 Thread feather . duster . kung . fu
On Friday, September 4, 2009 4:43:27 PM UTC-7, Helvin wrote: > Hi, > > This increment thing is driving me nearly to the nuts-stage. > < > > I have a function that allows me to pick points. I want to count the > number of times I have picked points. > > global no_picked > no_picked = 0 >

Re: Python for philosophers

2013-05-13 Thread Neil Cerutti
On 2013-05-13, Steven D'Aprano wrote: > I'm not trying to beat the original Poster up for making an > error, but demonstrating just how badly off track you can get > by trying to reason from first principles (as Plato may have > done) instead of empirical study (as Aristotle or Bacon may > have do

Re: object.enable() anti-pattern

2013-05-13 Thread Wayne Werner
On Mon, 13 May 2013, Greg Ewing wrote: Wayne Werner wrote: On Fri, 10 May 2013, Gregory Ewing wrote: f = open("myfile.dat") f.close() data = f.read() To clarify - you don't want a class that has functions that need to be called in a certain order with *valid input* in order to not cr

Re: Python's sad, unimaginative Enum

2013-05-13 Thread Jean-Michel Pichavant
- Original Message - > That's the title of this little beast > http://www.acooke.org/cute/Pythonssad0.html if anybody's interested. > > -- > If you're using GoogleCrap™ please read this > http://wiki.python.org/moin/GoogleGroupsPython. > > Mark Lawrence > > -- > http://mail.python.org/ma

Re: Python's sad, unimaginative Enum

2013-05-13 Thread Steven D'Aprano
On Mon, 13 May 2013 10:24:40 +0100, Mark Lawrence wrote: > That's the title of this little beast > http://www.acooke.org/cute/Pythonssad0.html if anybody's interested. Well, that's one way of looking at it. And I can't exactly *disagree*. But... but... In many ways, it's a dull language, b

Re: Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-13 Thread Alister
On Mon, 13 May 2013 05:23:16 +0600, Mr. Joe wrote: > I seem to stumble upon a situation where "!=" operator misbehaves in > python2.x. Not sure if it's my misunderstanding or a bug in python > implementation. Here's a demo code to reproduce the behavior - > """ > # -*- coding: utf-8 -*- > from __f

[Off topic] Software epigrams

2013-05-13 Thread Steven D'Aprano
My, it's been a long time since I've seen these: http://pu.inf.uni-tuebingen.de/users/klaeren/epigrams.html They pre-date the Zen of Python by at least a decade, and quite frankly I think many of them miss the mark. But whether you agree or disagree with them, they're worth reading. -- Stev

Python's sad, unimaginative Enum

2013-05-13 Thread Mark Lawrence
That's the title of this little beast http://www.acooke.org/cute/Pythonssad0.html if anybody's interested. -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for philosophers

2013-05-13 Thread alex23
On May 13, 5:13 pm, Steven D'Aprano wrote: > I'm not trying to beat the original Poster up for making an error, but > demonstrating just how badly off track you can get by trying to reason > from first principles (as Plato may have done) instead of empirical study > (as Aristotle or Bacon may have

Re: Message passing syntax for objects | OOPv2

2013-05-13 Thread Fábio Santos
Sounds a lot like reddit threads. On 13 May 2013 08:17, "Mark Janssen" wrote: > On Sun, May 12, 2013 at 10:18 AM, Ned Batchelder > wrote: > > I've never understood why people use that site: the pages end up being > > unintelligible cocktail-party noise-scapes with no hope of understanding > who

How to make shutil.make_archive support symbol links?

2013-05-13 Thread zcbenz
Hi comp.lang.python group, I'm trying to make a zip archive with shutil.make_archive, but it seems that it doesn't support symbol links, after creating a archive with shutil.make_archive, all the symbol links would be lost. What I want is something like `zip -y`, which "stores symbolic links as

Re: object.enable() anti-pattern

2013-05-13 Thread Fábio Santos
On 13 May 2013 08:40, "Chris Angelico" wrote: > > On Mon, May 13, 2013 at 4:32 PM, Fábio Santos wrote: > > > > On 13 May 2013 00:22, "Greg Ewing" wrote: > >> The same argument can be applied to: > >> > >>foo = Foo() > >>foo.do_something() > >>foo.enable() # should have done this firs

Re: in need of some help...

2013-05-13 Thread Gregory Ewing
Dennis Lee Bieber wrote: Is that the accepted group noun? I'd think a "crisis of Chrises" is more alliterative... A "confusion of Chrises" might be more appropriate in this case. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: object.enable() anti-pattern

2013-05-13 Thread Chris Angelico
On Mon, May 13, 2013 at 4:32 PM, Fábio Santos wrote: > > On 13 May 2013 00:22, "Greg Ewing" wrote: >> The same argument can be applied to: >> >>foo = Foo() >>foo.do_something() >>foo.enable() # should have done this first >> >> You're passing an invalid input to Foo.do_something, >> n

Re: Python for philosophers

2013-05-13 Thread Steven D'Aprano
Some further details on something mentioned about Python being "economical". On Sun, 12 May 2013 16:17:02 +0200, Citizen Kant wrote: > For example: I'm plainly aware that the word "python" looks shorten than > "0111 0001 01110100 01101000 0110 01101110". But it's > shorten just for m

Re: Message passing syntax for objects | OOPv2

2013-05-13 Thread Fábio Santos
On 12 May 2013 18:23, "Ned Batchelder" wrote: > > I've never understood why people use that site: the pages end up being unintelligible cocktail-party noise-scapes with no hope of understanding who is saying what, or in response to whom. > > --Ned. There's not so much noise there, but indeed the

Re: Message passing syntax for objects | OOPv2

2013-05-13 Thread Mark Janssen
On Sun, May 12, 2013 at 10:18 AM, Ned Batchelder wrote: > I've never understood why people use that site: the pages end up being > unintelligible cocktail-party noise-scapes with no hope of understanding who > is saying what, or in response to whom. You're very right. But that is what has made i