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 20 of 21 — ← Prev page 1 … 18 19 [20] 21  Next page →


#68744

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-03-22 04:47 +0000
Message-ID<532d15e8$0$29994$c3e8da3$5496439d@news.astraweb.com>
In reply to#68732
On Fri, 21 Mar 2014 19:06:06 -0700, Rustom Mody wrote:

> Two: A comprehension variable is not bound but reassigned across the
> comprehension. This problem remains in python3 and causes weird behavior
> when lambdas are put in a comprehension

I don't know why you say the behaviour in Python is a problem. It's 
somewhat unexpected if you don't think about what's going on, but it's 
actually quite logical. On the contrary, I find the Haskell version weird.


>>>> fl = [lambda y : x+y for x in [1,2,3]] 
>>>> [fl[i](2) for i in [0,1,2]]
> [5, 5, 5]

This makes perfect sense: by the time you call the functions, the name x 
has been rebound to the value 3. If x were a global, or if comprehensions 
leaked their variable, that would be obvious: you could print x and see 
exactly what value it has. But visible or not, that's exactly what 
happens. Since x is 3, you're adding 3+2 and should get 5 no matter which 
function you call.

Unroll the first comprehension, and it's obvious what is going on:

def unrolled():
    fl = []
    x = 0
    def lambda_(y):
        return x + y
    fl.append(lambda_)
    x = 1
    def lambda_(y):
        return x + y
    fl.append(lambda_)
    x = 2
    def lambda_(y):
        return x + y
    fl.append(lambda_)
    return [f(2) for f in fl]

Don't be fooled by the coincidence that the three "lambda_" functions 
have the same name and body. They could have different names and 
different bodies, Either way, it is completely natural that they all 
closures over the same x -- that's how you wrote them.


But the Haskell version, on the other hand, is just weird:

> The same in haskell:
> 
> Prelude> let fl = [\ y -> x + y | x <- [1,2,3]] 
> Prelude> [(fl!!i) 0 | i<- [0,1,2]]
> [1,2,3]

For this to be the case, the functions in fl have to somehow "look back 
in time" to see the value of x, not as it is *now* when the function is 
called, but how it *was* when it was created. That's very weird indeed. 
If x were a global, it would be astonishing. The fact that x comes from a 
closure instead makes it no less surprising. Unroll the loop, and the 
magic is obvious.

Now I'm not sure precisely how Haskell implements this trick, but it 
suggests to me that it creates a different closure each time around the 
loop of the comprehension. That could end up being very expensive.



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

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


#68748

FromChris Angelico <rosuav@gmail.com>
Date2014-03-22 16:05 +1100
Message-ID<mailman.8383.1395464733.18130.python-list@python.org>
In reply to#68744
On Sat, Mar 22, 2014 at 3:47 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Now I'm not sure precisely how Haskell implements this trick, but it
> suggests to me that it creates a different closure each time around the
> loop of the comprehension. That could end up being very expensive.

It needn't be terribly expensive, if you make a "scope stack" or
"scope chain". Imagine, if you will, a system of scopes like this:

current_scope = None
class Scope:
    def __init__(self, *a, **kw):
        self.names = dict(*a, **kw)
        global current_scope
        self.parent = current_scope
        current_scope = self
    def __getitem__(self, name):
        try:
            return self.names[name]
        except KeyError:
            if self.parent is None: raise
            return self.parent[name]
    def __setitem__(self, name, value):
        self.names[name] = value
def exit_scope():
    global current_scope
    current_scope = current_scope.parent

Creating a new scope would be fairly cheap (and a lot more so if this
were implemented in C without the object overhead, of course). Lookups
would scan up through a series of namespaces, same as they currently
do (local, module, builtins), there'd just be more of them. And the
compiler could be smart enough to skip creating a scope if there are
no assignments. There'd need to be some handling in there for the
'nonlocal' keyword, but my expectation is that 'global' is handled by
retaining a reference to the current_scope at module level, and
starting the search there for a LOAD_GLOBAL.

Each iteration of the loop could begin with Scope() and end with
exit_scope(), and there you are, each iteration in its own closable
scope.

