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


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

Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

Started byvasudevram <vasudevram@gmail.com>
First post2014-03-21 13:42 -0700
Last post2014-03-28 17:05 -0500
Articles 20 on this page of 401 — 30 participants

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


Contents

  Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) vasudevram <vasudevram@gmail.com> - 2014-03-21 13:42 -0700
    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-21 13:54 -0700
      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) vasudevram <vasudevram@gmail.com> - 2014-03-21 13:56 -0700
        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-21 14:09 -0700
          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-21 15:30 -0600
            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-21 19:06 -0700
              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-22 13:41 +1100
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-21 21:39 -0700
                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-22 15:51 +1100
                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-21 22:26 -0700
                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) "Rhodri James" <rhodri@wildebst.org.uk> - 2014-03-23 00:32 +0000
                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-22 20:46 -0600
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-22 20:16 -0700
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-22 21:47 -0600
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) "Rhodri James" <rhodri@wildebst.org.uk> - 2014-03-24 02:35 +0000
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-24 14:27 +1100
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-23 21:14 -0700
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-24 16:04 +1100
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-24 14:32 +1100
                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-21 22:48 -0700
                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-21 23:51 -0500
                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-22 09:46 +0000
                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 00:52 -0500
                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-24 03:03 -0600
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-24 11:55 +0200
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-24 22:49 +1100
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-24 14:36 +0200
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-24 23:53 +1100
                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-24 14:39 +0000
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-24 15:22 +0000
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-24 14:21 +0000
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-24 14:04 +0000
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 09:00 -0700
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 06:12 +1100
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-24 13:42 -0600
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 06:57 +1100
                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 05:28 +0000
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 16:43 +1100
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-24 11:24 -0600
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 16:43 -0500
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-25 00:43 +0200
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 18:56 -0500
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 11:11 +1100
                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 19:16 -0500
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 11:28 +1100
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-25 00:32 +0000
                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 19:50 -0500
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-03-24 21:31 -0400
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 12:41 +1100
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 06:28 +0000
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-03-24 21:20 -0400
                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 21:39 -0500
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 06:52 +0000
                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) alex23 <wuwei23@gmail.com> - 2014-03-26 16:35 +1000
                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-27 10:44 -0500
                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-28 03:10 +1100
                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-27 11:37 -0500
                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-28 03:48 +1100
                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-27 15:54 -0500
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-28 08:42 +1100
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-27 17:14 -0500
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-28 13:24 +1100
                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-27 19:46 -0700
                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-28 14:06 +1100
                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-27 20:20 -0700
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-27 17:14 -0500
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-28 04:45 +0000
                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-28 00:34 +0000
                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 16:18 -0500
                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-29 13:45 +1100
                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 03:08 +0000
                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 22:18 -0500
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-29 14:45 +1100
                                                Keyboard standards (was: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)) Ben Finney <ben+python@benfinney.id.au> - 2014-03-29 15:18 +1100
                                                  Re: Keyboard standards Mark H Harris <harrismh777@gmail.com> - 2014-03-28 23:26 -0500
                                                    Re: Keyboard standards Chris Angelico <rosuav@gmail.com> - 2014-03-29 16:13 +1100
                                                      Re: Keyboard standards Mark H Harris <harrismh777@gmail.com> - 2014-03-29 00:40 -0500
                                                        Re: Keyboard standards Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-29 04:02 -0600
                                                        Re: Keyboard standards Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 16:03 +0000
                                                    Re: Keyboard standards Larry Hudson <orgnut@yahoo.com> - 2014-03-29 12:27 -0700
                                                      Re: Keyboard standards Michael Torrie <torriem@gmail.com> - 2014-03-29 13:41 -0600
                                                        Re: Keyboard standards Larry Hudson <orgnut@yahoo.com> - 2014-03-29 23:53 -0700
                                                      Re: Keyboard standards Dave Angel <davea@davea.name> - 2014-03-29 17:26 -0400
                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 03:51 +0000
                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 23:07 -0500
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 23:16 -0500
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 23:21 -0500
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-29 15:48 +1100
                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 23:40 -0500
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-29 16:08 +1100
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-28 22:21 -0700
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-29 00:51 -0500
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-29 17:03 +1100
                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-29 03:21 -0500
                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-29 15:45 +0000
                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-30 00:52 -0500
                                                            OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 06:31 +0000
                                                              Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Chris Angelico <rosuav@gmail.com> - 2014-03-30 17:43 +1100
                                                              Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Mark H Harris <harrismh777@gmail.com> - 2014-03-30 01:48 -0500
                                                                Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 10:35 +0000
                                                                  Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Chris Angelico <rosuav@gmail.com> - 2014-03-30 23:03 +1100
                                                                  Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Mark H Harris <harrismh777@gmail.com> - 2014-03-30 23:29 -0500
                                                                  Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Mark H Harris <harrismh777@gmail.com> - 2014-03-30 23:57 -0500
                                                                    Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Chris Angelico <rosuav@gmail.com> - 2014-03-31 16:05 +1100
                                                                      Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Mark H Harris <harrismh777@gmail.com> - 2014-03-31 00:33 -0500
                                                                    Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-31 09:31 +0100
                                                              Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Mark H Harris <harrismh777@gmail.com> - 2014-03-31 00:23 -0500
                                                                Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Chris Angelico <rosuav@gmail.com> - 2014-03-31 16:44 +1100
                                                                Re: OFF TOPIC Spanish in the USA Marko Rauhamaa <marko@pacujo.net> - 2014-03-31 11:39 +0300
                                                                  Re: OFF TOPIC Spanish in the USA Ned Batchelder <ned@nedbatchelder.com> - 2014-03-31 07:33 -0400
                                                                Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-03-31 08:41 -0400
                                                                Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Chris Angelico <rosuav@gmail.com> - 2014-04-01 00:04 +1100
                                                                Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] "Rhodri James" <rhodri@wildebst.org.uk> - 2014-03-31 21:47 +0100
                                                                  Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Terry Reedy <tjreedy@udel.edu> - 2014-03-31 18:06 -0400
                                                                Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-03-31 20:03 -0400
                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Larry Hudson <orgnut@yahoo.com> - 2014-03-30 00:32 -0700
                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 10:44 +0000
                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) "Rhodri James" <rhodri@wildebst.org.uk> - 2014-03-30 23:57 +0100
                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) MRAB <python@mrabarnett.plus.com> - 2014-03-31 00:20 +0100
                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Grant Edwards <invalid@invalid.invalid> - 2014-03-31 14:14 +0000
                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Walter Hurry <walterhurry@gmail.com> - 2014-03-31 00:39 +0000
                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Roy Smith <roy@panix.com> - 2014-03-30 08:08 -0400
                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 15:22 +0000
                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-30 10:03 -0600
                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-31 01:08 -0500
                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-31 17:47 +1100
                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ben Finney <ben+python@benfinney.id.au> - 2014-03-31 17:53 +1100
                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-31 00:36 -0700
                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) wxjmfauth@gmail.com - 2014-03-31 01:32 -0700
                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Roy Smith <roy@panix.com> - 2014-03-31 08:16 -0400
                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) "Rhodri James" <rhodri@wildebst.org.uk> - 2014-03-31 21:46 +0100
                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-01 16:26 -0500
                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-02 08:49 +1100
                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-01 18:18 -0500
                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-04-01 18:33 -0400
                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-03 11:38 -0500
                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-03 20:14 +0300
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-03 11:40 -0700
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-03 13:55 -0500
                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-03 22:43 +0300
                                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-03 22:12 -0500
                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-04 09:43 +1100
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-03 21:09 -0500
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-04 07:52 +0000
                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-04 19:11 +1100
                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-04 02:13 -0600
                                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-04 10:08 +0000
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-04 11:01 -0600
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-05 00:20 +0000
                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) alex23 <wuwei23@gmail.com> - 2014-04-04 12:07 +1000
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-03 21:29 -0500
                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-04 09:20 +0100
                                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 15:58 -0500
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-04 15:40 -0600
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-04 22:50 +0100
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 17:07 -0500
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 09:39 +1100
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 17:52 -0500
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 09:57 +1100
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-05 00:16 +0100
                                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 23:10 -0500
                                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 15:40 +1100
                                                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 00:11 -0500
                                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-04 23:02 -0600
                                                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 00:37 -0500
                                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ben Finney <ben+python@benfinney.id.au> - 2014-04-05 17:01 +1100
                                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 01:48 -0500
                                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 18:08 +1100
                                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 01:48 -0500
                                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-04-04 23:07 -0600
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 17:52 -0500
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-04-04 23:04 -0400
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 23:18 -0500
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 14:22 +1100
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-04-05 00:10 -0400
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 17:07 -0500
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-05 00:00 +0000
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 12:51 +1100
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-04 23:31 -0500
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 15:49 +1100
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 00:23 -0500
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 16:55 +1100
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 00:23 -0500
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-04 20:42 -0700
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 00:02 -0500
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 16:24 +1100
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ben Finney <ben+python@benfinney.id.au> - 2014-04-05 16:29 +1100
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 16:57 +1100
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-04 23:59 -0700
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-05 18:10 +1100
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-05 10:19 +0000
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-04-05 07:20 -0400
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Roy Smith <roy@panix.com> - 2014-04-05 10:28 -0400
                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-04 09:53 +0000
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-04 03:24 -0700
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-04-04 06:43 -0400
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 22:59 -0500
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 23:59 -0500
                                                                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-06 12:05 +0300
                                                                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-06 16:52 +0000
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-06 10:31 -0700
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-07 03:54 +1000
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-06 11:13 -0700
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-07 04:46 +1000
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-06 19:32 -0700
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-07 20:33 -0500
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) MRAB <python@mrabarnett.plus.com> - 2014-04-08 02:52 +0100
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-08 13:02 +1000
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-04-08 08:21 +0000
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) alex23 <wuwei23@gmail.com> - 2014-04-09 10:39 +1000
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-09 12:26 +1000
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-08 03:53 -0700
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-07 03:27 +1000
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-06 23:23 +0300
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-06 19:09 +0100
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-04-07 04:14 +1000
                                                                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-06 23:10 +0300
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-04-06 21:56 +0100
                                                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-06 23:48 +0000
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-04-06 20:45 -0400
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-04-06 18:54 -0700
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-04-07 05:10 +0000
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-07 08:14 +0300
                                                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-04-08 09:03 +0200
                                                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-04-07 07:54 +0300
                                                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-07 12:19 +0000
                                                                      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-04-05 23:01 -0500
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-28 23:10 -0700
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-29 00:51 -0500
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 17:53 +0000
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-30 01:22 -0500
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 16:22 +0000
                                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-29 13:39 +0200
                                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Roy Smith <roy@panix.com> - 2014-03-29 07:53 -0400
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-29 13:59 +0200
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Gene Heskett <gheskett@wdtv.com> - 2014-03-29 13:48 -0400
                                                    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-30 00:57 -0500
                                                  Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Gene Heskett <gheskett@wdtv.com> - 2014-03-29 13:46 -0400
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 10:01 +1100
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 18:44 -0500
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 10:57 +1100
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 06:16 +0000
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-24 17:58 -0600
                              Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 20:00 -0700
                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 22:15 -0500
                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 14:17 +1100
                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 22:25 -0500
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 22:28 -0500
                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Roy Smith <roy@panix.com> - 2014-03-24 23:29 -0400
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 14:51 +1100
                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 22:59 -0500
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 21:08 -0700
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 15:29 +1100
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 22:00 -0700
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 16:08 +1100
                                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 00:14 -0500
                                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 22:23 -0700
                                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 16:31 +1100
                                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 16:27 +1100
                                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 00:34 -0500
                                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 22:42 -0700
                                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 00:47 -0500
                                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 16:54 +1100
                                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 16:48 +1100
                                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 00:56 -0500
                                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Roy Smith <roy@panix.com> - 2014-03-25 08:36 -0400
                                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 05:53 -0700
                                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 14:43 +0100
                                                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 06:52 -0700
                                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-26 00:56 +1100
                                                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 07:08 -0700
                                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-25 14:23 +0000
                                                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 08:19 -0700
                                                              Re: Time we switched to unicode? (was Explanation of this Python   language feature?) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-26 09:33 +1300
                                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 11:58 -0500
                                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-03-25 20:02 -0400
                                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 01:01 -0500
                                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 17:19 +1100
                                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 07:03 +0000
                                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 18:12 +1100
                                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-03-25 20:05 -0400
                                                    Re: Time we switched to unicode? Marko Rauhamaa <marko@pacujo.net> - 2014-03-25 10:05 +0200
                                                      Re: Time we switched to unicode? Chris Angelico <rosuav@gmail.com> - 2014-03-25 19:23 +1100
                                                        Re: Time we switched to unicode? Steven D'Aprano <steve@pearwood.info> - 2014-03-25 08:59 +0000
                                                          Re: Time we switched to unicode? Chris Angelico <rosuav@gmail.com> - 2014-03-25 20:03 +1100
                                                      Re: Time we switched to unicode? Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-03-25 18:24 +0100
                                                        Re: Time we switched to unicode? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-26 01:01 +0000
                                                      Re: Time we switched to unicode? Chris Angelico <rosuav@gmail.com> - 2014-03-26 06:40 +1100
                                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 22:28 -0700
                                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 00:36 -0500
                                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 06:07 +0000
                                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-25 01:48 -0500
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 10:43 +0100
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 20:54 +1100
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 11:38 +0100
                                                Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-25 11:14 +0000
                                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 12:46 +0100
                                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 05:09 -0700
                                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-25 15:18 +0000
                                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Terry Reedy <tjreedy@udel.edu> - 2014-03-25 19:55 -0400
                                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-26 00:12 +0000
                                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Terry Reedy <tjreedy@udel.edu> - 2014-03-26 00:30 -0400
                                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 21:56 -0700
                                                              Delayed evaluation of expressions [was Re: Time we switched to unicode?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-26 16:05 +0000
                                                                Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Rustom Mody <rustompmody@gmail.com> - 2014-03-26 10:32 -0700
                                                                  Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Rustom Mody <rustompmody@gmail.com> - 2014-03-26 10:57 -0700
                                                                  Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Chris Angelico <rosuav@gmail.com> - 2014-03-27 09:24 +1100
                                                                    Re: Delayed evaluation of expressions Marko Rauhamaa <marko@pacujo.net> - 2014-03-27 00:45 +0200
                                                                      Re: Delayed evaluation of expressions Rustom Mody <rustompmody@gmail.com> - 2014-03-26 22:02 -0700
                                                                    Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-26 23:43 +0000
                                                                      Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Rustom Mody <rustompmody@gmail.com> - 2014-03-26 18:59 -0700
                                                                Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Terry Reedy <tjreedy@udel.edu> - 2014-03-26 20:44 -0400
                                                                  Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-27 02:16 +0000
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Roy Smith <roy@panix.com> - 2014-03-25 08:35 -0400
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-26 00:13 +1100
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-25 14:13 +0000
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-26 01:37 +1100
                                                Re: Time we switched to unicode? (was Explanation of this Python   language feature?) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-26 09:58 +1300
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-03-25 20:10 -0400
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-26 09:21 +1300
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Larry Martell <larry.martell@gmail.com> - 2014-03-25 16:31 -0400
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-25 21:22 +0000
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 15:19 +1100
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 06:04 +0000
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 17:26 +1100
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Roy Smith <roy@panix.com> - 2014-03-25 08:24 -0400
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-03-25 19:44 -0400
                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 20:43 -0700
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 14:57 +1100
                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 05:47 +0000
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 23:10 -0700
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 17:33 +1100
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 23:41 -0700
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 17:50 +1100
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Terry Reedy <tjreedy@udel.edu> - 2014-03-25 18:39 -0400
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 17:12 +1100
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 23:35 -0700
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 17:45 +1100
                                              Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 23:52 -0700
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) "Rhodri James" <rhodri@wildebst.org.uk> - 2014-03-27 01:16 +0000
                                            Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-27 12:26 +1100
                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 20:44 -0700
                                  Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-24 20:56 -0700
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 15:14 +1100
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 07:03 +0000
                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 00:22 -0700
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 11:24 +0100
                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Roy Smith <roy@panix.com> - 2014-03-25 08:21 -0400
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-25 13:36 +0000
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 15:01 +0100
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Terry Reedy <tjreedy@udel.edu> - 2014-03-25 22:10 -0400
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-26 13:39 +1100
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-27 01:32 -0600
                                          Re: Time we switched to unicode? (was Explanation of this Python language feature?) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-27 01:43 -0600
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 22:12 +1100
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 13:07 +0100
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-25 23:45 +1100
                                      Re: Time we switched to unicode? (was Explanation of this Python language feature?) Rustom Mody <rustompmody@gmail.com> - 2014-03-25 06:07 -0700
                                        Re: Time we switched to unicode? (was Explanation of this Python language feature?) Chris Angelico <rosuav@gmail.com> - 2014-03-26 00:50 +1100
                                      Re: Time we switched to unicode? (was Explanation of this Python   language feature?) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-26 09:37 +1300
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-25 14:07 +0100
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Terry Reedy <tjreedy@udel.edu> - 2014-03-25 20:24 -0400
                                    Re: Time we switched to unicode? (was Explanation of this Python language feature?) Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-03-26 10:22 +0100
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-03-25 06:20 +0000
                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve@pearwood.info> - 2014-03-24 09:49 +0000
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-24 22:21 +1100
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 14:47 -0500
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-25 01:45 +0000
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 13:17 +1100
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-25 02:06 +0000
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 22:48 -0500
                        Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-24 09:58 +0000
                          Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 13:58 -0500
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-24 19:13 +0000
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-24 13:12 -0600
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 06:22 +1100
                              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-24 22:58 +0000
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 10:07 +1100
                                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Terry Reedy <tjreedy@udel.edu> - 2014-03-24 21:04 -0400
                            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-25 06:45 +1100
              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-22 04:47 +0000
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Chris Angelico <rosuav@gmail.com> - 2014-03-22 16:05 +1100
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-22 12:24 +0200
              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-22 03:09 -0600
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-22 12:30 +0200
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-22 10:16 -0700
              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-22 10:40 +0000
              Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-22 17:57 +0000
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Marko Rauhamaa <marko@pacujo.net> - 2014-03-22 20:40 +0200
                Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Rustom Mody <rustompmody@gmail.com> - 2014-03-22 11:42 -0700
            Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) 88888 Dihedral <dihedral88888@gmail.com> - 2014-03-25 03:17 -0700
          Re: Explanation of this Python language feature? [x for x in x for x   in x] (to flatten a nested list) Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-22 10:34 +1300
    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) vasudevram <vasudevram@gmail.com> - 2014-03-22 13:59 -0700
      Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Mark H Harris <harrismh777@gmail.com> - 2014-03-24 20:56 -0500
    Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Dan Stromberg <drsalists@gmail.com> - 2014-03-27 16:45 -0700
      How to flatten a list of lists was (Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 17:00 -0500
      How to flatten a list of lists was (Explanation of this Python language feature?) Mark H Harris <harrismh777@gmail.com> - 2014-03-28 17:00 -0500
      To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x] Mark H Harris <harrismh777@gmail.com> - 2014-03-28 17:05 -0500
        Re: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 02:31 +0000
          Re: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x] Mark H Harris <harrismh777@gmail.com> - 2014-03-28 22:33 -0500
      To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x] Mark H Harris <harrismh777@gmail.com> - 2014-03-28 17:05 -0500

