Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 9:17:48 AM UTC+5:30, Ian wrote: > On Tue, May 12, 2015 at 9:11 PM, zipher wrote: > > I know. That's because most people have fallen off the path > > (http://c2.com/cgi/wiki?OneTruePath). > > You wrote that, didn't you? I recognize that combination of delusional > n

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 11:47:19 AM UTC+5:30, Chris Angelico wrote: > On Wed, May 13, 2015 at 3:56 PM, Rustom Mody wrote: > >> Yep. I'd also use clear function/procedure names to make it more > >> visible, and probably tie this in with loops to show how you can print > >> more than one thing

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 3:56 PM, Rustom Mody wrote: >> Yep. I'd also use clear function/procedure names to make it more >> visible, and probably tie this in with loops to show how you can print >> more than one thing but can only return one. (Generators are a more >> advanced topic.) > > [Structur

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 10:25:18 AM UTC+5:30, Chris Angelico wrote: > On Wed, May 13, 2015 at 11:14 AM, Steven D'Aprano wrote: > > On Wed, 13 May 2015 02:05 am, Chris Angelico wrote: > > > >> So if you're writing a library function, it probably shouldn't use > >> print()... but your applicati

Re: urllib2.urlopen error "socket.error: [Errno 104] Connection reset by peer"

2015-05-12 Thread dieter
"Jia CHEN" writes: > I have the error below when trying to download the html content of a webpage. > I can open this webpage in a browser without any problem. "Connection reset by peer" means that the other side (the HTTP server in your case) has closed the connection. It may have looked at th

Re: uPy Unicode [was Re: Instead of deciding between Python or Lisp blah blah blah]

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 11:23 AM, Steven D'Aprano wrote: > On Wed, 13 May 2015 03:26 am, Chris Angelico wrote: > >> back when MicroPython was debating the implementation of Unicode >> strings, there was a lengthy discussion on python-dev about whether >> it's okay for string subscripting to be O(n

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 11:14 AM, Steven D'Aprano wrote: > On Wed, 13 May 2015 02:05 am, Chris Angelico wrote: > >> So if you're writing a library function, it probably shouldn't use >> print()... but your application is most welcome to. You usually know >> which one you're writing at any given ti

Re: anomaly

2015-05-12 Thread Steven D'Aprano
On Wednesday 13 May 2015 02:22, Skip Montanaro wrote: > I did find this interesting blog post about encapsulation and > test-driven development: > > https://jasonmbaker.wordpress.com/2009/01/08/enemies-of-test-driven- development-part-i-encapsulation/ > > I found the author's perspective interes

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Ian Kelly
On Tue, May 12, 2015 at 9:11 PM, zipher wrote: > I know. That's because most people have fallen off the path > (http://c2.com/cgi/wiki?OneTruePath). You wrote that, didn't you? I recognize that combination of delusional narcissism and curious obsession with Turing machines. > You haven't done

Re: anomaly

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 10:43:44 AM UTC-5, Chris Angelico wrote: > On Wed, May 13, 2015 at 1:34 AM, zipher wrote: > > Name one "significant and important" use case for shadowing built-in types. > > Functions, I don't have a problem with, but types are more fundamental > > than functions. >

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 8:00:50 AM UTC+5:30, Steven D'Aprano wrote: > Why can't a language be designed with a *practical and concrete* need in > mind? As far as I know, only one language designed from theoretical first > principles has had any measure of mainstream success, Lisp, and that was

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 9:30:50 PM UTC-5, Steven D'Aprano wrote: > On Wed, 13 May 2015 08:00 am, zipher wrote: > > > Everyone gets it wrong and now we have a plethora of languages which all > > do the same thing, without really knowing what they want as an overarching > > design or purpose. >

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 5:24:34 PM UTC-5, Marko Rauhamaa wrote: > zipher : > > > That is why you have very high-level languages that allow you to > > rapidly prototype ideas, test them, and then, depending all the other > > constraints, move them to lower-level language implementations. > > F

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 1:22:55 PM UTC-5, Mark Lawrence wrote: > On 12/05/2015 18:35, Rustom Mody wrote: > > On Tuesday, May 12, 2015 at 8:48:13 PM UTC+5:30, zipher wrote: > >> > >> I/O is an essential part of computing in the West. (I'll leave Symbolics > >> out of of that category.) It sta

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 8:15:07 PM UTC-5, Steven D'Aprano wrote: > On Wed, 13 May 2015 02:05 am, Chris Angelico wrote: > > > So if you're writing a library function, it probably shouldn't use > > print()... but your application is most welcome to. You usually know > > which one you're writing

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Paul Rubin
Steven D'Aprano writes: > As far as I know, only one language designed from theoretical first > principles has had any measure of mainstream success, Lisp, APL was cool back in the day too. -- https://mail.python.org/mailman/listinfo/python-list

Re: anomaly

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 7:47:03 AM UTC+5:30, Paul Rubin wrote: > Rustom Mody writes: > > You made TRUE into FALSE!! > > The answer is: yes! Haskell can do that. > >Prelude> let 2+2=5 in 2+2 >5 :-) And we come back to the OP. It *looks* like this is some profound question about O

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Steven D'Aprano
On Wed, 13 May 2015 08:00 am, zipher wrote: > Everyone gets it wrong and now we have a plethora of languages which all > do the same thing, without really knowing what they want as an overarching > design or purpose. Why must a language be designed with some "overarching design or purpose"? Why

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Steven D'Aprano
On Wed, 13 May 2015 04:18 am, Ned Batchelder wrote: > On Tuesday, May 12, 2015 at 2:03:04 PM UTC-4, Rob Gaddi wrote: [...] >> B) If I can't manage that, what's the etiquette behind having later >> versions of a module break compatibility with older versions of Python. >> I've avoided using feature