I'm not saying it would be a good thing to do - and it'd be a bad fit
for Python, I think, as I said in my other post - but it could be
done.

ChrisA

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


#68761

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-03-22 12:24 +0200
Message-ID<87zjki4jkg.fsf@elektro.pacujo.net>
In reply to#68744
Steven D'Aprano <steve+comp.lang.python@pearwood.info>:

> This makes perfect sense: by the time you call the functions, the name x 
> has been rebound to the value 3.

> [...]

> Now I'm not sure precisely how Haskell implements this trick, but it
> suggests to me that it creates a different closure each time around
> the loop of the comprehension. That could end up being very expensive.

Haskell does not rebind variables. I guess Haskell simply physically
substitutes object references for each syntactic occurrence of a
variable.

If Python worked analogously, the following loop:

   for i, x in enumerate([1, 2, 3]):
       f[i] = lambda y: x + y

would unroll as follows:

   f[0] = lambda y: 1 + y
   f[1] = lambda y: 2 + y
   f[2] = lambda y: 3 + y

That is actually how classic lambda calculus does it. Variables are
substituted, not "bound" or "assigned". They are syntactic slots. There
is no heap, there is no stack, there is no memory apart from the
expression itself.


Marko

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


#68756

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-03-22 03:09 -0600
Message-ID<mailman.8388.1395479446.18130.python-list@python.org>
In reply to#68732
On Fri, Mar 21, 2014 at 8:06 PM, Rustom Mody <rustompmody@gmail.com> wrote:
> Two: A comprehension variable is not bound but reassigned across the
> comprehension. This problem remains in python3 and causes weird behavior when
> lambdas are put in a comprehension

Because Python as a language only has the concept of assignment, not
binding.  I think it would be weird and confusing if variables worked
this way in comprehensions and nowhere else.

> >>> fl = [lambda y : x+y for x in [1,2,3]]
> >>> [fl[i](2) for i in [0,1,2]]
> [5, 5, 5]

You can get the desired effect by adding a layer of indirection:

>>> fl = [(lambda x: lambda y: x+y)(x) for x in [1,2,3]]
>>> [f(2) for f in fl]
[3, 4, 5]

If that's too ugly then give the wrapper a proper name:

>>> def make_function(x):
...     return lambda y: x+y
...
>>> fl = [make_function(x) for x in [1,2,3]]
>>> [f(2) for f in fl]
[3, 4, 5]

There is also the default argument trick:

>>> fl = [lambda y, *, x=x: x+y for x in [1,2,3]]
>>> [f(2) for f in fl]
[3, 4, 5]

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


#68762

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-03-22 12:30 +0200
Message-ID<87vbv64jaz.fsf@elektro.pacujo.net>
In reply to#68756
Ian Kelly <ian.g.kelly@gmail.com>:

> You can get the desired effect by adding a layer of indirection:
>
>>>> fl = [(lambda x: lambda y: x+y)(x) for x in [1,2,3]]

A trick to remember! Variable lifetime reduction by function invocation.


Marko

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


#68782

FromRustom Mody <rustompmody@gmail.com>
Date2014-03-22 10:16 -0700
Message-ID<891df3fe-2cd8-4615-9f9c-0e6f62af764a@googlegroups.com>
In reply to#68756
On Saturday, March 22, 2014 2:39:56 PM UTC+5:30, Ian wrote:
> On Fri, Mar 21, 2014 at 8:06 PM, Rustom Mody  wrote:
> > Two: A comprehension variable is not bound but reassigned across the
> > comprehension. This problem remains in python3 and causes weird behavior when
> > lambdas are put in a comprehension

> Because Python as a language only has the concept of assignment, not
> binding.  I think it would be weird and confusing if variables worked
> this way in comprehensions and nowhere else.

Bizarre viewpoint!

When you do this:

> There is also the default argument trick:

> >>> fl = [lambda y, *, x=x: x+y for x in [1,2,3]]
> >>> [f(2) for f in fl]
> [3, 4, 5]

how is that not-a-binding solution?

More generally, insofar as variable-scopes can be made and exited, there
is binding.  Its just that imperative languages have
- assignment wherein the shape of the environment is preserved but 
its content is changed 
- there are binding-constructs -- functions, methods, classes etc etc
-- which leave extant bindings intact but create/remove new ones.