Page 2 of 21 — ← Prev page 1 [2] 3 4 … 21  Next page →


#68746

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-21 23:51 -0500
Message-ID<lgj4sp$7ed$1@speranza.aioe.org>
In reply to#68742
On 3/21/14 11:39 PM, Rustom Mody wrote:
> Given

> fl = [lambda y : x+y for x in [1,2,3]]

> It means:

> def rec(l):
>     if not l: return []
>     else:
>       x,ll = l[0],l[1:]
>       return [lambda y: x + y] + rec(ll)
>
> followed by
> fl = rec([1,2,3])

> Naturally a reasonable *implementation* would carry this *intention*
{snip}
> [But then I find Lisp and much of basic haskell natural and most of C++ not,
> so my views are likely prejudiced :-)


This discussion (the entire thread) comes up again and again over the 
years because python tries to be all things to all people, without much 
reason behind the motivation. I'm speaking of Lambda (filter, map, reduce).

Python is not Lisp. (I love Lisp too). Python is not Haskell (I love 
Haskell too).

Lambda is a problem, if only because it causes confusion. What's the 
problem?  Glad you asked. The constructs DO NOT work the way most people 
would expect them to, having limited knowledge of python!  I ran into 
this thing about seven years ago (when I was studying Haskell, and 
Scheme) and I wanted to see how "pure functional" python was (well, not 
at all really).