Re: anomaly

2015-05-12 Thread Paul Rubin
Rustom Mody writes: > You made TRUE into FALSE!! The answer is: yes! Haskell can do that. Prelude> let 2+2=5 in 2+2 5 -- https://mail.python.org/mailman/listinfo/python-list

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 6:45:07 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 13 May 2015 02:05 am, Chris Angelico wrote: > > > So if you're writing a library function, it probably shouldn't use > > print()... but your application is most welcome to. You usually know > > which one you're wri

uPy Unicode [was Re: Instead of deciding between Python or Lisp blah blah blah]

2015-05-12 Thread Steven D'Aprano
On Wed, 13 May 2015 03:26 am, Chris Angelico wrote: > back when MicroPython was debating the implementation of Unicode > strings, there was a lengthy discussion on python-dev about whether > it's okay for string subscripting to be O(n) instead of O(1), and the > final decision was that yes, that's

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Steven D'Aprano
On Wed, 13 May 2015 02:05 am, Chris Angelico wrote: > So if you're writing a library function, it probably shouldn't use > print()... but your application is most welcome to. You usually know > which one you're writing at any given time. You might be, but beginners are not. I'm not sure I accept

Re: anomaly

2015-05-12 Thread Rustom Mody
On Wednesday, May 13, 2015 at 6:17:41 AM UTC+5:30, John Ladasky wrote: > On Monday, May 11, 2015 at 3:16:16 AM UTC-7, Antoon Pardon wrote: > > > Try overriding None, True or False in python3 and see what happens. > > Much fun was able to be had in Python 2, though: > > Python 2.7.6 (default,

Re: anomaly

2015-05-12 Thread John Ladasky
On Monday, May 11, 2015 at 3:16:16 AM UTC-7, Antoon Pardon wrote: > Try overriding None, True or False in python3 and see what happens. Much fun was able to be had in Python 2, though: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "cre

Re: anomaly

2015-05-12 Thread Gregory Ewing
Antoon Pardon wrote: But that doesn't answer the question why the developers chose "True" to be a keyword and "int" to be a looked-up name. Probably because True, False and None are very frequently used constants. Making them keywords means that things like 'while True:' don't incur the overhea

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Ben Finney
Rob Gaddi writes: > On Wed, 13 May 2015 08:35:02 +1000, Ben Finney wrote: > > > Rob Gaddi writes: > > > >> B) If I can't manage that, what's the etiquette behind having later > >> versions of a module break compatibility with older versions of > >> Python. > > > > Consult your user community,

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Rob Gaddi
On Wed, 13 May 2015 08:35:02 +1000, Ben Finney wrote: > Rob Gaddi writes: > >> B) If I can't manage that, what's the etiquette behind having later >> versions of a module break compatibility with older versions of Python. > > Consult your user community, tell them the issue (maintaining obsolet

Re: itertools py3.4 - filter list using not equal - fails as bool

2015-05-12 Thread MRAB
On 2015-05-12 23:43, Sayth Renshaw wrote: why can't I filter a list based on an itertools condition using dropwhile? This is the docs and the example. https://docs.python.org/3/library/itertools.html#itertools.dropwhile def less_than_10(x): return x < 10 itertools.takewhile(less_than_10,

itertools py3.4 - filter list using not equal - fails as bool

2015-05-12 Thread Sayth Renshaw
why can't I filter a list based on an itertools condition using dropwhile? This is the docs and the example. https://docs.python.org/3/library/itertools.html#itertools.dropwhile def less_than_10(x): return x < 10 itertools.takewhile(less_than_10, itertools.count()) => 0, 1, 2, 3, 4, 5, 6,

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Ben Finney
Rob Gaddi writes: > A) Is there any easy way to test against an older version of Python? The convention today is to use Tox for testing one code base using multiple Python impleemntations, in a single test run. https://pypi.python.org/pypi/tox> > Preferably without trying to install entire

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Marko Rauhamaa
zipher : > That is why you have very high-level languages that allow you to > rapidly prototype ideas, test them, and then, depending all the other > constraints, move them to lower-level language implementations. Finally an argument to tackle. That rapid prototyping role is often mentioned as a

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 12:57:48 PM UTC-5, Rustom Mody wrote: > On Tuesday, May 12, 2015 at 10:45:39 PM UTC+5:30, Stefan Ram wrote: > > Rob Gaddi writes: > > >Is that a true array or a linked list? "It's a high level language, > > >that's just an implementation detail." Yes, but it's an imple

