Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24643 > unrolled thread

code review

Started by"Littlefield, Tyler" <tyler@tysdomain.com>
First post2012-06-28 20:57 -0600
Last post2012-07-06 10:37 +0100
Articles 20 on this page of 134 — 34 participants

Back to article view | Back to comp.lang.python


Contents

  code review "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-06-28 20:57 -0600
    Re: code review alex23 <wuwei23@gmail.com> - 2012-06-28 20:58 -0700
      Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-06-29 07:31 +0000
        Re: code review Chris Angelico <rosuav@gmail.com> - 2012-06-29 17:42 +1000
        Re: code review "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-06-29 09:03 -0600
          Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-29 19:41 +0000
            Re: code review MRAB <python@mrabarnett.plus.com> - 2012-06-29 21:09 +0100
            Re: code review "Martin P. Hellwig" <martin.hellwig@gmail.com> - 2012-06-29 13:27 -0700
              Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-29 20:43 +0000
                Re: code review Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-06-29 19:02 -0400
                Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-06-29 23:02 -0400
            Re: code review "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-06-29 14:49 -0600
              Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-30 09:31 +0000
                Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-30 09:36 +0000
            Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-06-30 02:28 +0000
              Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-30 09:22 +0000
            Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-06-29 23:00 -0400
          Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-30 10:04 +0000
            Re: code review Peter Otten <__peter__@web.de> - 2012-06-30 12:29 +0200
              Re: code review Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-06-30 20:39 +0200
                Re: code review Thomas Jollans <t@jollybox.de> - 2012-06-30 21:38 +0200
                  Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-30 20:30 +0000
                    Re: code review Thomas Jollans <t@jollybox.de> - 2012-06-30 22:50 +0200
                      Re: code review Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-06-30 23:07 +0200
                        Re: code review Thomas Jollans <t@jollybox.de> - 2012-06-30 23:35 +0200
                        Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-06-30 17:47 -0400
                        Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-01 00:05 +0200
                          Re: code review Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-07-01 01:03 +0200
                          Re: code review Ben Finney <ben+python@benfinney.id.au> - 2012-07-01 10:08 +1000
                            Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 10:37 +1000
                              Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-01 03:23 +0000
                                Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 13:48 +1000
                                  Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-01 06:54 +0000
                                    Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 16:59 +1000
                                    Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-07-01 05:55 -0400
                                      Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-02 01:26 +0000
                                        Re: code review Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-13 12:30 +0000
                                          Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 15:04 +0000
                                            Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-14 01:36 +1000
                                              Re: code review rusi <rustompmody@gmail.com> - 2012-07-13 09:24 -0700
                                            Re: code review Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-13 16:39 -0400
                                            Re: code review Duncan Booth <duncan.booth@invalid.invalid> - 2012-07-16 10:43 +0000
                                              Re: code review Ben Finney <ben+python@benfinney.id.au> - 2012-07-16 21:34 +1000
                                              Re: code review Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-07-17 10:54 +0000
                                          Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-07-13 19:09 -0400
                                          Re: code review Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-14 03:26 -0600
                                          Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-07-14 16:42 -0400
                                Re: code review rusi <rustompmody@gmail.com> - 2012-06-30 21:07 -0700
                                  Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 14:20 +1000
                              Re: code review Ben Finney <ben+python@benfinney.id.au> - 2012-07-01 17:28 +1000
                                Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-01 09:46 +0200
                                  Re: code review HoneyMonster <nobody@someplace.invalid> - 2012-07-01 20:53 +0000
                                Re: code review Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-01 05:18 -0400
                                  Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-02 00:41 +0000
                                    Re: code review Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-01 21:40 -0400
                                Re: code review Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-01 13:41 -0400
                                Re: code review John O'Hagan <research@johnohagan.com> - 2012-07-02 14:43 +1000
                            Re: Re: code review Evan Driscoll <driscoll@cs.wisc.edu> - 2012-06-30 23:45 -0500
                              Re: Re: code review Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-01 08:57 +0200
                              Re: code review Alister <alister.ware@ntlworld.com> - 2012-07-01 09:54 +0000
                                Re: Re: code review Evan Driscoll <driscoll@cs.wisc.edu> - 2012-07-01 10:48 -0500
                                  Re: Re: code review lars van gemerden <lars@rational-it.com> - 2012-07-06 04:22 -0700
                                  Re: Re: code review lars van gemerden <lars@rational-it.com> - 2012-07-06 04:22 -0700
                                    Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-06 13:58 +0000
                                      Re: code review Roy Smith <roy@panix.com> - 2012-07-13 08:32 -0700
                            Re: code review Evan Driscoll <driscoll@cs.wisc.edu> - 2012-06-30 23:57 -0500
                              Re: code review Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-01 09:04 +0200
                          Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-01 02:06 +0000
                            Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 12:20 +1000
                              Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-01 04:17 +0000
                                Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 14:23 +1000
                                  Re: code review Steven D'Aprano <steve+usenet@pearwood.info> - 2012-07-01 06:27 +0000
                                    Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 16:33 +1000
                                      Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-02 01:28 +0000
                                        Re: code review Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-01 21:50 -0400
                                          Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-02 07:29 +0000
                                        Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-02 12:04 +1000
                                          Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-02 08:11 +0000
                                            Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-02 18:20 +1000
                                              Re: code review Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-02 08:57 -0700
                                                Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-03 02:42 +1000
                                                  Re: code review Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-02 11:22 -0700
                                                    Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-02 21:06 +0200
                                                      Re: code review Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-02 12:35 -0700
                                                    Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-03 07:57 +1000
                                                  Re: code review Neil Cerutti <neilc@norwich.edu> - 2012-07-03 12:19 +0000
                                        Re: code review Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-02 01:20 -0400
                                        Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-02 16:41 +0200
                                        Re: code review Terry Reedy <tjreedy@udel.edu> - 2012-07-02 11:33 -0400
                            Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-01 09:35 +0200
                              Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-02 00:43 +0000
                                Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-02 16:26 +0200
                            Re: code review Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-02 08:16 -0700
                              Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-03 02:55 +1000
                                Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-03 00:57 +0000
                                  Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-03 11:22 +1000
                                  Re: code review John O'Hagan <research@johnohagan.com> - 2012-07-03 12:25 +1000
                                    Re: code review Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-03 04:11 +0000
                                      Re: code review Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-03 02:09 -0400
                                        Re: code review Roy Smith <roy@panix.com> - 2012-07-03 08:33 -0400
                                      Re: code review Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-03 16:53 +0100
                                      Re: code review Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-03 17:32 -0400
                                    Re: code review rusi <rustompmody@gmail.com> - 2012-07-02 22:10 -0700
                                      Re: code review Ben Finney <ben+python@benfinney.id.au> - 2012-07-03 15:46 +1000
                                      Re: code review John O'Hagan <research@johnohagan.com> - 2012-07-04 00:59 +1000
                                  Re: code review Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-03 16:50 +0100
                                    Re: code review Paul Rudin <paul.nospam@rudin.co.uk> - 2012-07-04 10:29 +0100
                                      Re: code review Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-04 17:25 +0100
                                  Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-04 01:53 +1000
                                  Re: code review Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-03 17:05 +0100
                                  Re: code review Dave Angel <d@davea.name> - 2012-07-03 16:13 -0400
                                  Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-04 07:54 +1000
                                  Re: code review Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-04 09:28 +0100
                          Re: code review rusi <rustompmody@gmail.com> - 2012-06-30 19:37 -0700
                        Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-01 09:25 +1000
                        Re: code review Thomas Jollans <t@jollybox.de> - 2012-07-01 01:50 +0200
                    Re: code review "Martin P. Hellwig" <martin.hellwig@gmail.com> - 2012-06-30 14:48 -0700
                    Re: code review Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-02 13:16 -0600
              Re: code review Alister <alister.ware@ntlworld.com> - 2012-06-30 20:25 +0000
            Re: code review Kushal Kumaran <kushal.kumaran+python@gmail.com> - 2012-07-03 23:23 +0530
              Re: code review John Gordon <gordon@panix.com> - 2012-07-03 18:18 +0000
                Re: code review Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-03 12:27 -0600
                Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-04 07:51 +1000
            Re: code review Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-03 12:19 -0600
            Re: code review kushal.kumaran+python@gmail.com - 2012-07-04 08:27 +0530
            Re: code review Chris Angelico <rosuav@gmail.com> - 2012-07-04 13:53 +1000
            Re: code review Simon Cropper <simoncropper@fossworkflowguides.com> - 2012-07-04 14:55 +1000
            Re: code review "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-07-03 23:39 -0600
              Re: code review alex23 <wuwei23@gmail.com> - 2012-07-03 23:17 -0700
                Re: code review rusi <rustompmody@gmail.com> - 2012-07-04 00:05 -0700
            Apology for OT posts (was: code review) John O'Hagan <research@johnohagan.com> - 2012-07-06 12:06 +1000
            Re: Apology for OT posts Simon Cropper <simoncropper@fossworkflowguides.com> - 2012-07-06 15:30 +1000
            Re: Apology for OT posts Chris Angelico <rosuav@gmail.com> - 2012-07-06 17:45 +1000
            Re: Apology for OT posts Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-06 10:37 +0100