I can see uses for python's lambda.  But, honestly, I think python could 
deprecate its use and in five years just remove it from the language; 
along with filter, map, and reduce !

I'm just saying;

marcus

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


#68757

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-03-22 09:46 +0000
Message-ID<532d5bd9$0$29994$c3e8da3$5496439d@news.astraweb.com>
In reply to#68746
On Fri, 21 Mar 2014 23:51:38 -0500, Mark H Harris wrote:

> Lambda is a problem, if only because it causes confusion. What's the
> problem?  Glad you asked. The constructs DO NOT work the way most people
> would expect them to, having limited knowledge of python!

Why is that a problem? Would you consider it a problem that people who 
don't understand BASIC can't understand BASIC? ("I don't get the 
difference between GOTO and GOSUB. Obviously GOSUB is a problem and 
should be throw out.") Do you think that the fact that people who have 
never used a TI-89 calculator before may have trouble used a TI-89 
calculator means that TI-89 calculators are "a problem"? (I've taught 
school children who didn't know how to use their calculator.)

The problem is ignorance, not the calculator, and not lambda.

You've told us that "most people" (which people? dentists? lawyers? 
illiterate tribesmen from the Amazon? professional programmers?) are 
surprised by lamba's behaviour, but you haven't actually told us what 
behaviour is surprising, or what "most people" expect lambda to do. 
Perhaps you ought to?


> I ran into
> this thing about seven years ago (when I was studying Haskell, and
> Scheme) and I wanted to see how "pure functional" python was (well, not
> at all really).

Python is not a pure functional language, but you can write functional 
code in it. If you want a pure functional language, you know where to 
find one.

(I wonder whether, say, Haskell has the people coming along and demanding 
that it should become more like Python?)


> I can see uses for python's lambda.  But, honestly, I think python could
> deprecate its use and in five years just remove it from the language;
> along with filter, map, and reduce !

Python could deprecate many things. It would make Python a worse language.

By the way, are you aware that lambda is *identical* to def except for 
three things?

- lambda is an expression, not a statement like def;

- the body of a function created with lambda is limited to a 
  single expression, not a block;

- the function object created with lambda has a generic name.


So unless the surprising behaviour about lambda that you're about to tell 
us about relates to one of those three things, I *guarantee* that 
functions created with def have the same surprising behaviour.



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/

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


#68851

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-24 00:52 -0500
Message-ID<lgoh7j$otg$1@speranza.aioe.org>
In reply to#68757
On 3/22/14 4:46 AM, Steven D'Aprano wrote:
> On Fri, 21 Mar 2014 23:51:38 -0500, Mark H Harris wrote:
>
>> Lambda is a problem, if only because it causes confusion. What's the
>> problem?  Glad you asked. The constructs DO NOT work the way most people
>> would expect them to, having limited knowledge of python!

    One of the best links for understanding what is wrong with lambda is 
here, from Guido, (by the way I agree totally with his assessment, there 
is no point really in writing it out again):

   http://www.artima.com/weblogs/viewpost.jsp?thread=98196


> Why is that a problem? Would you consider it a problem that people who
> don't understand BASIC can't understand BASIC? ("I don't get the
> difference between GOTO and GOSUB. {snip}
>
> The problem is ignorance, not the calculator, and not lambda.

    You're argument, based on analogy, is also a red herring, as well a 
straw man. Lambda is a problem of confusion for scientists and other 
mathematicians (amateur and otherwise) who may be confused because 
python's lambda does not do precisely what they might expect from other 
functional programming languages, nor does it match precisely with the 
lambda calculus. Its also confusing to sophisticated users of all 
stripes who may not be aware of "lambda" at all.

> You've told us that "most people" (which people? dentists? lawyers?
> illiterate tribesmen from the Amazon? professional programmers?) are
> surprised by lamba's behaviour, but you haven't actually told us what
> behaviour is surprising, or what "most people" expect lambda to do.
> Perhaps you ought to?

    I love your rhetoric, actually, but red herrings all . . .

    Here is a link that advocates lambda (map, filter, and reduce) as a 
very powerful construct for doing various things:  I agree:

http://www.secnetix.de/olli/Python/lambda_functions.hawk

    Its a great link, but the important sentence for this discussion is 
this unique quote, about "lambda,"

 >"This is not exactly the same as lambda in functional
> programming languages, but it is a very powerful concept . . ."

    People who understand lambda from functional languages must hassle 
with the fact that lambda is different in python, and people who do not 
understand functional programming languages (nor the lambda calculus) 
are confused by the syntax, also just what it does.


> Python is not a pure functional language, but you can write functional
> code in it. If you want a pure functional language, you know where to
> find one.

    Yes, that's obvious; but you're missing the point. Python is not a 
functional language, and implying that it can be used as one is 
misleading at best (maybe a lie at worst) just because it has a 
construct for generating a dynamic anonymous function.

> (I wonder whether, say, Haskell has the people coming along and demanding
> that it should become more like Python?)

    Another straw man.

    Well, number one, I'm not demanding anything. Number two, everyone 
who uses Haskell (for whatever reason) knows well from the start that 
its a pure functional programming language. That is the advertisement, 
and that is the expectation. No one expects anything different.

>> I can see uses for python's lambda.  But, honestly, I think python could
>> deprecate its use and in five years just remove it from the language;
>> along with filter, map, and reduce !
>
> Python could deprecate many things. It would make Python a worse language.

    How so?  Read Guido's argument above. Another way to answer this 
question is that I have been programming with Python for almost a decade 
and I've not used lambda. In fact, I have gone out of my way to NOT use 
lambda because I am fully aware that the BDFL hates it. Reduce is no 
longer in the standard library (although you can import it) and there 
are equally good ways to do what lambda was designed for without the 
hassle nor confusion.

> By the way, are you aware that lambda is *identical* to def except for
> three things?
>
> - lambda is an expression, not a statement like def;
>
> - the body of a function created with lambda is limited to a
>    single expression, not a block;
>
> - the function object created with lambda has a generic name.

    Absolutely, thank you for pointing those out !  You forgot that 
lambdas can be used in expressions while def functions may not... but 
you really have proved my point.  There is so little difference between 
the two that (for the sake of clarity and reducing confusion) it might 
be good to just remove the lambda thing altogether.  Just say'in.

> So unless the surprising behaviour about lambda that you're about to tell
> us about relates to one of those three things, I *guarantee* that
> functions created with def have the same surprising behaviour.

    No, the surprising behavior is that python lambda does not work 
exactly the way that lambda works in functional programming languages 
(see the two links provided) the confusion it creates for "normal" users 
does not warrant its inclusion in the language.

    Having said that, I must admit that I've "played" with lambda 
extensively and find it interesting from a comp sci standpoint, but, 
again, for normal users I don't think there is a really good value add 
for having it in the language.

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


#68855

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-24 03:03 -0600
Message-ID<mailman.8440.1395651801.18130.python-list@python.org>
In reply to#68851

[Multipart message — attachments visible in raw view] — view raw

On Mar 23, 2014 11:56 PM, "Mark H Harris" <harrismh777@gmail.com> wrote:
>
> On 3/22/14 4:46 AM, Steven D'Aprano wrote:
>>
>> On Fri, 21 Mar 2014 23:51:38 -0500, Mark H Harris wrote:
>>
>>> Lambda is a problem, if only because it causes confusion. What's the
>>> problem?  Glad you asked. The constructs DO NOT work the way most people
>>> would expect them to, having limited knowledge of python!
>
>
>    One of the best links for understanding what is wrong with lambda is
here, from Guido, (by the way I agree totally with his assessment, there is
no point really in writing it out again):
>
>   http://www.artima.com/weblogs/viewpost.jsp?thread=98196

That post doesn't point out anything "wrong" with lambda. The argument
boils down to: 1) map and filter are not useful because we have
comprehensions; 2) reduce is confusing; 3) if we remove those then lambda
is not useful either.