Ok, functional languages have only the latter.
But only the former?? Beyond assembly language I dont know what 
that would/could be...

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


#68763

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-03-22 10:40 +0000
Message-ID<mailman.8390.1395484871.18130.python-list@python.org>
In reply to#68732
On 22/03/2014 02:06, Rustom Mody wrote:
>
> The same in haskell:
>
> Prelude> let fl = [\ y -> x + y | x <- [1,2,3]]
> Prelude> [(fl!!i) 0 | i<- [0,1,2]]
> [1,2,3]
>

My really big complaint about Python is that it's nothing like CORAL 66. 
  I think I'll raise this on python ideas in an attempt to get this 
glaring deficiency corrected.

-- 
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]


#68786

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-03-22 17:57 +0000
Message-ID<mailman.8404.1395511066.18130.python-list@python.org>
In reply to#68732
On 22/03/2014 09:09, Ian Kelly wrote:
> On Fri, Mar 21, 2014 at 8:06 PM, Rustom Mody <rustompmody@gmail.com> wrote:
>> Two: A comprehension variable is not bound but reassigned across the
>> comprehension. This problem remains in python3 and causes weird behavior when
>> lambdas are put in a comprehension
>
> Because Python as a language only has the concept of assignment, not
> binding.  I think it would be weird and confusing if variables worked
> this way in comprehensions and nowhere else.
>

My understanding has always been that an expression of the rhs is bound 
to a name of the lhs.  So is my understanding wrong, or is the above 
wrong, or are we talking at cross purposes, or what?

-- 
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]


#68788

FromMarko Rauhamaa <marko@pacujo.net>
Date2014-03-22 20:40 +0200
Message-ID<87mwgi3wlv.fsf@elektro.pacujo.net>
In reply to#68786
Mark Lawrence <breamoreboy@yahoo.co.uk>:

> On 22/03/2014 09:09, Ian Kelly wrote:
>> Because Python as a language only has the concept of assignment, not
>> binding. I think it would be weird and confusing if variables worked
>> this way in comprehensions and nowhere else.
>
> My understanding has always been that an expression of the rhs is
> bound to a name of the lhs. So is my understanding wrong, or is the
> above wrong, or are we talking at cross purposes, or what?

Hard to say without knowing more of your understanding.

Even Scheme doesn't have purely classical variable binding because
variables can be assigned to. You will notice that right away when you
try to implement a lisp dialect; a purely binding (substituting)
implementation fails with set!/setq because there is no variable to
assign a value to.

Python variables are named memory slots you can peek and poke into. Not
so in a purely functional language where variables are physically
removed from the code before the code is executed.

Example:

    def redouble(x):
        return x + x

    redouble(17 + 4)

If Python were simply binding variables in the purely functional sense,
the interpreter would first evaluate 17 + 4 and then make a copy of the
"redouble" function substituting the result (21) for each syntactic
occurrence of x:

    def __redouble__234001942():
        return 21 + 21

The interpreter would then proceed to evaluate the variable-less
function instance.

If you leave out assignment, there is really no difference between the
two models. Only if you don't have assignment, you don't need to
complicate your computational model with memory. Instead, you deal with
things like continuations.

In fact, even "def" violates the classic functional paradigm. For
example, to calculate 10's factorial without assignments, you can do
this (even in Python):

   (lambda n: (lambda fac: fac(fac, n)) \
      (lambda fac, n: 1 if n < 2 else n * fac(fac, n - 1)))(10)


Marko

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


#68789

FromRustom Mody <rustompmody@gmail.com>
Date2014-03-22 11:42 -0700
Message-ID<6fa40395-e8db-4597-ab8e-546132595586@googlegroups.com>
In reply to#68786
The foll is fairly standard fare in denotational semantics -- please excuse
the length!

In order to understand (formally) the concept of 'variable'
we need to have at the least a concept of name(or identifier) -> value mapping.
This mapping is called an 'environment'

If we stop at that we get the 'simplest' (at least from a mathematical
pov!!) language -- λ calculus.