Page 6 of 7 — ← Prev page 1 2 3 4 5 [6] 7  Next page →


#24825

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-07-03 16:53 +0100
Message-ID<mailman.1750.1341330908.4697.python-list@python.org>
In reply to#24803
On 03/07/2012 07:09, Dennis Lee Bieber wrote:
> On 03 Jul 2012 04:11:22 GMT, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> declaimed the following in
> gmane.comp.python.general:
>
>
>> One of my favourites is the league, which in the Middle Ages was actually
>> defined as the distance that a man, or a horse, could walk in an hour.
>
> 	From the "Explanatory Supplement to the Astronomical Almanac" [1992
> University Science Books], Table 15.15, the speed of light is
>
> 	1.80261750E12 furlongs/fortnight
>

+1 most useless piece of information garnered this week.

-- 
Cheers.

Mark Lawrence.


[toc] | [prev] | [next] | [standalone]


#24833

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2012-07-03 17:32 -0400
Message-ID<mailman.1759.1341351129.4697.python-list@python.org>
In reply to#24803
On Tue, 03 Jul 2012 16:53:37 +0100, Mark Lawrence
<breamoreboy@yahoo.co.uk> declaimed the following in
gmane.comp.python.general:

> On 03/07/2012 07:09, Dennis Lee Bieber wrote:
> > 	From the "Explanatory Supplement to the Astronomical Almanac" [1992
> > University Science Books], Table 15.15, the speed of light is
> >
> > 	1.80261750E12 furlongs/fortnight
> >
> 
> +1 most useless piece of information garnered this week.

	Well, the book IS 20 years old <G>

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#24805