> Lambda is a problem of confusion for scientists and other mathematicians
(amateur and otherwise) who may be confused because python's lambda does
not do precisely what they might expect from other functional programming
languages, nor does it match precisely with the lambda calculus. Its also
confusing to sophisticated users of all stripes who may not be aware of
"lambda" at all.

The difference does not really lie in the lambda construct per se but in
the binding style of closures. Functional languages tend to go one way
here; imperative languages tend to go the other. Python being primarily an
imperative language follows the imperative model. Anonymous functions in
Python work the same way in this regard as anonymous functions in Lua or
ECMAScript or Go -- those other languages merely avoid the cardinal sin of
defining their anonymous functions using the keyword "lambda". The result
may be more surprising to users accustomed to functional languages, but I
claim that it is *less* surprising to users of other imperative languages.

>> Python is not a pure functional language, but you can write functional
>> code in it. If you want a pure functional language, you know where to
>> find one.
>
>
>    Yes, that's obvious; but you're missing the point. Python is not a
functional language, and implying that it can be used as one is misleading
at best (maybe a lie at worst) just because it has a construct for
generating a dynamic anonymous function.

Oh, give me a break. If you find that you can't write functional code in
Python just because closure bindings are slightly inconvenient, then you
can't be trying very hard.

>    Well, number one, I'm not demanding anything. Number two, everyone who
uses Haskell (for whatever reason) knows well from the start that its a
pure functional programming language. That is the advertisement, and that
is the expectation. No one expects anything different.