However programming languages also need to be implemented -- typically
on von Neumann machines. So we make 'Variable' a composition of two functions:
Env   : Identifier -> Location
Store : Location -> Value

This seems fine and dandy until we realize that if the compositon is of
non one-one onto functions all kinds of troubles result; eg
-- Two locations going to one value -- aliasing
-- Store partial at a location -- uninitialized variable
etc etc the most innocuous looking…
-- assignment becomes a higher order function
because it converts a starting id -> -> value mapping to a new mapping


Seeing all these difficulties, some religious zealots (aka functional
programmers) decide that this composite mapping is the root of the problem
-- throw it out -- no aliasing, no assignment, no time. [Minor problem --
How to implement -- remains!]

The non-religious bigots (also called C programmers) see that managing
the Env at one time and the Store at a later time (the two times
are usually called compile-time and run-time but like bell-bottoms these
words are currently unfashionable!) can produce very effective engineering
expedience.

So strictly speaking whenever we have variables we have binding
[Probably mathematica is an exception... dunno for sure]

More loosely and conventionally if the mapping is a single direct one:
Env: Variable -> Value
as in λ calculus, functional languages etc, they are called binding-languages

To distinguish, the 'other' languages which need a 
compose of Environment and Store are called variously:

- imperative language
- reference semantics
- conventional (imperative) variable (vs mathematical variable)
etc

IOW in most (normal) languages we have constructs to change the shape
of the environment and we have constructs to change the content of the
environment. The single pre-eminent way for the latter is assignment,
function is the typical way for the former.

[Unfortunately this is not universally true:
In C we have initialized variables that look like assignment but is not.
In python the exception is what Ian calls the default variable trick:
x=x would be a rather asinine assignment. But its not an assignment at all,
it just looks like one]

So no...

> My understanding has always been that an expression of the rhs is bound 
> to a name of the lhs.  So is my understanding wrong, or is the above 
> wrong, or are we talking at cross purposes, or what?

assignment changes the content of the env, functions change the shape
-- which latter you may call binding.

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


#69003

From88888 Dihedral <dihedral88888@gmail.com>
Date2014-03-25 03:17 -0700
Message-ID<7dd79fea-37c9-4c61-bcb7-22bb5b58b67b@googlegroups.com>
In reply to#68715
> >>> x = [[1, 2], [3, 4]]
> 
> >>> for x in x:
> 
> ...     for x in x:
> 
> ...         print(x)
> 
This is valid in the syntax level 
in python. But it is only good
for those  writing obscure programs in 
my opinions at most team works. 

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


#68717 — Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2014-03-22 10:34 +1300
SubjectRe: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)
Message-ID<bp3pjnFscpsU1@mid.individual.net>
In reply to#68714
Rustom Mody wrote:

> A 'for' introduces a scope:

No, it doesn't!

>>>>x = 42
>>>>for x in [1,2,3]:
> ...   print x
> ... 
> 1
> 2
> 3
> 
> No sign of the 42 --v ie the outer x -- inside because of scope

You're right that there's no sign of the 42, but it's
*not* because of scope, as you'll see if you do one
more print:

 >>> print x
3

> And so we can do:
> 
> 
>>>>x = [1,2,3]
>>>>for x in x:
> ...   print x
> ... 
> 1
> 2
> 3

Again, if you print x after the loop has finished,
you'll find that it's no longer bound to the original
list. This is because Python's for-loop does *not*
introduce a new scope -- there's only one x, and
the for-loop is sharing it with the rest of the code.

The real question is why the for-loop works in *spite*
of this fact.

The answer is that the for-loop machinery keeps an
internal reference to the list being iterated over,
so once the loop has started, it doesn't matter what
x is bound to any more.

-- 
Greg

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


#68795

Fromvasudevram <vasudevram@gmail.com>
Date2014-03-22 13:59 -0700
Message-ID<8aa0b833-e7b7-485b-8258-c59eebdace93@googlegroups.com>
In reply to#68711
Thanks to all those who answered.

- Vasudev

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


#68930

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-24 20:56 -0500
Message-ID<lgqnoc$p9e$1@speranza.aioe.org>
In reply to#68795
On 3/22/14 3:59 PM, vasudevram wrote:
>
> Thanks to all those who answered.
>
> - Vasudev

