Re: value of pi and 22/7

2016-06-17 Thread John Ladasky
On Friday, March 18, 2011 at 5:17:48 AM UTC-7, Neil Cerutti wrote: > RIIght. What's a cubit? > > -- > Neil Cerutti How long can you tread water? (Showing my age...) -- https://mail.python.org/mailman/listinfo/python-list

Re: value of pi and 22/7

2016-06-17 Thread Tim Harig
On 2016-06-18, Steven D'Aprano wrote: > On Sat, 18 Jun 2016 09:49 am, Ian Kelly wrote: > >> If I tell you that the speed of light is 300,000,000 m/s, do you think >> that measurement has 9 significant digits? If you do, then you would be >> wrong. > What if the figure to nine significant digits *a

Re: best text editor for programming Python on a Mac

2016-06-17 Thread support
use notepad++ -- https://mail.python.org/mailman/listinfo/python-list

Re: value of pi and 22/7

2016-06-17 Thread Ian Kelly
On Fri, Jun 17, 2016 at 10:30 PM, Lawrence D’Oliveiro wrote: > On Saturday, June 18, 2016 at 3:48:43 PM UTC+12, Random832 wrote: >> >> On Fri, Jun 17, 2016, at 19:12, Lawrence D’Oliveiro wrote: >>> >>> I’m not sure how you can write “30” with one digit... >> >> One *significant* digit. > > Like so

Re: value of pi and 22/7

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, June 18, 2016 at 3:48:43 PM UTC+12, Random832 wrote: > > On Fri, Jun 17, 2016, at 19:12, Lawrence D’Oliveiro wrote: >> >> I’m not sure how you can write “30” with one digit... > > One *significant* digit. Like some credulous past-Bronze-age tribespeople understood the concept of “si

Re: (repost) Advisory: HTTP Header Injection in Python urllib

2016-06-17 Thread Random832
On Fri, Jun 17, 2016, at 21:00, Steven D'Aprano wrote: > The author doesn't go into details of what sort of attacks against > localhost they're talking about. An unauthenticated service running on > localhost implies, to me, a single-user setup, where presumably the > single-user has admin access t

Re: value of pi and 22/7

2016-06-17 Thread Random832
On Fri, Jun 17, 2016, at 19:12, Lawrence D’Oliveiro wrote: > I’m not sure how you can write “30” with one digit... One *significant* digit. Though, as it happens, some ancient number systems, including Hebrew and Greek, have one set of digits for 1-9, one for 10-90, and one for 100-900. -- https:

Re: value of pi and 22/7

2016-06-17 Thread Ethan Furman
On 06/17/2016 06:19 PM, Steven D'Aprano wrote: On Sat, 18 Jun 2016 09:49 am, Ian Kelly wrote: If I tell you that the speed of light is 300,000,000 m/s, do you think that measurement has 9 significant digits? If you do, then you would be wrong. Hmmm. If I tell you that some physical phenomen

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Steven D'Aprano
On Sat, 18 Jun 2016 11:50 am, Lawrence D’Oliveiro wrote: > On Saturday, June 18, 2016 at 12:59:16 PM UTC+12, MRAB wrote: > >> Did you specify the encoding as described in the PEP? > > Python 3 defaults to UTF-8. That doesn't mean that upgrading to Python 3 will fix the problem. It *may*, but si

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Steven D'Aprano
On Sat, 18 Jun 2016 09:52 am, Chris wrote: > I have been trying to write a simple Hello World script on my Mac at work > with TextEdit. However, I keep getting this error message: > > SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but > no encoding declared; see http://pyth

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Zachary Ware
On Jun 17, 2016 6:56 PM, "Chris via Python-list" wrote: > > I have been trying to write a simple Hello World script on my Mac at work with TextEdit. TextEdit is not just a simple text editor, it defaults to rich text mode. You can either attempt to get TextEdit out of rich text mode and into plai

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, June 18, 2016 at 12:59:16 PM UTC+12, MRAB wrote: > Did you specify the encoding as described in the PEP? Python 3 defaults to UTF-8. -- https://mail.python.org/mailman/listinfo/python-list

Re: value of pi and 22/7