And I would hope that anybody who uses Python is likewise aware from the
stay that it *isn't* a purely functional language.

>> Python could deprecate many things. It would make Python a worse
language.
>
>
>    How so?  Read Guido's argument above. Another way to answer this
question is that I have been programming with Python for almost a decade
and I've not used lambda. In fact, I have gone out of my way to NOT use
lambda because I am fully aware that the BDFL hates it.

If lambda were going to be deprecated and removed then it already would
have happened in Python 3, because Guido tried to do precisely that. I'm
not sure what the reasons were for keeping it in the end (according to PEP
3099 it was because nobody suggested a suitable replacement), but if he
couldn't get rid of it then, he never will.

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


#68858

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-03-24 11:55 +0200
Message-ID<87bnwv2a5v.fsf@elektro.pacujo.net>
In reply to#68855
Ian Kelly <ian.g.kelly@gmail.com>:

> If lambda were going to be deprecated and removed then it already
> would have happened in Python 3, because Guido tried to do precisely
> that. I'm not sure what the reasons were for keeping it in the end
> (according to PEP 3099 it was because nobody suggested a suitable
> replacement), but if he couldn't get rid of it then, he never will.

You never *need* (Python's) lambda for anything. Inner functions are
more capable and almost always more readable. It doesn't hurt to have
lambda, but I don't find any use for it, either.


Marko

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


#68872

FromChris Angelico <rosuav@gmail.com>
Date2014-03-24 22:49 +1100
Message-ID<mailman.8446.1395661782.18130.python-list@python.org>
In reply to#68858
On Mon, Mar 24, 2014 at 8:55 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Ian Kelly <ian.g.kelly@gmail.com>:
>
>> If lambda were going to be deprecated and removed then it already
>> would have happened in Python 3, because Guido tried to do precisely
>> that. I'm not sure what the reasons were for keeping it in the end
>> (according to PEP 3099 it was because nobody suggested a suitable
>> replacement), but if he couldn't get rid of it then, he never will.
>
> You never *need* (Python's) lambda for anything. Inner functions are
> more capable and almost always more readable. It doesn't hurt to have
> lambda, but I don't find any use for it, either.

They're often not more readable. A lot of people seem to equate
"verbose" with "readable", possibly by faulty extrapolation from
unreadably crunched code with one-letter variables and no line breaks.
But which of these is truly more readable?

squares = []
for n in range(30):
    squares.append(n * n)

squares = [n * n for n in range(30)]

Similarly, there are plenty of cases where a nameless function is MUCH
clearer than breaking it out into a separate def and then using the
name once. Do you name the function for what it does internally?

def get_oneth_element_index(item):
    return item[1].index
L.sort(key=get_oneth_element_index)

Or for how you're using it?

def keyfunc(item):
    return item[1].index
L.sort(key=keyfunc)

Or do you just shortcut the whole thing by inlining it?

L.sort(key=lambda item:item[1].index)

Hey look, that's weakref.py line 941 right there. (It happens to be
the alphabetically last use of lambda in the stdlib. Made a good
example, although it'd be more common to have a space after that
colon.)

ChrisA

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


#68875

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-03-24 14:36 +0200
Message-ID<87r45rzsbj.fsf@elektro.pacujo.net>
In reply to#68872
Chris Angelico <rosuav@gmail.com>:

> Similarly, there are plenty of cases where a nameless function is MUCH
> clearer than breaking it out into a separate def and then using the
> name once. Do you name the function for what it does internally?
>
> def get_oneth_element_index(item):
>     return item[1].index
> L.sort(key=get_oneth_element_index)
>
> Or for how you're using it?
>
> def keyfunc(item):
>     return item[1].index
> L.sort(key=keyfunc)
>
> Or do you just shortcut the whole thing by inlining it?
>
> L.sort(key=lambda item:item[1].index)

I still prefer the "def" variant. It even allows you to clarify the
meaning of the tuple slot by using a nicer name.


Marko

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


#68876

FromChris Angelico <rosuav@gmail.com>
Date2014-03-24 23:53 +1100
Message-ID<mailman.8448.1395665601.18130.python-list@python.org>
In reply to#68875
On Mon, Mar 24, 2014 at 11:36 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
>> def get_oneth_element_index(item):
>>     return item[1].index
>> L.sort(key=get_oneth_element_index)
>>
>> Or do you just shortcut the whole thing by inlining it?
>>
>> L.sort(key=lambda item:item[1].index)
>
> I still prefer the "def" variant. It even allows you to clarify the
> meaning of the tuple slot by using a nicer name.

It's the index of element 1. What more do you need to know? Is it
actually any help to give that a name? All you gain is a chance for
the name, the purpose, and the functionality to come into
disagreement.

ChrisA

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


#68881

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-03-24 14:39 +0000
Message-ID<533043b7$0$29994$c3e8da3$5496439d@news.astraweb.com>
In reply to#68876
On Mon, 24 Mar 2014 23:53:12 +1100, Chris Angelico wrote:

> On Mon, Mar 24, 2014 at 11:36 PM, Marko Rauhamaa <marko@pacujo.net>
> wrote:
>>> def get_oneth_element_index(item):
>>>     return item[1].index
>>> L.sort(key=get_oneth_element_index)
>>>
>>> Or do you just shortcut the whole thing by inlining it?
>>>
>>> L.sort(key=lambda item:item[1].index)
>>
>> I still prefer the "def" variant. It even allows you to clarify the
>> meaning of the tuple slot by using a nicer name.
> 
> It's the index of element 1. What more do you need to know? Is it
> actually any help to give that a name? All you gain is a chance for the
> name, the purpose, and the functionality to come into disagreement.



# Magic constants are wicked. Never use a constant without naming it.
ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L = 1

# <summary>
#     key func used when sorting L, returns item's 1th elem index method
# </summary>
# <function_name>
#    _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L
# </function_name>
# <author>Steven D'Aprano</author>
# <date_created>2014-03-25</date_created>
# <date_modified>2014-03-25</date_modified>
# <revision>1</revision>
# <param name="item">item to be sorted</param>
# <returns>index method of the oneth element</returns>
# <raises>NameError</raises>  # FIXME can this fail any other way?
def _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L(item):
    """Private key function for sorting list L.

    Returns the index method of element 1 of the given item.

    Example of use:

    >>> item = (None, '')
    >>> _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L(item)
    <built-in method index of str object at ...>

    Relies on global constant ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L.
    May raise NameError if that constant is missing.

    Warning: do not use this for anything else.
    """
    return item[ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L].index

L.sort(key=_get_oneth_element_index_to_use_as_keyfunc_when_sorting_L)
del _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L
# Better to be safe than sorry.
del ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L




Definitely being paid by the line :-)


-- 
Steven D'Aprano
http://import-that.dreamwidth.org/

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