I am wondering if the question was answered?


>>>>
>>>> x = [[1,2],[3,4],[5,6]]
>>>> import ast
>>>> ast.dump(ast.parse('[x for x in x for x in x]'))
 >
> "Module(body=
 >
> [Expr(value=ListComp(elt=Name(id='x', ctx=Load()),
 >
> generators=
 >
> [comprehension(target=Name(id='x', ctx=Store()), iter=Name(id='x', ctx=Load()), ifs=[]),
 >
> comprehension(target=Name(id='x', ctx=Store()), iter=Name(id='x', ctx=Load()), ifs=[])]))])"
>>>>

This is really, I think, the answer to the OPs question. Knowing how 
python is parsing the comprehension of comprehensions is important, yes?

Obviously each x is within a different scope, within a separate 
iterator. This seems to unwind from right to left?

I didn't see any ast entries in the thread, so just wondering.

marcus

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


#69226

FromDan Stromberg <drsalists@gmail.com>
Date2014-03-27 16:45 -0700
Message-ID<mailman.8641.1395963929.18130.python-list@python.org>
In reply to#68711
On Fri, Mar 21, 2014 at 1:42 PM, vasudevram <vasudevram@gmail.com> wrote:
> Can anyone - maybe one of the Python language core team, or someone with knowledge of the internals of Python - can explain why this code works, and whether the different occurrences of the name x in the expression, are in different scopes or not? :
>
> x = [[1,2], [3,4], [5,6]]
>     [x for x in x for x in x]

I'll give this +1 for playfulness, and -2 for lack of clarity.

I hope no one thinks this sort of thing is good to do in real-life code.

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


#69286 — How to flatten a list of lists was (Explanation of this Python language feature?)

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-28 17:00 -0500
SubjectHow to flatten a list of lists was (Explanation of this Python language feature?)
Message-ID<5335F0FB.3040904@gmail.com>
In reply to#69226
On 3/27/14 6:45 PM, Dan Stromberg wrote:
> On Fri, Mar 21, 2014 at 1:42 PM, vasudevram <vasudevram@gmail.com> wrote:
>> Can anyone - maybe one of the Python language core team,
>>or someone with knowledge of the internals of Python - can
>>explain why this code works, and whether the different
>>occurrences of the name x in the expression, are in
>>different scopes or not? :
>>
>> x = [[1,2], [3,4], [5,6]]
>>      [x for x in x for x in x]
>
> I'll give this +1 for playfulness, and -2 for lack of clarity.
>
> I hope no one thinks this sort of thing is good to do in real-life code.
>

You might try this to flatten a list of lists:

 >>> from functools import reduce

 >>> import operator

 >>> import operator as λ

 >>> reduce(λ.add, l)

[1, 2, 3, 4, 5, 6, 7, 8, 9]
 >>>


marcus

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


#69287 — How to flatten a list of lists was (Explanation of this Python language feature?)

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-28 17:00 -0500
SubjectHow to flatten a list of lists was (Explanation of this Python language feature?)
Message-ID<mailman.8674.1396044046.18130.python-list@python.org>
In reply to#69226
On 3/27/14 6:45 PM, Dan Stromberg wrote:
> On Fri, Mar 21, 2014 at 1:42 PM, vasudevram <vasudevram@gmail.com> wrote:
>> Can anyone - maybe one of the Python language core team,
>>or someone with knowledge of the internals of Python - can
>>explain why this code works, and whether the different
>>occurrences of the name x in the expression, are in
>>different scopes or not? :
>>
>> x = [[1,2], [3,4], [5,6]]
>>      [x for x in x for x in x]
>
> I'll give this +1 for playfulness, and -2 for lack of clarity.
>
> I hope no one thinks this sort of thing is good to do in real-life code.
>

You might try this to flatten a list of lists:

 >>> from functools import reduce

 >>> import operator

 >>> import operator as λ

 >>> reduce(λ.add, l)

[1, 2, 3, 4, 5, 6, 7, 8, 9]
 >>>


marcus

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