Re: Suggestion: PEP for tracking vulnerable packages within PyPI

2015-05-12 Thread Mark Lawrence
On 12/05/2015 22:56, Grant Murphy wrote: Please don't top post here it's extremely irritating. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Suggestion: PEP for tracking vulnerable packages within PyPI

2015-05-12 Thread Grant Murphy
Ok so.. no PEP needed then..alright then... my plan now goes something like this: 0. Send this email. 1. Unsubscribe from the python-list. (I don't enjoy the company of trolls). 2. Actually fix the problem and submit a PR. 3. Go have a beer. Apologies for the multiple emails. I can see how Mark

Re: Python file structure

2015-05-12 Thread Terry Reedy
On 5/12/2015 3:49 PM, Ned Batchelder wrote: On Tuesday, May 12, 2015 at 3:13:32 PM UTC-4, zljubi...@gmail.com wrote: Hi, I have python file with the following structure: import... A = configparser.get(...) B = configparser.get(...) Command line parameters parsing [they can change variable A o

Re: Suggestion: PEP for tracking vulnerable packages within PyPI

2015-05-12 Thread Tim Golden
On 12/05/2015 22:17, Mark Lawrence wrote: On 12/05/2015 20:46, Grant Murphy wrote: Hi, When pulling in a dependency via pip it is currently difficult to reason about whether there are any vulnerabilities associated with the package version you are using. I think the Python package management

Re: Suggestion: PEP for tracking vulnerable packages within PyPI

2015-05-12 Thread Mark Lawrence
On 12/05/2015 20:46, Grant Murphy wrote: Hi, When pulling in a dependency via pip it is currently difficult to reason about whether there are any vulnerabilities associated with the package version you are using. I think the Python package management infrastructure could be extended to facilitat

Re: Python file structure

2015-05-12 Thread Dave Angel
On 05/12/2015 03:58 PM, zljubisic...@gmail.com wrote: On Tuesday, May 12, 2015 at 9:49:20 PM UTC+2, Ned Batchelder wrote: If you need to use globals, assign them inside a parse_arguments function that has a "global" statement in it. This advice is consistent with Chris' "define things before

Re: Suggestion: PEP for tracking vulnerable Python packages

2015-05-12 Thread Andres Riancho
Grant, On Tue, May 12, 2015 at 5:16 PM, Grant Murphy wrote: > Hi, > > When pulling in a dependency via pip it is currently difficult to reason about > whether there are any vulnerabilities associated with the package version you > are using. I think the Python package management infrastructure co

Re: anomaly

2015-05-12 Thread Terry Reedy
On 5/12/2015 9:56 AM, Steven D'Aprano wrote: The consensus among the core developers is: * in general, the harm and inconvenience from accidentally shadowing built-ins is not great, and it usually easy to spot, debug and prevent; * when it comes to built-in functions (e.g. sum, map, pow)

Suggestion: PEP for tracking vulnerable Python packages

2015-05-12 Thread Grant Murphy
Hi, When pulling in a dependency via pip it is currently difficult to reason about whether there are any vulnerabilities associated with the package version you are using. I think the Python package management infrastructure could be extended to facilitate this capability reasonably easily. PyPI a

Suggestion: PEP for tracking vulnerable Python packages

2015-05-12 Thread Grant Murphy
Hi, When pulling in a dependency via pip it is currently difficult to reason about whether there are any vulnerabilities associated with the package version you are using. I think the Python package management infrastructure could be extended to facilitate this capability reasonably easily. PyPI a

Suggestion: PEP for tracking vulnerable packages within PyPI

2015-05-12 Thread Grant Murphy
Hi, When pulling in a dependency via pip it is currently difficult to reason about whether there are any vulnerabilities associated with the package version you are using. I think the Python package management infrastructure could be extended to facilitate this capability reasonably easily. PyPI a

Re: Feature Request: Reposition Execution

2015-05-12 Thread Skybuck Flying
"Dave Angel" wrote in message news:mailman.354.1431345441.12865.python-l...@python.org... On 05/11/2015 07:46 AM, Skybuck Flying wrote: Hello, Sometimes it can be handy to "interrupt/reset/reposition" a running script. For example something externally goes badly wrong. " os.kill() then

Re: Python file structure

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 5:54 AM, Ian Kelly wrote: > Also, I like to put command-line parsing inside the main function and > make that its *only* responsibility. The main function then calls the > real entry point of my script, which will be something more > specifically named. This also has the ad

Re: Python file structure

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 5:49 AM, Ned Batchelder wrote: > I would put all of the code into a function some place. Don't have > anything at the top level of the file except imports, function (and > class) definitions, and an "if __name__." clause at the bottom. > > If you need to use globals, a

Re: Python file structure

2015-05-12 Thread zljubisicmob
On Tuesday, May 12, 2015 at 9:49:20 PM UTC+2, Ned Batchelder wrote: > On Tuesday, May 12, 2015 at 3:13:32 PM UTC-4, zljubi...@gmail.com wrote: > > Hi, I have python file with the following structure: > > > > import... > > > > A = configparser.get(...) > > B = configparser.get(...) > > > > Comma

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Marko Rauhamaa
Chris Angelico : > That's as may be, but I would still not recommend [C] as a first > language. I think the field can be approached from many angles successfully. And any approach will fail many students. The nice thing about C is that your feet are firmly on the ground. There's little magic. Yo

Re: Python file structure

2015-05-12 Thread Ian Kelly
On Tue, May 12, 2015 at 1:29 PM, Chris Angelico wrote: > On Wed, May 13, 2015 at 5:13 AM, wrote: >> If I find an error in command line parameters section I cannot call function >> usage() because it is not defined yet. >> >> I have few options here: >> 1. Put definition of usage function b

Re: Python file structure

2015-05-12 Thread Ned Batchelder
On Tuesday, May 12, 2015 at 3:13:32 PM UTC-4, zljubi...@gmail.com wrote: > Hi, I have python file with the following structure: > > import... > > A = configparser.get(...) > B = configparser.get(...) > > Command line parameters parsing [they can change variable A or B] > > Def usage() >

Re: Python file structure

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 5:13 AM, wrote: > import... > > A = configparser.get(...) > B = configparser.get(...) > > Command line parameters parsing [they can change variable A or B] > > Def usage() > Print how to use script parameters > > def main(): > ... > > if __name__ == "__main

Python file structure

2015-05-12 Thread zljubisicmob
Hi, I have python file with the following structure: import... A = configparser.get(...) B = configparser.get(...) Command line parameters parsing [they can change variable A or B] Def usage() Print how to use script parameters def main(): ... if __name__ == "__main__": m

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-12 Thread zljubisicmob
I would say so as well. Thanks to everyone who helped. Regards and best wishes. -- https://mail.python.org/mailman/listinfo/python-list

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Ned Batchelder
On Tuesday, May 12, 2015 at 2:41:51 PM UTC-4, Albert-Jan Roskam wrote: > - > On Tue, May 12, 2015 8:01 PM CEST Rob Gaddi wrote: > > >So I've got a package I put up on PyPi a while back (ctypes-bitfield, if > >it matters). For version 0.2.6 I had access to some older v

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Albert-Jan Roskam via Python-list
- On Tue, May 12, 2015 8:01 PM CEST Rob Gaddi wrote: >So I've got a package I put up on PyPi a while back (ctypes-bitfield, if >it matters). For version 0.2.6 I had access to some older versions of >Python and was able to run my test suite on Python 2.6 and 3.0. > >

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Mark Lawrence
On 12/05/2015 18:35, Rustom Mody wrote: On Tuesday, May 12, 2015 at 8:48:13 PM UTC+5:30, zipher wrote: I/O is an essential part of computing in the West. (I'll leave Symbolics out of of that category.) It started with switches and lights, so what kind of bullshit is saying that you should g

Re: Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Ned Batchelder
On Tuesday, May 12, 2015 at 2:03:04 PM UTC-4, Rob Gaddi wrote: > So I've got a package I put up on PyPi a while back (ctypes-bitfield, if > it matters). For version 0.2.6 I had access to some older versions of > Python and was able to run my test suite on Python 2.6 and 3.0. > > Well, I don't h

Re: anomaly

2015-05-12 Thread Ian Kelly
On Tue, May 12, 2015 at 9:34 AM, zipher wrote: >> * when it comes to built-in functions (e.g. sum, map, pow) >> and types (e.g. int, str, list) there are significant and >> important use-cases for allowing shadowing; > > Name one "significant and important" use case for shadowing built-in type

Updating a package on PyPi, testing and etiquette

2015-05-12 Thread Rob Gaddi
So I've got a package I put up on PyPi a while back (ctypes-bitfield, if it matters). For version 0.2.6 I had access to some older versions of Python and was able to run my test suite on Python 2.6 and 3.0. Well, I don't have them anymore. I've got no access right now to anything older than 2

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Tuesday, May 12, 2015 at 10:45:39 PM UTC+5:30, Stefan Ram wrote: > Rob Gaddi writes: > >Is that a true array or a linked list? "It's a high level language, > >that's just an implementation detail." Yes, but it's an implementation > >detail that determines whether even the simple act of lookin

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Tuesday, May 12, 2015 at 8:48:13 PM UTC+5:30, zipher wrote: > On Tuesday, May 12, 2015 at 4:16:31 AM UTC-5, Rustom Mody wrote: > > On Tuesday, May 12, 2015 at 12:27:44 PM UTC+5:30, Chris Angelico wrote: > > > On Tue, May 12, 2015 at 4:42 PM, Rustom Mody wrote: > > > > And related to that (and o

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 3:15 AM, Stefan Ram wrote: > Rob Gaddi writes: >>Is that a true array or a linked list? "It's a high level language, >>that's just an implementation detail." Yes, but it's an implementation >>detail that determines whether even the simple act of looking up element >>n is

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 3:03 AM, Rob Gaddi wrote: > A firm grasp of C will make you a better programmer in any language, even > if you haven't written a line of it in 20 years. It's the ability to > read a map. A lack of C is the person blindly following their GPS and > hoping for the best. Tha

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rob Gaddi
On Tue, 12 May 2015 08:11:25 -0700, zipher wrote: > On Monday, May 11, 2015 at 9:04:24 PM UTC-5, Steven D'Aprano wrote: >> On Tue, 12 May 2015 05:01 am, beliav...@aol.com wrote: >> >> > Yale has taken the unusual step of outsourcing its introductory CS >> > class to Harvard, which uses C as the m

Re: How to properly apply OOP in the bouncing ball code

2015-05-12 Thread Oscar Benjamin
On 11 May 2015 at 16:22, Tommy C wrote: > Thanks for your help. > > I have updated the code as follows, there are no more errors but the images > will not move at all, as all the images are staying at the upper left corner. > Please advice, thanks. > > > import sys, pygame > > pygame.init() > >

Re: anomaly

2015-05-12 Thread Skip Montanaro
On Tue, May 12, 2015 at 10:34 AM, zipher wrote: >> The general principle here is of consenting adults: Python allows you to >> shadow built-ins because sometimes it is useful, and the good outweighs the >> potential harm. > > I think you'll have to give examples, either from the developer communit

Re: anomaly

2015-05-12 Thread Mark Lawrence
On 12/05/2015 16:43, Chris Angelico wrote: On Wed, May 13, 2015 at 1:34 AM, zipher wrote: On Tuesday, May 12, 2015 at 8:56:32 AM UTC-5, Steven D'Aprano wrote: * when it comes to built-in functions (e.g. sum, map, pow) and types (e.g. int, str, list) there are significant and important us

Re: anomaly

2015-05-12 Thread Gary Herron
On 05/12/2015 04:55 AM, Antoon Pardon wrote: Op 11-05-15 om 16:13 schreef Chris Angelico: Why does Python have most built-ins as simply looked-up names that can be overridden? Because otherwise, there would be a veritable ton of keywords: But that doesn't answer the question why the developers

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 1:53 AM, Stefan Ram wrote: > zipher writes: >>so what kind of bullshit is saying that you should get rid of PRINT? > > What might be reasonable is to be able to dissect a program > into functions, and have no effects in functions that are > there to calculate some va

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Mark Lawrence
On 12/05/2015 07:42, Rustom Mody wrote: And related to that (and one reason a pure functional language is good for pedagogy): NO PRINT statement It may seem trivial but beginning students have a real hard writing clean structured code. Tabooing prints helps get there faster And working in the i

Re: How to properly apply OOP in the bouncing ball code

2015-05-12 Thread Terry Reedy
On 5/11/2015 8:42 PM, zipher wrote: On Monday, May 11, 2015 at 7:25:09 PM UTC-5, Dennis Lee Bieber wrote: On Mon, 11 May 2015 08:33:56 -0700 (PDT), zipher declaimed the following: You are making a error that few in the programming community have caught up to. OOP design for *data abstraction

Re: anomaly

2015-05-12 Thread Chris Angelico
On Wed, May 13, 2015 at 1:34 AM, zipher wrote: > On Tuesday, May 12, 2015 at 8:56:32 AM UTC-5, Steven D'Aprano wrote: >> * when it comes to built-in functions (e.g. sum, map, pow) >> and types (e.g. int, str, list) there are significant and >> important use-cases for allowing shadowing; > > Na

problem while using os.walk with utf-8 characters

2015-05-12 Thread Thierry GAYET
Hi, I'm using the os.walk function for parsing files from an external mass-storage such as usbkey. When i try the following code, i have an error: from __future__ import unicode_literals import sys reload(sys) sys.setdefaultencoding('utf_8') for dirname, dirnames, filenames in os.walk(os.path

Re: anomaly

2015-05-12 Thread Grant Edwards
On 2015-05-12, alex23 wrote: > On 12/05/2015 1:39 AM, zipher wrote: >> On Monday, May 11, 2015 at 10:34:24 AM UTC-5, Grant Edwards wrote: >>> That Python, like COBOL, is an eminently practical language. >> >> LOL! Good one. > > I would make an incredibly substantial wager that you've never develo

Re: anomaly

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 8:56:32 AM UTC-5, Steven D'Aprano wrote: > The consensus among the core developers is: > * in general, the harm and inconvenience from accidentally > shadowing built-ins is not great, and it usually easy to > spot, debug and prevent; Where is that the consensus? Pl

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Tuesday, May 12, 2015 at 4:16:31 AM UTC-5, Rustom Mody wrote: > On Tuesday, May 12, 2015 at 12:27:44 PM UTC+5:30, Chris Angelico wrote: > > On Tue, May 12, 2015 at 4:42 PM, Rustom Mody wrote: > > > And related to that (and one reason a pure functional language is good for > > > pedagogy): NO PR

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread zipher
On Monday, May 11, 2015 at 9:04:24 PM UTC-5, Steven D'Aprano wrote: > On Tue, 12 May 2015 05:01 am, beliav...@aol.com wrote: > > > Yale has taken the unusual step of outsourcing its introductory CS class > > to Harvard, which uses C as the main language in its CS50 class. > > And another generati

Re: anomaly

2015-05-12 Thread Steven D'Aprano
On Tue, 12 May 2015 09:55 pm, Antoon Pardon wrote: > Op 11-05-15 om 16:13 schreef Chris Angelico: > >> Why does Python have most built-ins as simply looked-up names that can >> be overridden? Because otherwise, there would be a veritable ton of >> keywords: > > But that doesn't answer the questi

[ANN] OpenStack Collective Conference in Austin, TX, Aug 13-14, 2015

2015-05-12 Thread Jim Freeze
OpenStack Collective Conference (OSCC) is a two day, single track conference that will take place in exciting Austin, Texas on August 13-14, 2015. https://openstackcollective.com/ OpenStack Collective caters to Developers and Operators and will provide attendees with two days of learning and comm

Re: MySQL connection over SSH

2015-05-12 Thread chrismeek4542
(2003, "Can't connect to MySQL server on 'mcsdev.croft-it.com' (60)") -- https://mail.python.org/mailman/listinfo/python-list

MySQL connection over SSH

2015-05-12 Thread chrismeek4542
I am trying to connect to a remote MySQL Database over SSH. I am using paramiko and SQLAlchemy. I assume that my sqlalchemy engine is not going through the SSH tunnel. Here is what i have so far. Not sure where to go from here though. import paramiko from sqlalchemy import create_engine ssh = p

Re: Running cool and silent

2015-05-12 Thread Skip Montanaro
On Tue, May 12, 2015 at 4:33 AM, Rustom Mody wrote: > $ echo "min_power" | sudo tee > /sys/class/scsi_host/host*/link_power_management_policy > > makes the fan slow/stop. > > But I am not sure what it does!! My guess is it lowers the clock speed. To bring this into the realm of Python, here's so

Re: ANN: eGenix PyRun - One file Python Runtime 2.1.0

2015-05-12 Thread Cristiano Cortezia
On Monday, May 11, 2015 at 8:59:22 AM UTC-3, eGenix Team: M.-A. Lemburg wrote: > > > ANNOUNCING > > eGenix PyRun - One file Python Runtime > > Version 2.1.0 > > > An e

Re: anomaly

2015-05-12 Thread Antoon Pardon
Op 11-05-15 om 17:44 schreef Steven D'Aprano: > On Mon, 11 May 2015 11:27 pm, Antoon Pardon wrote: > >> The point is that all too often someone wants to defend a specific choice >> the developers have made and cites some general rule or principle in >> support, ignoring the fact that python breaks

Re: smart scheduling for webapp tester

2015-05-12 Thread Fetchinson .
On 5/12/15, Chris Angelico wrote: > On Tue, May 12, 2015 at 6:31 AM, Fetchinson . > wrote: >> I'm looking into a robust solution for web application testing. While >> selenium is great for the actual testing, I'm thinking of a scheduler >> as the final piece in the pipeline. Let's say I have 4 we

Re: anomaly

2015-05-12 Thread Mark Lawrence
On 12/05/2015 06:02, alex23 wrote: On 12/05/2015 1:39 AM, zipher wrote: On Monday, May 11, 2015 at 10:34:24 AM UTC-5, Grant Edwards wrote: That Python, like COBOL, is an eminently practical language. LOL! Good one. I would make an incredibly substantial wager that you've never developed an

Re: anomaly

2015-05-12 Thread Antoon Pardon
Op 11-05-15 om 16:13 schreef Chris Angelico: > Why does Python have most built-ins as simply looked-up names that can > be overridden? Because otherwise, there would be a veritable ton of > keywords: But that doesn't answer the question why the developers chose "True" to be a keyword and "int" to

Re: anomaly

2015-05-12 Thread Antoon Pardon
Op 11-05-15 om 16:03 schreef Marko Rauhamaa: > Antoon Pardon : > >> The point is that all too often someone wants to defend a specific >> choice the developers have made and cites some general rule or >> principle in support, ignoring the fact that python breaks that >> rule/principle in other are

Re: Running cool and silent

2015-05-12 Thread Rustom Mody
On Tuesday, May 12, 2015 at 3:03:53 PM UTC+5:30, Rustom Mody wrote: > For some reason my Dell laptop runs hot and noisy in linux but cool and > silent in Windows-8 > > Running > > $ echo "min_power" | sudo tee > /sys/class/scsi_host/host*/link_power_management_policy > > makes the fan slow/stop

Running cool and silent

2015-05-12 Thread Rustom Mody
For some reason my Dell laptop runs hot and noisy in linux but cool and silent in Windows-8 Running $ echo "min_power" | sudo tee /sys/class/scsi_host/host*/link_power_management_policy makes the fan slow/stop. But I am not sure what it does!! [I dont want my laptop fried and its rather HOT ou

Re: Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

2015-05-12 Thread Rustom Mody
On Tuesday, May 12, 2015 at 12:27:44 PM UTC+5:30, Chris Angelico wrote: > On Tue, May 12, 2015 at 4:42 PM, Rustom Mody wrote: > > And related to that (and one reason a pure functional language is good for > > pedagogy): NO PRINT statement > > It may seem trivial but beginning students have a real

Re: smart scheduling for webapp tester

2015-05-12 Thread Chris Angelico
On Tue, May 12, 2015 at 6:31 AM, Fetchinson . wrote: > I'm looking into a robust solution for web application testing. While > selenium is great for the actual testing, I'm thinking of a scheduler > as the final piece in the pipeline. Let's say I have 4 websites that I > need to test periodically,

smart scheduling for webapp tester

2015-05-12 Thread Fetchinson .
I'm looking into a robust solution for web application testing. While selenium is great for the actual testing, I'm thinking of a scheduler as the final piece in the pipeline. Let's say I have 4 websites that I need to test periodically, A, B, C, D. I'd like to be able to define things like "run th