2016-06-17 Thread Steven D'Aprano
On Sat, 18 Jun 2016 09:49 am, Ian Kelly wrote: > If I tell you that the speed of light is 300,000,000 m/s, do you think > that measurement has 9 significant digits? If you do, then you would be > wrong. Hmmm. If I tell you that some physical phenomenon [let's call it the speed of light] is 299,9

Re: (repost) Advisory: HTTP Header Injection in Python urllib

2016-06-17 Thread Steven D'Aprano
On Sat, 18 Jun 2016 04:49 am, Paul Rubin wrote: > The blog post below is from a couple days ago: > > http://blog.blindspotsecurity.com/2016/06/advisory-http-header-injection-in.html > The blog post criticizes Redis and Memcached for not using any > authentication (since "safe" internal networks

Re: best text editor for programming Python on a Mac

2016-06-17 Thread MRAB
On 2016-06-18 00:52, Chris via Python-list wrote: I have been trying to write a simple Hello World script on my Mac at work with TextEdit. However, I keep getting this error message: SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but no encoding declared; see http://pyth

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Ned Batchelder
On Friday, June 17, 2016 at 8:19:46 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, June 18, 2016 at 11:52:35 AM UTC+12, Chris wrote: > > > SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but no > > encoding declared; see http://python.org/dev/peps/pep-0263/ for details >

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, June 18, 2016 at 11:52:35 AM UTC+12, Chris wrote: > SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but no > encoding declared; see http://python.org/dev/peps/pep-0263/ for details The problem is the version of Python that comes with your Mac is obsolete. -- htt

Re: Method Chaining

2016-06-17 Thread Ned Batchelder
On Friday, June 17, 2016 at 6:23:12 PM UTC-4, Lawrence D’Oliveiro wrote: > On Friday, June 17, 2016 at 8:13:50 PM UTC+12, Ned Batchelder wrote: > > > But the unchained version is more explicit, and avoids > > the awkward parenthesis. > > You think of parentheses as “awkward”? Because elsewhere I

best text editor for programming Python on a Mac

2016-06-17 Thread Chris via Python-list
I have been trying to write a simple Hello World script on my Mac at work with TextEdit. However, I keep getting this error message: SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details I am using Te

Re: value of pi and 22/7

2016-06-17 Thread Ian Kelly
On Jun 17, 2016 5:44 PM, "Lawrence D’Oliveiro" wrote: > > On Saturday, March 19, 2011 at 3:16:41 AM UTC+13, Grant Edwards wrote: > > > > On 2011-03-18, peter wrote: > > > >> The Old Testament (1 Kings 7,23) says ... "And he made a molten sea, > >> ten cubits from the one brim to the other: it was

Re: value of pi and 22/7

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, March 19, 2011 at 3:16:41 AM UTC+13, Grant Edwards wrote: > > On 2011-03-18, peter wrote: > >> The Old Testament (1 Kings 7,23) says ... "And he made a molten sea, >> ten cubits from the one brim to the other: it was round all about, and >> his height was five cubits: and a line of th

Re: value of pi and 22/7

2016-06-17 Thread Lawrence D’Oliveiro
On Friday, March 18, 2011 at 8:21:36 AM UTC+13, Rotwang wrote: > sum_{j = 1}^\infty 10^{-j!} You forgot a “\” in front of “sum”. (Of course I had to try it in IPython...) -- https://mail.python.org/mailman/listinfo/python-list

Re: What is structured programming (was for/while else doesn't make sense)

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, June 18, 2016 at 4:32:26 AM UTC+12, Rustom Mody wrote: > I wonder whether "red herring" is your red herring I wasn’t the one trying to draw a completely spurious equivalence between structured programming and gotos. -- https://mail.python.org/mailman/listinfo/python-list

Re: Method Chaining

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016, 6:44 PM Michael Selik wrote: > > > On Fri, Jun 17, 2016, 6:42 PM Lawrence D’Oliveiro > wrote: > >> On Saturday, June 18, 2016 at 1:35:06 AM UTC+12, Michael Selik wrote: >> >> > The chained version looks like each method is returning a modified >> > copy. >> >> As opposed to

Re: Method Chaining

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016, 6:42 PM Lawrence D’Oliveiro wrote: > On Saturday, June 18, 2016 at 1:35:06 AM UTC+12, Michael Selik wrote: > > > The chained version looks like each method is returning a modified > > copy. > > As opposed to a modified original? > Correct. Read the rationale for list.sort r

Re: Method Chaining

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, June 18, 2016 at 1:35:06 AM UTC+12, Michael Selik wrote: > The chained version looks like each method is returning a modified > copy. As opposed to a modified original? -- https://mail.python.org/mailman/listinfo/python-list

Re: Method Chaining

2016-06-17 Thread Lawrence D’Oliveiro
On Saturday, June 18, 2016 at 4:48:30 AM UTC+12, Rustom Mody wrote: > One thing about python OOP that irritates me is the 'self.' clutter. > With a Pascal/VB style with-statement its naturally taken care of I used to use “with”-statements back in my Pascal days. Then I had this nasty bug where a

Re: Method Chaining

2016-06-17 Thread Lawrence D’Oliveiro
On Friday, June 17, 2016 at 8:13:50 PM UTC+12, Ned Batchelder wrote: > But the unchained version is more explicit, and avoids > the awkward parenthesis. You think of parentheses as “awkward”? Because elsewhere I see people recommending you put them in even if you don’t need them, for “clarity”.

ANN: Wing IDE 5.1.12 released

2016-06-17 Thread Wingware
Hi, Wingware has released version 5.1.12 of Wing IDE, our cross-platform integrated development environment for the Python programming language. Wing IDE features a professional code editor with vi, emacs, visual studio, and other key bindings, auto-completion, call tips, context-sensitive a

(repost) Advisory: HTTP Header Injection in Python urllib

2016-06-17 Thread Paul Rubin
The blog post below is from a couple days ago: http://blog.blindspotsecurity.com/2016/06/advisory-http-header-injection-in.html It reports that it's possible to inject fake http headers into requests sent by urllib2(python2) and urllib(python3), by getting the library to retrieve a url concocted

Re: value of pi and 22/7

2016-06-17 Thread MRAB
On 2016-06-17 17:51, hed...@hedgui.com wrote: Pi simply is not 3.14159 Time to go to remedial school everyone. If I do something on one side of the equation, I have to do the same on the other side of the equation. With Pi, we are TAKING the diameter, so subtract the width of diameter from th

Re: value of pi and 22/7

2016-06-17 Thread hedgui
Pi simply is not 3.14159 Time to go to remedial school everyone. If I do something on one side of the equation, I have to do the same on the other side of the equation. With Pi, we are TAKING the diameter, so subtract the width of diameter from the circumference of the circle and you have an e

Re: Method Chaining

2016-06-17 Thread Rustom Mody
On Friday, June 17, 2016 at 2:58:19 PM UTC+5:30, Steven D'Aprano wrote: > On Fri, 17 Jun 2016 06:13 pm, Ned Batchelder wrote: > > > To me, it's a toss-up. The chained version is nice in that it removes the > > repetition of "g". But the unchained version is more explicit, and avoids > > the awkw

Re: What is structured programming (was for/while else doesn't make sense)

2016-06-17 Thread Rustom Mody
On Friday, June 17, 2016 at 7:23:27 AM UTC+5:30, Lawrence D’Oliveiro wrote: > On Thursday, June 16, 2016 at 11:13:14 PM UTC+12, Rustom Mody wrote: > > > Please see https://en.wikipedia.org/wiki/Nassi%E2%80%93Shneiderman_diagram > > > > | Nassi–Shneiderman diagrams are (almost) isomorphic with > >

Re: Method Chaining

2016-06-17 Thread Michael Selik
On Fri, Jun 17, 2016 at 5:31 AM Steven D'Aprano wrote: > (g.move_to((p1 + p2a) / 2) > .line_to(p1 + (p2 - p1) * frac) > .line_to((p1 + p1a) / 2) > .stroke() > ) > > the parens and indentation more clearly mark this chunk of code as a > unit. I prefer reserving indentation for where they

Re: Method Chaining

2016-06-17 Thread Steven D'Aprano
On Fri, 17 Jun 2016 06:13 pm, Ned Batchelder wrote: > To me, it's a toss-up. The chained version is nice in that it removes the > repetition of "g". But the unchained version is more explicit, and avoids > the awkward parenthesis. > > I think I would lean toward the unchained version. Clearly

Re: Method Chaining

2016-06-17 Thread Lawrence D’Oliveiro
On Friday, June 17, 2016 at 8:13:50 PM UTC+12, Ned Batchelder wrote: > But the unchained version is more explicit, and avoids > the awkward parenthesis. What if it had been the_context.move_to((p1 + p2a) / 2) the_context.line_to(p1 + (p2 - p1) * frac) the_context.line_to((p1 + p1a) /

Re: Method Chaining

2016-06-17 Thread Jussi Piitulainen
Lawrence D’Oliveiro writes: > On Friday, June 17, 2016 at 8:13:50 PM UTC+12, Ned Batchelder wrote: >> But the unchained version is more explicit, and avoids >> the awkward parenthesis. > > What if it had been > > the_context.move_to((p1 + p2a) / 2) > the_context.line_to(p1 + (p2 - p1) * fr

Re: Method Chaining

2016-06-17 Thread Ned Batchelder
On Friday, June 17, 2016 at 12:37:14 AM UTC-4, Lawrence D’Oliveiro wrote: > On Friday, June 17, 2016 at 4:24:24 PM UTC+12, Michael Selik wrote: > > On Thu, Jun 16, 2016 at 10:53 PM Lawrence D’Oliveiro wrote: > > > > > Example from , > > > c

Re: Contradictory error messages in Python 3.4 - standard library issue!

2016-06-17 Thread Peter Otten
Harrison Chudleigh wrote: > While working on a program, I ran into an error with the usage of the > module tokenize. The following message was displayed. > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tokenize.py", > line 467, in tokenize > encoding, consumed = det