#69288 — To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-28 17:05 -0500
SubjectTo flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]
Message-ID<5335F21B.1060702@gmail.com>
In reply to#69226
On 3/27/14 6:45 PM, Dan Stromberg wrote:
>>
>> x = [[1,2], [3,4], [5,6]]
>>      [x for x in x for x in x]
>
> I'll give this +1 for playfulness, and -2 for lack of clarity.
>
> I hope no one thinks this sort of thing is good to do in real-life code.
>

You might try this to flatten a list of lists:

 >>> from functools import reduce

 >>> L = [[1,2,3],[4,5,6],[7],[8,9]]

 >>> import operator as λ

 >>> reduce(λ.add, L)
[1, 2, 3, 4, 5, 6, 7, 8, 9]

 >>>


marcus

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


#69293 — Re: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2014-03-29 02:31 +0000
SubjectRe: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]
Message-ID<53363088$0$29994$c3e8da3$5496439d@news.astraweb.com>
In reply to#69288
On Fri, 28 Mar 2014 17:05:15 -0500, Mark H Harris wrote:

> You might try this to flatten a list of lists:

We got that the first four times you posted it. No need for a fifth. 


>  >>> from functools import reduce
>  >>> L = [[1,2,3],[4,5,6],[7],[8,9]]
>  >>> import operator as λ

Why would you name the operator module the Greek letter l? Why not the 
Armenian letter Ւ (yiwn)? That's pure obfuscation. The operator module has 
nothing to do with "l", and nothing to do with Greek lambda.

This is exactly the sort of foolish obfuscation that opponents warned 
about when Python first introduced support for non-ASCII identifiers.



>  >>> reduce(λ.add, L)
> [1, 2, 3, 4, 5, 6, 7, 8, 9]

Furthermore, this is a very inefficient way of flattening a nested list. 
Doubling the size of the list quadruples the time taken; increasing the 
size by a factor of 10 increases the time by a factor of more than 100:


py> from operator import add
py> from functools import reduce
py> L = [[1]]*10000
py> with Stopwatch():  # code for this available on request
...     x = reduce(add, L)
...
time taken: 0.348851 seconds
py> L = [[1]]*100000
py> with Stopwatch():
...     x = reduce(add, L)
...
time taken: 41.344467 seconds



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

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


#69301 — Re: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]

FromMark H Harris <harrismh777@gmail.com>
Date2014-03-28 22:33 -0500
SubjectRe: To flatten a nested list was (Explanation of this Python language feature? [x for x in x for x in x]
Message-ID<lh5ev3$cp9$1@speranza.aioe.org>
In reply to#69293
On 3/28/14 9:31 PM, Steven D'Aprano wrote:
> On Fri, 28 Mar 2014 17:05:15 -0500, Mark H Harris wrote:

>>   >>> from functools import reduce
>>   >>> L = [[1,2,3],[4,5,6],[7],[8,9]]
>>   >>> import operator as λ

>>   >>> reduce(λ.add, L)
>> [1, 2, 3, 4, 5, 6, 7, 8, 9]
>
> Furthermore, this is a very inefficient way of flattening a nested list.

    Again, its just another way. Its just playful hacking. The serious 
point behind it ( I am able to do anything I want with the language ), I 
mean that is kinda the whole point. For anyone to actually use my little 
hack they need to know that reduce is in functools (right) then they 
need to understand 'reduce' which is a nightmare, and then they need to 
know why chose the symbol  λ  (which was for no other reason than fun. 
Lastly, they would want to flatten a list without

    [x for x in x for x in x]


:)


    The following is a strawman; YOU build it up, to tear it down/

> py> from operator import add
> py> from functools import reduce
> py> L = [[1]]*10000    <===================  my list didn't have ten thousand items

> py> with Stopwatch():  # code for this available on request
> ...     x = reduce(add, L)
> ...
> time taken: 0.348851 seconds
> py> L = [[1]]*100000    <=============  much less one hundred thousand items
> py> with Stopwatch():
> ...     x = reduce(add, L)
> ...
> time taken: 41.344467 seconds     <====  time is an illusion, ask Einstein/


    (Steven, it was all tongue in cheek, just for fun...  )


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


Page 20 of 21 — ← Prev page 1 … 18 19 [20] 21  Next page →

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


csiph-web