#68883

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-03-24 15:22 +0000
Message-ID<mailman.8451.1395674536.18130.python-list@python.org>
In reply to#68881
On 24/03/2014 14:39, Steven D'Aprano wrote:
> On Mon, 24 Mar 2014 23:53:12 +1100, Chris Angelico wrote:
>
>> On Mon, Mar 24, 2014 at 11:36 PM, Marko Rauhamaa <marko@pacujo.net>
>> wrote:
>>>> def get_oneth_element_index(item):
>>>>      return item[1].index
>>>> L.sort(key=get_oneth_element_index)
>>>>
>>>> Or do you just shortcut the whole thing by inlining it?
>>>>
>>>> L.sort(key=lambda item:item[1].index)
>>>
>>> I still prefer the "def" variant. It even allows you to clarify the
>>> meaning of the tuple slot by using a nicer name.
>>
>> It's the index of element 1. What more do you need to know? Is it
>> actually any help to give that a name? All you gain is a chance for the
>> name, the purpose, and the functionality to come into disagreement.
>
>
>
> # Magic constants are wicked. Never use a constant without naming it.
> ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L = 1
>
> # <summary>
> #     key func used when sorting L, returns item's 1th elem index method
> # </summary>
> # <function_name>
> #    _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L
> # </function_name>
> # <author>Steven D'Aprano</author>
> # <date_created>2014-03-25</date_created>
> # <date_modified>2014-03-25</date_modified>
> # <revision>1</revision>
> # <param name="item">item to be sorted</param>
> # <returns>index method of the oneth element</returns>
> # <raises>NameError</raises>  # FIXME can this fail any other way?
> def _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L(item):
>      """Private key function for sorting list L.
>
>      Returns the index method of element 1 of the given item.
>
>      Example of use:
>
>      >>> item = (None, '')
>      >>> _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L(item)
>      <built-in method index of str object at ...>
>
>      Relies on global constant ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L.
>      May raise NameError if that constant is missing.
>
>      Warning: do not use this for anything else.
>      """
>      return item[ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L].index
>
> L.sort(key=_get_oneth_element_index_to_use_as_keyfunc_when_sorting_L)
> del _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L
> # Better to be safe than sorry.
> del ELEMENT_TO_USE_FOR_INDEXING_WHEN_SORTING_L
>
> Definitely being paid by the line :-)
>

One of the finest examples of extracting the urine I've ever read. 
Please keep up the good work.  Ah but wait, down voted on the grounds 
that there are no unit tests and, far more importantly, it doesn't fit 
on one line (unless you use gg that is).  There is also no proof that 
it's been committed to your source control system after going through 
its code review.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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


#68880

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-03-24 14:21 +0000
Message-ID<mailman.8449.1395670865.18130.python-list@python.org>
In reply to#68875
On 24/03/2014 12:36, Marko Rauhamaa wrote:
> Chris Angelico <rosuav@gmail.com>:
>
>> Similarly, there are plenty of cases where a nameless function is MUCH
>> clearer than breaking it out into a separate def and then using the
>> name once. Do you name the function for what it does internally?
>>
>> def get_oneth_element_index(item):
>>      return item[1].index
>> L.sort(key=get_oneth_element_index)
>>
>> Or for how you're using it?
>>
>> def keyfunc(item):
>>      return item[1].index
>> L.sort(key=keyfunc)
>>
>> Or do you just shortcut the whole thing by inlining it?
>>
>> L.sort(key=lambda item:item[1].index)
>
> I still prefer the "def" variant. It even allows you to clarify the
> meaning of the tuple slot by using a nicer name.
>

Each to their own.  Here give me the lambda version any day of the week.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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


#68878

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-03-24 14:04 +0000
Message-ID<53303b8a$0$29994$c3e8da3$5496439d@news.astraweb.com>
In reply to#68872
On Mon, 24 Mar 2014 22:49:38 +1100, Chris Angelico wrote:

> On Mon, Mar 24, 2014 at 8:55 PM, Marko Rauhamaa <marko@pacujo.net>
> wrote:

>> You never *need* (Python's) lambda for anything. Inner functions are
>> more capable and almost always more readable. It doesn't hurt to have
>> lambda, but I don't find any use for it, either.

Marko has missed an obvious use: lambda is the *only* solution when you 
need a function embedded in an expression. You simply cannot do so 
otherwise. It is truly astonishing that two people here who are such keen 
supporters of functional programming, Marko and Mark Harris, are so 
dismissive of lambda, and so forced to write declarative code using def.


> They're often not more readable. A lot of people seem to equate
> "verbose" with "readable", possibly by faulty extrapolation from
> unreadably crunched code with one-letter variables and no line breaks.
> But which of these is truly more readable?
> 
> squares = []
> for n in range(30):
>     squares.append(n * n)
> 
> squares = [n * n for n in range(30)]

Readable for whom?

List comprehension syntax is often completely obscure to beginners. A 
beginner would say that the explicit for-loop is more readable.

Actually, a *real* beginner, whose main programming experience before 
Python was Pascal, would probably even say that the first example was an 
unreadable mess. What's range(30)? What's this ".append" business? What 
does [] mean? I know this because I was this beginner, once. The first 
few times I tried reading Python code, I couldn't make head or tail of 
it. "for" I recognised, because it was the same keyword as Pascal and 
Hypertalk use. Pretty much everything else might as well have been 
Bulgarian.

This was before the public internet, there was no Google, no tutorials I 
could look up. It was only after a colleague convinced me that it would 
be a good language to learn that I bought an actual dead tree book and 
sat down and learned how to read Python.

I think that Python's reputation of being "executable pseudo-code" is 
sometimes harmful. It fools people into thinking that unless Aunt Tilly 
can understand a language feature, it's somehow a failure. Hence the 
arguments by Mark against lambda.

http://www.catb.org/jargon/html/A/Aunt-Tillie.html

But nobody expects Aunt Tilly to read Scheme or C++ or Go without at 
least a bit of learning -- or even Esperanto or French or Latin. You 
still need to learn the syntax and the vocabulary, and have some idea of 
the basic concepts. The same applies to Python. The learning curve may be 
more gentle, but there is still a learning curve. And that is perfectly 
fine.

So while I agree with you that, to a moderately fluent Python speaker, 
not a beginner but not an expert either, the list comprehension is more 
readable, for a beginner (one who has a basic Python vocab but isn't 
fluent yet) the for-loop will probably be more readable.


> Similarly, there are plenty of cases where a nameless function is MUCH
> clearer than breaking it out into a separate def and then using the name
> once. Do you name the function for what it does internally?
> 
> def get_oneth_element_index(item):
>     return item[1].index
> L.sort(key=get_oneth_element_index)
> 
> Or for how you're using it?
> 
> def keyfunc(item):
>     return item[1].index
> L.sort(key=keyfunc)

Why not both?! Don't forget to make it private so some other piece of 
code doesn't use it. Or better still, delete it when done!

def _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L(item):
    return item[1].index

L.sort(key=_get_oneth_element_index_to_use_as_keyfunc_when_sorting_L)
del _get_oneth_element_index_to_use_as_keyfunc_when_sorting_L

Four lines of code to do what lambda lets you do in one. And people still 
insist that lambda is pointless. Maybe they're being paid by the line.


> Or do you just shortcut the whole thing by inlining it?
> 
> L.sort(key=lambda item:item[1].index)

Exactly.




-- 
Steven D'Aprano
http://import-that.dreamwidth.org/

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


#68884

FromRustom Mody <rustompmody@gmail.com>
Date2014-03-24 09:00 -0700
Message-ID<7beccf79-0036-4a90-8bc2-2afae28c1213@googlegroups.com>
In reply to#68878
On Monday, March 24, 2014 7:34:59 PM UTC+5:30, Steven D'Aprano wrote:
> On Mon, 24 Mar 2014 22:49:38 +1100, Chris Angelico wrote:

> > wrote:

> >> You never *need* (Python's) lambda for anything. Inner functions are
> >> more capable and almost always more readable. It doesn't hurt to have
> >> lambda, but I don't find any use for it, either.

> Marko has missed an obvious use: lambda is the *only* solution when you 
> need a function embedded in an expression. You simply cannot do so 
> otherwise. It is truly astonishing that two people here who are such keen 
> supporters of functional programming, Marko and Mark Harris, are so 
> dismissive of lambda, and so forced to write declarative code using def.

> > They're often not more readable. A lot of people seem to equate
> > "verbose" with "readable", possibly by faulty extrapolation from
> > unreadably crunched code with one-letter variables and no line breaks.
> > But which of these is truly more readable?
> > squares = []
> > for n in range(30):
> >     squares.append(n * n)
> > squares = [n * n for n in range(30)]

> Readable for whom?

> List comprehension syntax is often completely obscure to beginners. A 
> beginner would say that the explicit for-loop is more readable.

> Actually, a *real* beginner, whose main programming experience before 
> Python was Pascal, would probably even say that the first example was an 
> unreadable mess. What's range(30)? What's this ".append" business? What 
> does [] mean? I know this because I was this beginner, once. The first 
> few times I tried reading Python code, I couldn't make head or tail of 
> it. "for" I recognised, because it was the same keyword as Pascal and 
> Hypertalk use. Pretty much everything else might as well have been 
> Bulgarian.

> This was before the public internet, there was no Google, no tutorials I 
> could look up. It was only after a colleague convinced me that it would 
> be a good language to learn that I bought an actual dead tree book and 
> sat down and learned how to read Python.

> I think that Python's reputation of being "executable pseudo-code" is 
> sometimes harmful. It fools people into thinking that unless Aunt Tilly 
> can understand a language feature, it's somehow a failure. Hence the 
> arguments by Mark against lambda.

> http://www.catb.org/jargon/html/A/Aunt-Tillie.html

> But nobody expects Aunt Tilly to read Scheme or C++ or Go without at 
> least a bit of learning -- or even Esperanto or French or Latin. You 
> still need to learn the syntax and the vocabulary, and have some idea of 
> the basic concepts. The same applies to Python. The learning curve may be 
> more gentle, but there is still a learning curve. And that is perfectly 
> fine.

Ok so far

> So while I agree with you that, to a moderately fluent Python speaker, 
> not a beginner but not an expert either, the list comprehension is more 
> readable, for a beginner (one who has a basic Python vocab but isn't 
> fluent yet) the for-loop will probably be more readable.

And now I wonder...
The case you are wanting to make and the case you are ending up making
seem to be opposite: 

If it is so as you say that for "the beginner (one who has a basic 
Python vocab but isn't fluent yet)"
the for-loop is more readable than the for-in-compr
it then suggests that those more experienced taking/helping the
beginners at 0 to the stage of "basic vocab-but-not-yet fluent" are
choosing a sub-optimal route.

Remember that you started by reminding that for an absolute beginner,
everything is 'Bulgarian' not just list comprehensions.

Then how come some things become accessible faster than others?
It may be that those things are actually easier (in some objective sense)
But it may also reveal a prejudice of the teachers.

As for the other argument -- python lambda is BAD -- Ive currently run out of pepper for sprinkling on these flames :-)
I'll just make a few points:

1. Miranda the predecessor of Haskell had no lambda.
Local defs + curried convention + operator sections was considered more than 
sufficient for functional programming

2. Lisp was the originator of lambda (in programming languages) and it screwed up the semantics so badly that
 a. It had to be corrected at high cost 25 years later -- aka scheme and common lisp
 b. Some doyens of functional programming have suggested that lisp is a major setback for the acceptance of functional programming, eg
http://www.cs.kent.ac.uk/people/staff/dat/miranda/wadler87.pdf

3. One basic tenet of λ calculus
foo = λ x . exp
is equivalent to the more traditional
foo(x) = exp

is a little uh-uh in haskell thanks to the notorious monomorphism restriction
http://www.haskell.org/haskellwiki/Monomorphism_restriction

So if FP = λ calculus, Haskell does not quite make it!!
 

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


#68893

FromChris Angelico <rosuav@gmail.com>
Date2014-03-25 06:12 +1100
Message-ID<mailman.8457.1395688376.18130.python-list@python.org>
In reply to#68878
On Tue, Mar 25, 2014 at 1:04 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
>> But which of these is truly more readable?
>>
>> squares = []
>> for n in range(30):
>>     squares.append(n * n)
>>
>> squares = [n * n for n in range(30)]
>
> Readable for whom?
>
> List comprehension syntax is often completely obscure to beginners. A
> beginner would say that the explicit for-loop is more readable.
>
> Actually, a *real* beginner, whose main programming experience before
> Python was Pascal, would probably even say that the first example was an
> unreadable mess. What's range(30)? What's this ".append" business? What
> does [] mean? I know this because I was this beginner, once. The first
> few times I tried reading Python code, I couldn't make head or tail of
> it. "for" I recognised, because it was the same keyword as Pascal and
> Hypertalk use. Pretty much everything else might as well have been
> Bulgarian.

Actually, that's a very good point. Python's for loop is more often
called a foreach loop in other languages, and Python completely lacks
any concept of a "classic" iteration-over-integer for loop. That is a
point of confusion. However, that's going to come up on both branches,
so it's not really a mark against either.

Incidentally, I've often modified my loop counter, in C or REXX or any
other language. About the only situation where I actually miss it in
Python, though, is iterating over a list and mutating the list on the
way through; and even that can often be done in other ways (maybe a
list comp, filtering out some of the elements?). It's amazing how
something can be so utterly fundamental (I mean, come ON! Who can
imagine a language with no equivalent of the basic "do i=1 to 10"
(REXX) or "for (int i=0;i<10;++i)" (C++) loop???) and yet so
dispensable.

ChrisA

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


#68897

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-24 13:42 -0600
Message-ID<mailman.8461.1395690172.18130.python-list@python.org>
In reply to#68878
On Mon, Mar 24, 2014 at 1:12 PM, Chris Angelico <rosuav@gmail.com> wrote:
> Incidentally, I've often modified my loop counter, in C or REXX or any
> other language. About the only situation where I actually miss it in
> Python, though, is iterating over a list and mutating the list on the
> way through; and even that can often be done in other ways (maybe a
> list comp, filtering out some of the elements?). It's amazing how
> something can be so utterly fundamental (I mean, come ON! Who can
> imagine a language with no equivalent of the basic "do i=1 to 10"
> (REXX) or "for (int i=0;i<10;++i)" (C++) loop???) and yet so
> dispensable.

I'm not sure "fundamental" is the right word.  A for loop is just a
while loop with some syntactic sugar.  For that matter, a while loop
is just a structured goto...

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


#68901

FromChris Angelico <rosuav@gmail.com>
Date2014-03-25 06:57 +1100
Message-ID<mailman.8464.1395691042.18130.python-list@python.org>
In reply to#68878
On Tue, Mar 25, 2014 at 6:42 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Mon, Mar 24, 2014 at 1:12 PM, Chris Angelico <rosuav@gmail.com> wrote:
>> Incidentally, I've often modified my loop counter, in C or REXX or any
>> other language. About the only situation where I actually miss it in
>> Python, though, is iterating over a list and mutating the list on the
>> way through; and even that can often be done in other ways (maybe a
>> list comp, filtering out some of the elements?). It's amazing how
>> something can be so utterly fundamental (I mean, come ON! Who can
>> imagine a language with no equivalent of the basic "do i=1 to 10"
>> (REXX) or "for (int i=0;i<10;++i)" (C++) loop???) and yet so
>> dispensable.
>
> I'm not sure "fundamental" is the right word.  A for loop is just a
> while loop with some syntactic sugar.  For that matter, a while loop
> is just a structured goto...

Of course, and function calls are just stack operations and gotos too.
That's not what makes it fundamental - I'm talking at a source code
level. Can you imagine a high level language without a simple notation
for variable assignment? Certainly not. [1] Variable assignment, name
binding, whatever you call it, is fundamental. Some kind of structured
looping is also pretty critical; you don't see languages that force
you to use bare goto everywhere and call themselves "high level". [2]
Every high level language also needs some way to iterate over numbers.
Most of them provide it as an intrinsic; Python happens to do it as a
foreach over an easily-constructed iterable.

ChrisA

[1] DeScribe Macro Language would borderline-fail this test if I
called it a HLL. It has "SET something TO somevalue". But DML is about
on the level of Python's "dis.dis" output - assembly language for a
byte-code interpreter.
[2] DML passes this test, even. It has a block IF/ELSE/END IF
statement, and a REPEAT/END REPEAT for looping, with the loop
condition being provided by a statement "EXIT WHEN condition" that's
like Python's "if condition: break". Mind you, it also provides
language-level support for message boxes, including prompt boxes (ask
the user to provide a string or integer), so it's a bit of an odd
duck.

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


#68958

FromSteven D'Aprano <steve@pearwood.info>
Date2014-03-25 05:28 +0000
Message-ID<533113fd$0$29878$c3e8da3$5496439d@news.astraweb.com>
In reply to#68901
On Tue, 25 Mar 2014 06:57:19 +1100, Chris Angelico wrote:

> Can you imagine a high level language without a simple notation for
> variable assignment? Certainly not.

I don't know... what a stack based or concatenative language like Forth, 
Postscript, Joy or Factor count as high-level?

I'm pretty sure Joy and Factor should. Perhaps not Forth or Postscript.

Some of these language may offer variable assignment, but using it is 
entirely optional. It's a convenience, nothing more.



-- 
Steven

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


#68965

FromChris Angelico <rosuav@gmail.com>
Date2014-03-25 16:43 +1100
Message-ID<mailman.8494.1395726224.18130.python-list@python.org>
In reply to#68958
On Tue, Mar 25, 2014 at 4:28 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> On Tue, 25 Mar 2014 06:57:19 +1100, Chris Angelico wrote:
>
>> Can you imagine a high level language without a simple notation for
>> variable assignment? Certainly not.
>
> I don't know... what a stack based or concatenative language like Forth,
> Postscript, Joy or Factor count as high-level?
>
> I'm pretty sure Joy and Factor should. Perhaps not Forth or Postscript.
>
> Some of these language may offer variable assignment, but using it is
> entirely optional. It's a convenience, nothing more.

Ah, sorry. I meant in languages that do have a concept of variable
assignment. Yes, some don't have it at all, so of course they don't
offer any notation for it. But any reasonably modern symbolic language
is not going to have a long and wordy notation for assignment, because
assignment is so common. It's language design Huffman coding: the
features programmers are expected to use frequently are given
convenient notations. A stack-based language will have extremely
convenient notations for "push this onto the stack", something like
"Put potatoes into the mixing bowl. Put dijon mustard into the mixing
bowl. Put lard into the mixing bowl." (okay, so Chef might not be the
best language to demonstrate this with!).