Fromrusi <rustompmody@gmail.com>
Date2012-07-02 22:10 -0700
Message-ID<3f15d831-45bb-471c-8d49-a2db21e67c7a@nl1g2000pbc.googlegroups.com>
In reply to#24801
On Jul 3, 7:25 am, John O'Hagan <resea...@johnohagan.com> wrote:
>
> I agree to some extent, but as a counter-example, when I was a child there
> a subject called "Weights and Measures" which is now redundant because of the
> Metric system. I don't miss hogsheads and fathoms at all.
>
> Music is another field which could do with a "metrification": I get tired of
> explaining to beginners why there's no B#, except when it's C. Check outhttp://musicnotation.org

You assume that equal temperament is the only way to have music.
Apart from the fact that there are non-tempered musics all over the
world, even Bach Mozart and Beethoven did not write for/to equal
temperament. In a pure/untempered C-scale A-flat is almost half a
semitone sharper than G-sharp -- 8/5 vs 25/16.

Similar for standardized languages: Python's indentation is nice --
except when you have to embed it into say, html

[toc] | [prev] | [next] | [standalone]


#24806

FromBen Finney <ben+python@benfinney.id.au>
Date2012-07-03 15:46 +1000
Message-ID<87pq8dpfc0.fsf@benfinney.id.au>
In reply to#24805
rusi <rustompmody@gmail.com> writes:

> Similar for standardized languages: Python's indentation is nice --
> except when you have to embed it into say, html

If you can't write a ‘pre’ element for pre-formatted text, you don't
have HTML <URL:http://www.w3.org/TR/html401/struct/text.html#h-9.3.4>.