A basic iterative for loop is considered extremely common. C has a
highly compact notation that packs three parts into a simple header;
REXX has a more piece-meal approach whereby "DO I=start" can be
followed by any combination of "TO stop", "BY step", "WHILE
condition", "UNTIL condition", and "FOR count", each of which has the
same effect on its own or in combination with others. (I think WHILE
and UNTIL might be incompatible with each other, but none of the
others conflict. Having TO and FOR in the same loop header means it'll
stop when either condition is reached.) And Python doesn't have any
such construct, but *only* a 'foreach'. That's what I was talking
about; and yet it works quite nicely.

ChrisA

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


#68888

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-24 11:24 -0600
Message-ID<mailman.8453.1395681883.18130.python-list@python.org>
In reply to#68858
On Mon, Mar 24, 2014 at 3:55 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Ian Kelly <ian.g.kelly@gmail.com>:
>
>> If lambda were going to be deprecated and removed then it already
>> would have happened in Python 3, because Guido tried to do precisely
>> that. I'm not sure what the reasons were for keeping it in the end
>> (according to PEP 3099 it was because nobody suggested a suitable
>> replacement), but if he couldn't get rid of it then, he never will.
>
> You never *need* (Python's) lambda for anything. Inner functions are
> more capable and almost always more readable. It doesn't hurt to have
> lambda, but I don't find any use for it, either.

So what? One might say the same thing about comprehensions -- loops
are more capable and almost always more readable.

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


#68907

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-24 16:43 -0500
Message-ID<lgq8th$nj4$1@speranza.aioe.org>
In reply to#68855
On 3/24/14 4:03 AM, Ian Kelly wrote:
>
> The difference does not really lie in the lambda construct per se but in
> the binding style of closures. Functional languages tend to go one way
> here; imperative languages tend to go the other. {snip}

> The result may be more surprising to users accustomed to functional
> languages, but I claim that it is *less* surprising to users of other
> imperative languages.

    Aside from the sin of spelling out "lambda,"
       should be   ( \x y -> x + y ) a b )  but, neither here nor there...

    Yes, its about closures, totally;  the most confusing aspect of 
lambda in python is not only the syntax but the idea of scope and 
closure (for that syntax).  Everyone is confused by this initially, not 
because its complicated, but because its confusing.  An example:

>>>>
>>>> adders= list(range(4))
>>>> adders
> [0, 1, 2, 3]
>>>> for n in adders:
> 	adders[n]=lambda a: a+n
>
> 	
>>>> print(adders[1](3))
> 6
>>>>

    The expected value as perceived by "normal" people is 4.

    This comes up on the list over and again year after year in various 
flavors, but always because lambda is unnecessarily confusing where it 
comes to how does it function; and by that we mean simply, how does 
scope and closure work in this context. Once the "normal" person is 
introduced to the scope and closure idiosyncrasies of pythons lambda, 
well then everything is much smoother. But how to fix?  Consider:

>>>>
>>>> adders= list(range(4))
>>>> adders
> [0, 1, 2, 3]
>>>> for n in adders:
> 	adders[n] = (lambda b: lambda a: b + a)(n)
>
> 	
>>>> adders[1](3)
> 4
>>>> adders[2](3)
> 5
>>>>

    Now, here is where I talk about confusion; explaining why the first 
lambda above does not work because of scope and closure, and then even 
worse, explaining why the second "double" lambda works in the lower 
example!

    Its a nightmare, really.

    And you are correct, its really about closure.

marcus


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


Page 2 of 21 — ← Prev page 1 [2] 3 4 … 21  Next page →

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


csiph-web