-- 
 \     “Pinky, are you pondering what I'm pondering?” “Uh, I think so, |
  `\         Brain, but we'll never get a monkey to use dental floss.” |
_o__)                                           —_Pinky and The Brain_ |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#24820

FromJohn O'Hagan <research@johnohagan.com>
Date2012-07-04 00:59 +1000
Message-ID<mailman.1745.1341327575.4697.python-list@python.org>
In reply to#24805
On Mon, 2 Jul 2012 22:10:00 -0700 (PDT)
rusi <rustompmody@gmail.com> wrote:

> On Jul 3, 7:25 am, John O'Hagan <resea...@johnohagan.com> wrote:
> >
> > I agree to some extent, but as a counter-example, when I was a child there
> > a subject called "Weights and Measures" which is now redundant because of
> > the Metric system. I don't miss hogsheads and fathoms at all.
> >
> > Music is another field which could do with a "metrification": I get tired of
> > explaining to beginners why there's no B#, except when it's C. Check
> > outhttp://musicnotation.org
> 
> You assume that equal temperament is the only way to have music.
> Apart from the fact that there are non-tempered musics all over the
> world, even Bach Mozart and Beethoven did not write for/to equal
> temperament. In a pure/untempered C-scale A-flat is almost half a
> semitone sharper than G-sharp -- 8/5 vs 25/16.
> 
[...]

I don't assume that at all :) If you didn't already, have look at the
link.  I was talking about notation of the normal everyday contemporary
tempered system where there is no pitch difference between Ab and G#. But even
in a just system, any difference between them depends on the system itself,
the key, and whether you choose to call them that. I've never heard anyone claim
that C is sharper than B#, although in the key of E the relationship would be
the same. 

AIUI there is any number of whole number ratios which fall between seven and
nine tempered semitones above the fundamental (to take your example), and in
C, any one of them could be called either Ab or G# depending on the key
signature or other context. IMHO, that's the aspect that could benefit from a
simplified representation.

To the OP, I'm deeply sorry!

--

John 

[toc] | [prev] | [next] | [standalone]


#24823

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-07-03 16:50 +0100
Message-ID<mailman.1748.1341330556.4697.python-list@python.org>
In reply to#24794
On 03/07/2012 03:25, John O'Hagan wrote:
> On Tue, 3 Jul 2012 11:22:55 +1000
>
> I agree to some extent, but as a counter-example, when I was a child there
> a subject called "Weights and Measures" which is now redundant because of the
> Metric system. I don't miss hogsheads and fathoms at all.
>
> John
>

I weigh 13st 8lb - does this make me redundant?

-- 
Cheers.

Mark Lawrence.


[toc] | [prev] | [next] | [standalone]


#24855

FromPaul Rudin <paul.nospam@rudin.co.uk>
Date2012-07-04 10:29 +0100
Message-ID<87y5mz7u32.fsf@no-fixed-abode.cable.virginmedia.net>
In reply to#24823
Mark Lawrence <breamoreboy@yahoo.co.uk> writes:

> On 03/07/2012 03:25, John O'Hagan wrote:
>> On Tue, 3 Jul 2012 11:22:55 +1000
>>
>> I agree to some extent, but as a counter-example, when I was a child there
>> a subject called "Weights and Measures" which is now redundant because of the
>> Metric system. I don't miss hogsheads and fathoms at all.
>>
>> John
>>
>
> I weigh 13st 8lb - does this make me redundant?

It might mean that you have some redundant weight :)

[toc] | [prev] | [next] | [standalone]


#24869

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-07-04 17:25 +0100
Message-ID<mailman.1795.1341419098.4697.python-list@python.org>
In reply to#24855
On 04/07/2012 10:29, Paul Rudin wrote:
> Mark Lawrence <breamoreboy@yahoo.co.uk> writes:
>
>> On 03/07/2012 03:25, John O'Hagan wrote:
>>> On Tue, 3 Jul 2012 11:22:55 +1000
>>>
>>> I agree to some extent, but as a counter-example, when I was a child there
>>> a subject called "Weights and Measures" which is now redundant because of the
>>> Metric system. I don't miss hogsheads and fathoms at all.
>>>
>>> John
>>>
>>
>> I weigh 13st 8lb - does this make me redundant?
>
> It might mean that you have some redundant weight :)
>

True indeed, although my beer free diet of the last 10 days (yes, 10 
whole days) has at least got it down from 14 stone 2 pounds.

-- 
Cheers.

Mark Lawrence.


[toc] | [prev] | [next] | [standalone]


#24824

FromChris Angelico <rosuav@gmail.com>
Date2012-07-04 01:53 +1000
Message-ID<mailman.1749.1341330795.4697.python-list@python.org>
In reply to#24794
On Wed, Jul 4, 2012 at 1:50 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> On 03/07/2012 03:25, John O'Hagan wrote:
>>
>> On Tue, 3 Jul 2012 11:22:55 +1000
>>
>> I agree to some extent, but as a counter-example, when I was a child there
>> a subject called "Weights and Measures" which is now redundant because of
>> the
>> Metric system. I don't miss hogsheads and fathoms at all.
>>
>> John
>>
>
> I weigh 13st 8lb - does this make me redundant?

Yes, because somewhere in the world is someone who weighs (... pulls
out calculator...) 86kg. After all, the French had a bloody revolution
to get us a new system without any of the old baggage. We don't want
to disappoint the French now, do we!

ChrisA
lemme just dislodge my tongue from my cheek, it seems to be stuck...

[toc] | [prev] | [next] | [standalone]


#24826

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-07-03 17:05 +0100
Message-ID<mailman.1751.1341331439.4697.python-list@python.org>
In reply to#24794
On 03/07/2012 16:53, Chris Angelico wrote:
> On Wed, Jul 4, 2012 at 1:50 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
>> On 03/07/2012 03:25, John O'Hagan wrote:
>>>
>>> On Tue, 3 Jul 2012 11:22:55 +1000
>>>
>>> I agree to some extent, but as a counter-example, when I was a child there
>>> a subject called "Weights and Measures" which is now redundant because of
>>> the
>>> Metric system. I don't miss hogsheads and fathoms at all.
>>>
>>> John
>>>
>>
>> I weigh 13st 8lb - does this make me redundant?
>
> Yes, because somewhere in the world is someone who weighs (... pulls
> out calculator...) 86kg. After all, the French had a bloody revolution
> to get us a new system without any of the old baggage. We don't want
> to disappoint the French now, do we!
>
> ChrisA
> lemme just dislodge my tongue from my cheek, it seems to be stuck...
>

If I go to the moon I will weigh 2st 10lb (if my sums are correct :) but 
the equivalent Frenchman will still be 86kg. I hereby put this forward 
as proof that the metric system is rubbish and we should revert back to 
imperial goodies.

-- 
Cheers.

Mark Lawrence.


[toc] | [prev] | [next] | [standalone]


#24831

FromDave Angel <d@davea.name>
Date2012-07-03 16:13 -0400
Message-ID<mailman.1756.1341346459.4697.python-list@python.org>
In reply to#24794
On 07/03/2012 12:05 PM, Mark Lawrence wrote:
> On 03/07/2012 16:53, Chris Angelico wrote:
>> On Wed, Jul 4, 2012 at 1:50 AM, Mark Lawrence
>> <breamoreboy@yahoo.co.uk> wrote:
>>> On 03/07/2012 03:25, John O'Hagan wrote:
>>>>
>>>> On Tue, 3 Jul 2012 11:22:55 +1000
>>>>
>>>> I agree to some extent, but as a counter-example, when I was a
>>>> child there
>>>> a subject called "Weights and Measures" which is now redundant
>>>> because of
>>>> the
>>>> Metric system. I don't miss hogsheads and fathoms at all.
>>>>
>>>> John
>>>>
>>>
>>> I weigh 13st 8lb - does this make me redundant?
>>
>> Yes, because somewhere in the world is someone who weighs (... pulls
>> out calculator...) 86kg. After all, the French had a bloody revolution
>> to get us a new system without any of the old baggage. We don't want
>> to disappoint the French now, do we!
>>
>> ChrisA
>> lemme just dislodge my tongue from my cheek, it seems to be stuck...
>>
>
> If I go to the moon I will weigh 2st 10lb (if my sums are correct :)
> but the equivalent Frenchman will still be 86kg. I hereby put this
> forward as proof that the metric system is rubbish and we should
> revert back to imperial goodies.
>

86 kg is not a weight, it's a mass.  So it doesn't depend on the local
gravity situation.

DaveA


-- 

DaveA

[toc] | [prev] | [next] | [standalone]


#24835

FromChris Angelico <rosuav@gmail.com>
Date2012-07-04 07:54 +1000
Message-ID<mailman.1762.1341352489.4697.python-list@python.org>
In reply to#24794
On Wed, Jul 4, 2012 at 6:13 AM, Dave Angel <d@davea.name> wrote:
> On 07/03/2012 12:05 PM, Mark Lawrence wrote:
>> If I go to the moon I will weigh 2st 10lb (if my sums are correct :)
>> but the equivalent Frenchman will still be 86kg. I hereby put this
>> forward as proof that the metric system is rubbish and we should
>> revert back to imperial goodies.
>>
>
> 86 kg is not a weight, it's a mass.  So it doesn't depend on the local
> gravity situation.

Indeed it is, as he says. But I believe he may be right in that
'stone' is a unit of weight. Hard to be sure, though, given that it's
not an SI unit (for instance, the Wikipedia article text refers to
weight, but its picture shows a man measuring mass).

ChrisA

[toc] | [prev] | [next] | [standalone]


#24853

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-07-04 09:28 +0100
Message-ID<mailman.1785.1341390610.4697.python-list@python.org>
In reply to#24794
On 03/07/2012 22:54, Chris Angelico wrote:
> On Wed, Jul 4, 2012 at 6:13 AM, Dave Angel <d@davea.name> wrote:
>> On 07/03/2012 12:05 PM, Mark Lawrence wrote:
>>> If I go to the moon I will weigh 2st 10lb (if my sums are correct :)
>>> but the equivalent Frenchman will still be 86kg. I hereby put this
>>> forward as proof that the metric system is rubbish and we should
>>> revert back to imperial goodies.
>>>
>>
>> 86 kg is not a weight, it's a mass.  So it doesn't depend on the local
>> gravity situation.
>
> Indeed it is, as he says. But I believe he may be right in that
> 'stone' is a unit of weight. Hard to be sure, though, given that it's
> not an SI unit (for instance, the Wikipedia article text refers to
> weight, but its picture shows a man measuring mass).
>
> ChrisA
>

Stone is a unit of weight (Brits know important things like this).  And 
with the consistency that the English language is reknowned for the 
plural is, yes you've guessed it, stone :)

-- 
Cheers.

Mark Lawrence.


[toc] | [prev] | [next] | [standalone]


#24716

Fromrusi <rustompmody@gmail.com>
Date2012-06-30 19:37 -0700
Message-ID<e60f7646-8451-485d-897d-0447414ba403@f9g2000pbd.googlegroups.com>
In reply to#24708
On Jul 1, 3:05 am, Thomas Jollans <t...@jollybox.de> wrote:
> Yes. My sole point, really, is that "normally", one would expect these
> two expressions to be equivalent:
>
> a < b < c
> (a < b) < c
>
> This is clearly not true. That's the inconsistency here....

I dont see the inconsistency with the specific example as you've
given.  However if we consider the argument in general, there is
something to be said for being (more) careful to distinguish
associative and conjunctive interpretation of operators. IOW for an
arbitrary operator * (not standard multiply):

If * : t x t -> t,   the only meaningful semantics of a*b*c is (a*b)*c
or a*(b*c)
If * : t x t -> Bool the only meaningful semantics of a*b*c is a*b +
b*c
where the most reasonable instance of '+' is 'and'

What happens when t = Bool?

Both cases match.  And there is something to be said for notationally
allowing for both cases
Dijkstra/Scholten and David Gries books on logic in computer science
expand on this.

A short net-reachable paper is http://wwwhome.ewi.utwente.nl/~fokkinga/mmf2001a.pdf

[toc] | [prev] | [next] | [standalone]


#24710

FromChris Angelico <rosuav@gmail.com>
Date2012-07-01 09:25 +1000
Message-ID<mailman.1664.1341098734.4697.python-list@python.org>
In reply to#24703
On Sun, Jul 1, 2012 at 8:05 AM, Thomas Jollans <t@jollybox.de> wrote:
> Yes. My sole point, really, is that "normally", one would expect these
> two expressions to be equivalent:
>
> a < b < c
> (a < b) < c
>
> This is clearly not true.

Python has quite a few things like that, actually. The most noticeable
for C programmers is:

a = b = c = d = e = 0

which in C is identical to

a = (b = (c = (d = (e = 0))))

because assignment is an expression, but in Python is equivalent to
nothing because assignment is simply allowed to do multiple. Downside:
*Only* simple assignment can be chained. Augmented assignment cannot:

>>> a+=10        # That's fine.
>>> a+=b+=10
  File "<stdin>", line 1
    a+=b+=10
         ^
SyntaxError: invalid syntax
>>> a=b+=10
  File "<stdin>", line 1
    a=b+=10
        ^
SyntaxError: invalid syntax
>>> a+=b=10
  File "<stdin>", line 1
    a+=b=10
        ^
SyntaxError: invalid syntax


In C, these are all well-defined and valid, and are evaluated
right-to-left, and do what you would expect. (And yes, it's handy at
times to do this sort of thing.)

So it's not a special case for the comparison operators; it's a more
general case that Python handles certain chains of operators as single
entities, rather than breaking everything down into "OPERAND OPERATOR
OPERAND" and evaluating one at a time. Is it better than/worse than C?
Not really. It's a design choice and we code within it. (My personal
preference is for the C style, as it makes for a more expressive
language with less mental glitching, but as I say, that's personal
preference.)

ChrisA

[toc] | [prev] | [next] | [standalone]


#24711

FromThomas Jollans <t@jollybox.de>
Date2012-07-01 01:50 +0200
Message-ID<mailman.1665.1341100210.4697.python-list@python.org>
In reply to#24703
On 07/01/2012 01:25 AM, Chris Angelico wrote:
> On Sun, Jul 1, 2012 at 8:05 AM, Thomas Jollans <t@jollybox.de> wrote:
>> Yes. My sole point, really, is that "normally", one would expect these
>> two expressions to be equivalent:
>>
>> a < b < c
>> (a < b) < c
>>
>> This is clearly not true.
> 
> Python has quite a few things like that, actually. The most noticeable
> for C programmers is:
> 
> a = b = c = d = e = 0
> 
> which in C is identical to
> 
> a = (b = (c = (d = (e = 0))))
> 
> because assignment is an expression, but in Python is equivalent to
> nothing because assignment is simply allowed to do multiple. Downside:
> *Only* simple assignment can be chained. Augmented assignment cannot:
> 
>>>> a+=10        # That's fine.
>>>> a+=b+=10
>   File "<stdin>", line 1
>     a+=b+=10
>          ^
> SyntaxError: invalid syntax
>>>> a=b+=10
>   File "<stdin>", line 1
>     a=b+=10
>         ^
> SyntaxError: invalid syntax
>>>> a+=b=10
>   File "<stdin>", line 1
>     a+=b=10
>         ^
> SyntaxError: invalid syntax
> 
> 
> In C, these are all well-defined and valid, and are evaluated
> right-to-left, and do what you would expect. (And yes, it's handy at
> times to do this sort of thing.)
> 
> So it's not a special case for the comparison operators; it's a more
> general case that Python handles certain chains of operators as single
> entities, rather than breaking everything down into "OPERAND OPERATOR
> OPERAND" and evaluating one at a time. Is it better than/worse than C?
> Not really. It's a design choice and we code within it. (My personal
> preference is for the C style, as it makes for a more expressive
> language with less mental glitching, but as I say, that's personal
> preference.)

Nicely put. Of course it's not catastrophic, it's just a feature of
Python that I'm not particularly fond of.

Another operator with special chaining behaviour that occurred to me is
the tuple-building "," operator. This is a particularly interesting one
since the "," symbol is also used in other contexts where it is not an
operator, and the symbol can be considered an operator in the way it can
be in Python only in very few (if any) other programming languages.

[toc] | [prev] | [next] | [standalone]


#24706

From"Martin P. Hellwig" <martin.hellwig@gmail.com>
Date2012-06-30 14:48 -0700
Message-ID<2e7167a8-ab55-422d-808c-9ddb7c44639d@googlegroups.com>
In reply to#24701
On Saturday, 30 June 2012 21:30:45 UTC+1, Alister  wrote:
> On Sat, 30 Jun 2012 21:38:58 +0200, Thomas Jollans wrote:
> 
> > On 06/30/2012 08:39 PM, Thomas 'PointedEars' Lahn wrote:
> >> Peter Otten wrote:
> >> 
> >>> If you spell it
> >>>
> >>> def is_valid_password(password):
> >>>     return mud.minpass <= len(password) <= mud.maxpass
> >>>
<cut>
> Surely this fits perfectly with the lines 1 & 7 in the zen of python 
> (import this)
> "Beautifull is better than ugly" and "Readability counts"
> 
Agree, however I like to stress the "don't make me unnecessary read with care" rule. Meaning if I read that line, I have to read it carefully to make sure I understand what is happening, the following would not do that although syntax wise equal:

def length_between_min_max(password):
   return(mud.minpass <= len(password) <= mud.maxpass)
   

def is_valid_password(password):
   valid = True

   if not length_between_max_min(password):
      valid = False

   if some_other_test(password):
      valid = False


  return(valid)

This I can read, typically I would not even read what the function length_beteen_max_min does as long as there is no bug in it because, it is perfectly english clear what the intention is.

-- 
mph

[toc] | [prev] | [next] | [standalone]


#24786

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-07-02 13:16 -0600
Message-ID<mailman.1718.1341256624.4697.python-list@python.org>
In reply to#24701
On Sat, Jun 30, 2012 at 2:50 PM, Thomas Jollans <t@jollybox.de> wrote:
> Which of the two comparisons is done first anyway?
> "In the face of ambiguity, refuse the temptation to guess."

I would consider that a pro, not a con, because the C-like way is much
worse in this regard.  Using operator chaining, is "1 < 2 < 3"
equivalent to:

1 < 2 and 2 < 3  # assuming left-to-right evaluation order for "and"
2 < 3 and 1 < 2

The former seems pretty obvious to me (since it more closely matches
the original syntax) and also turns out to be correct, but more to the
point, most of the time it really doesn't matter which is evaluated
first.  It's only relevant if:

a) your comparison operator has side-effects (bad programmer! bad!); or
b) one of the comparisons is significantly faster than the other --
but since usually both comparisons will be of the same type (e.g. both
comparing two numbers), this is also a corner case.

On the other hand, using the C-like interpretation, is "1 < 2 < 3"
equivalent to:

(1 < 2) < 3
1 < (2 < 3)

I would guess the former is more common, but I really have no basis
for that guess beyond some experience with languages that use this
syntax.  I can see no particular advantages to either interpretation
and can certainly imagine that some languages might choose the latter
instead.  Moreover, the distinction actually matters in this case,
because the first expression is true (at least in Python) while the
second is false.

I will take ambiguity that is mostly unimportant over ambiguity that
is critical to the meaning of the expression any day of the week.

Cheers,
Ian

[toc] | [prev] | [next] | [standalone]


#24700

FromAlister <alister.ware@ntlworld.com>
Date2012-06-30 20:25 +0000
Message-ID<7hJHr.500116$jl.425893@fx19.am4>
In reply to#24693
On Sat, 30 Jun 2012 12:29:31 +0200, Peter Otten wrote:

> Alister wrote:
> 
>> I think I may be on firmer grounds with the next few:
>> 
>> isValidPassword can be simplified to
>> 
>> def isValidPassword(password:
>>         count=len(password)
>>         return count>= mud.minpass and count<= mud.maxpass
>> 
>> ( I used count to save finding the length of password twice although it
>> probably makes no difference in this scenario)
> 
> If you spell it
> 
> def is_valid_password(password):
>     return mud.minpass <= len(password) <= mud.maxpass
> 
> it is even easier to see that you are performing an interval check.

I realise that was possible, that is brilliant! it is exactly how you 
would write it ass a mathematical definition.




-- 
"The only real way to look younger is not to be born so soon."
		-- Charles Schulz, "Things I've Had to Learn Over and
		   Over and Over"

[toc] | [prev] | [next] | [standalone]


#24827

FromKushal Kumaran <kushal.kumaran+python@gmail.com>
Date2012-07-03 23:23 +0530
Message-ID<mailman.1753.1341338042.4697.python-list@python.org>
In reply to#24692
On Sat, Jun 30, 2012 at 3:34 PM, Alister <alister.ware@ntlworld.com> wrote:
> On Fri, 29 Jun 2012 09:03:22 -0600, Littlefield, Tyler wrote:
>
>> On 6/29/2012 1:31 AM, Steven D'Aprano wrote:
>>> On Thu, 28 Jun 2012 20:58:15 -0700, alex23 wrote:
>>>
>>>> On Jun 29, 12:57 pm, "Littlefield, Tyler" <ty...@tysdomain.com> wrote:
>>>>> I was curious if someone wouldn't mind poking at some code. The
>>>>> project page is at:http://code.google.com/p/pymud Any information is
>>>>> greatly appreciated.
>>>> I couldn't find any actual code at that site, the git repository is
>>>> currently empty.
>>
>> OOPS, sorry. Apparently I'm not as good with git as I thought.
>> Everything's in the repo now.
>
> I think I may be on firmer grounds with the next few:
>
> isValidPassword can be simplified to
>
> def isValidPassword(password:
>         count=len(password)
>         return count>= mud.minpass and count<= mud.maxpass
>

I haven't actually seen the rest of the code, but I would like to
point out that applications placing maximum length limits on passwords
are extremely annoying.

> <snip>

-- 
regards,
kushal

[toc] | [prev] | [next] | [standalone]


Page 6 of 7 — ← Prev page 1 2 3 4 5 [6] 7  Next page →

Back to top | Article view | comp.lang.python


csiph-web