Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98999 > unrolled thread
| Started by | fl <rxjwg98@gmail.com> |
|---|---|
| First post | 2015-11-18 13:08 -0800 |
| Last post | 2015-11-25 03:11 +1100 |
| Articles | 20 on this page of 198 — 24 participants |
Back to article view | Back to comp.lang.python
What is a function parameter =[] for? fl <rxjwg98@gmail.com> - 2015-11-18 13:08 -0800
Re: What is a function parameter =[] for? John Gordon <gordon@panix.com> - 2015-11-18 22:05 +0000
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-18 15:11 -0700
Re: What is a function parameter =[] for? Grant Edwards <invalid@invalid.invalid> - 2015-11-18 22:33 +0000
Re: What is a function parameter =[] for? fl <rxjwg98@gmail.com> - 2015-11-18 14:38 -0800
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-18 15:47 -0700
Re: What is a function parameter =[] for? fl <rxjwg98@gmail.com> - 2015-11-18 14:48 -0800
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-18 23:14 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-19 10:22 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 01:41 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-19 12:59 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 11:41 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-19 22:58 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-19 23:45 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-19 08:42 -0700
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-22 14:58 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 13:38 +0100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 04:29 +1100
Re: What is a function parameter =[] for? Ben Finney <ben+python@benfinney.id.au> - 2015-11-19 13:08 +1100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-19 13:15 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-18 17:02 -0700
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-19 11:14 +1100
Re: What is a function parameter =[] for? fl <rxjwg98@gmail.com> - 2015-11-18 16:34 -0800
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-18 17:52 -0700
Re: What is a function parameter =[] for? MRAB <python@mrabarnett.plus.com> - 2015-11-19 01:02 +0000
Re: What is a function parameter =[] for? Ben Finney <ben+python@benfinney.id.au> - 2015-11-19 12:26 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-19 22:38 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-19 23:19 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 13:19 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-20 00:45 +1100
Re: What is a function parameter =[] for? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-19 09:05 -0500
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-20 03:01 +1100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-20 04:30 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 17:30 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-20 04:45 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 18:19 +0000
Re: What is a function parameter =[] for? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-11-19 18:26 +0000
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 18:50 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-20 06:09 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 19:48 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-20 06:58 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-20 11:26 +1100
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-19 16:36 -0800
Re: What is a function parameter =[] for? Laura Creighton <lac@openend.se> - 2015-11-20 02:00 +0100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-19 17:59 -0700
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-19 20:39 +0200
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-19 11:42 -0700
Re: What is a function parameter =[] for? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-11-19 18:44 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-20 06:19 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-19 21:21 +0000
Re: What is a function parameter =[] for? Michael Torrie <torriem@gmail.com> - 2015-11-19 15:55 -0700
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-20 00:11 +0000
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-19 16:27 -0800
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 14:43 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 01:00 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 15:24 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 01:34 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 16:01 +0100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 16:03 +0100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 16:12 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 02:17 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 04:54 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 16:46 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 02:48 +1100
Re: What is a function parameter =[] for? Random832 <random832@fastmail.com> - 2015-11-24 16:28 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 03:38 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 17:41 +0100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-24 09:56 -0700
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 18:32 +0100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-24 10:53 -0700
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-24 11:04 -0700
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 19:45 +0100
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-24 10:54 -0800
Re: What is a function parameter =[] for? Random832 <random832@fastmail.com> - 2015-11-24 19:00 +0000
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 11:34 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-24 12:15 -0700
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-24 12:15 -0700
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 21:54 +0100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-24 21:14 +0000
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 22:25 +0100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 11:36 +1100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 11:56 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-25 10:56 +0100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-26 04:40 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-25 19:27 +0100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-26 11:10 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-25 13:39 -0700
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-25 22:05 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-26 09:06 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-25 15:38 -0700
Re: What is a function parameter =[] for? Alan Bawden <alan@csail.mit.edu> - 2015-11-25 21:08 -0500
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-26 13:25 +1100
Re: What is a function parameter =[] for? Alan Bawden <alan@csail.mit.edu> - 2015-11-25 23:27 -0500
Re: What is a function parameter =[] for? Dave Farrance <df@see.replyto.invalid> - 2015-11-26 10:34 +0000
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-26 12:58 +0200
Re: What is a function parameter =[] for? Dave Farrance <df@see.replyto.invalid> - 2015-11-26 11:12 +0000
Object identity has no necessary connection to memory location (was: What is a function parameter =[] for?) Ben Finney <ben+python@benfinney.id.au> - 2015-11-26 22:24 +1100
Re: Object identity has no necessary connection to memory location (was: What is a function parameter =[] for?) Dave Farrance <df@see.replyto.invalid> - 2015-11-26 11:50 +0000
Re: Object identity has no necessary connection to memory location Ben Finney <ben+python@benfinney.id.au> - 2015-11-27 07:00 +1100
Re: Object identity has no necessary connection to memory location Steven D'Aprano <steve@pearwood.info> - 2015-11-27 13:17 +1100
Re: Object identity has no necessary connection to memory location Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-11-26 21:44 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-26 22:24 +1100
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-26 13:27 +0200
Re: Object identity has no necessary connection to memory location (was: What is a function parameter =[] for?) Chris Angelico <rosuav@gmail.com> - 2015-11-26 22:49 +1100
Re: Object identity has no necessary connection to memory location Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-26 13:04 +0100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-27 12:34 +1100
Re: What is a function parameter =[] for? Ben Finney <ben+python@benfinney.id.au> - 2015-11-27 12:40 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-27 13:44 +1100
Re: What is a function parameter =[] for? MRAB <python@mrabarnett.plus.com> - 2015-11-27 02:56 +0000
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-27 23:57 +1100
Re: What is a function parameter =[] for? Laura Creighton <lac@openend.se> - 2015-11-27 14:24 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-28 00:29 +1100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-27 14:06 +1100
Re: What is a function parameter =[] for? Ben Finney <ben+python@benfinney.id.au> - 2015-11-27 15:56 +1100
Re: What is a function parameter =[] for? Random832 <random832@fastmail.com> - 2015-11-26 23:33 -0500
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-25 19:46 -0700
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-26 14:02 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-26 09:15 +0100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-24 14:33 -0700
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 09:09 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-19 12:25 -0700
Re: What is a function parameter =[] for? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-11-19 18:20 +0000
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-20 12:05 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-20 11:59 +0000
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-20 04:12 -0800
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-20 12:39 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-21 00:04 +1100
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-20 05:30 -0800
Re: What is a function parameter =[] for? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-20 08:34 -0500
Re: What is a function parameter =[] for? Random832 <random832@fastmail.com> - 2015-11-20 14:32 +0000
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-20 09:18 -0700
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-22 23:01 +1100
Re: What is a function parameter =[] for? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-11-23 12:30 +1300
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 15:38 +0100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 15:34 +0100
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-24 06:50 -0800
Re: What is a function parameter =[] for? Terry Reedy <tjreedy@udel.edu> - 2015-11-24 12:46 -0500
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 19:27 +0100
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-20 14:28 +0200
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-20 12:53 +0000
Re: What is a function parameter =[] for? Random832 <random832@fastmail.com> - 2015-11-20 14:35 +0000
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-22 21:06 +1100
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-22 14:35 +0200
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-20 09:16 -0700
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-20 18:31 +0200
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-21 03:37 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-20 09:39 -0700
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-21 03:24 +1100
Re: What is a function parameter =[] for? Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-20 09:29 -0700
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-20 18:41 +0200
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-21 03:36 +1100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-22 14:43 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-22 13:21 +0000
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-22 14:28 +0000
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-23 10:44 +1100
Re: What is a function parameter =[] for? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-11-23 00:04 +0000
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-23 00:37 +0000
Re: What is a function parameter =[] for? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-11-23 11:32 +0000
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-23 04:05 -0800
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-23 14:23 +0200
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-23 11:20 +1100
Re: What is a function parameter =[] for? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-11-23 12:43 +1300
Re: What is a function parameter =[] for? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-11-23 18:47 +1100
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-23 10:40 +0000
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-24 00:58 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 15:58 +0100
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 04:56 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 15:18 +0100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 14:48 +0100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 12:36 +0100
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-24 23:07 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 13:48 +0100
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-24 14:57 +0200
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-24 06:18 -0800
Re: What is a function parameter =[] for? BartC <bc@freeuk.com> - 2015-11-24 14:43 +0000
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-25 01:54 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-24 16:10 +0100
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-24 07:27 -0800
Re: What is a function parameter =[] for? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-11-24 17:25 +0000
Re: What is a function parameter =[] for? Ned Batchelder <ned@nedbatchelder.com> - 2015-11-24 09:35 -0800
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-24 20:13 +0200
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 05:33 +1100
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-24 21:17 +0200
Re: What is a function parameter =[] for? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-24 11:27 -0500
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 11:39 +1100
Re: What is a function parameter =[] for? Laura Creighton <lac@openend.se> - 2015-11-25 01:55 +0100
A name refers to an object, an object has a value, equality compares values (was: What is a function parameter =[] for?) Ben Finney <ben+python@benfinney.id.au> - 2015-11-25 13:17 +1100
Re: A name refers to an object, an object has a value, equality compares values Marko Rauhamaa <marko@pacujo.net> - 2015-11-25 08:44 +0200
Re: A name refers to an object, an object has a value, equality compares values Chris Angelico <rosuav@gmail.com> - 2015-11-25 19:27 +1100
Re: What is a function parameter =[] for? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2015-11-25 10:36 +0100
Re: What is a function parameter =[] for? Jussi Piitulainen <harvest@should.be.invalid> - 2015-11-25 13:39 +0200
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-25 14:48 +0200
Re: What is a function parameter =[] for? Chris Angelico <rosuav@gmail.com> - 2015-11-26 00:50 +1100
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-25 16:08 +0200
Re: What is a function parameter =[] for? Jussi Piitulainen <harvest@should.be.invalid> - 2015-11-25 17:13 +0200
Re: What is a function parameter =[] for? Marko Rauhamaa <marko@pacujo.net> - 2015-11-25 18:44 +0200
Re: What is a function parameter =[] for? Jussi Piitulainen <harvest@should.be.invalid> - 2015-11-25 20:30 +0200
Re: What is a function parameter =[] for? Steven D'Aprano <steve@pearwood.info> - 2015-11-25 03:11 +1100
Page 6 of 10 — ← Prev page 1 … 4 5 [6] 7 8 … 10 Next page →
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2015-11-26 21:44 +0000 |
| Subject | Re: Object identity has no necessary connection to memory location |
| Message-ID | <mailman.155.1448574299.20593.python-list@python.org> |
| In reply to | #99562 |
On 26/11/2015 20:00, Ben Finney wrote: > Dave Farrance <df@see.replyto.invalid> writes: > >>>>> Dave Farrance <df@see.replyto.invalid>: >>>>> >>>>>> (Conversely, I see that unlike CPython, all PyPy's numbers have >>>>>> unchanging ids, even after exiting PyPy and restarting, so it seems >>>>>> that PyPy's numerical ids are "faked".) >> >> Hence >> >> https://en.wikipedia.org/wiki/Scare_quotes > > I saw the scare quotes. They still communicate your position that object > identity “should” be reliably connected to the object's memory location. > > Either you don't hold that position, in which case your original > statement was as ambiguous as this most recent one you wrote; or you do > hold that position, and my response stands. > It still fascinates me that after roughly 15 years using Python I've never considered using object identity, let alone actually done so. What, if anything, have I missed out on? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-26 22:24 +1100 |
| Message-ID | <mailman.130.1448537087.20593.python-list@python.org> |
| In reply to | #99554 |
On Thu, Nov 26, 2015 at 10:12 PM, Dave Farrance <df@see.replyto.invalid> wrote: > Marko Rauhamaa <marko@pacujo.net> wrote: > >>Dave Farrance <df@see.replyto.invalid>: >> >>> (Conversely, I see that unlike CPython, all PyPy's numbers have >>> unchanging ids, even after exiting PyPy and restarting, so it seems >>> that PyPy's numerical ids are "faked".) >> >>What's a faked id? > > You can figure out what I'm getting at -- i.e. I presume that the ids > are not pointers to stored numbers in memory (as with CPython) but are a > translation of the numerical variable's value. As long as they're unique among concurrently-existing objects, that's fully compliant and not at all invalid. It might be generated in some way from its value, but that's safe as long as there's a scheme that keeps all other objects away from them. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2015-11-26 13:27 +0200 |
| Message-ID | <87si3tdmq9.fsf@elektro.pacujo.net> |
| In reply to | #99554 |
Dave Farrance <df@see.replyto.invalid>: > Marko Rauhamaa <marko@pacujo.net> wrote: >>What's a faked id? > > You can figure out what I'm getting at -- i.e. I presume that the ids > are not pointers to stored numbers in memory (as with CPython) but are > a translation of the numerical variable's value. CPython is within its rights to fake the ids. Marko
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-26 22:49 +1100 |
| Subject | Re: Object identity has no necessary connection to memory location (was: What is a function parameter =[] for?) |
| Message-ID | <mailman.133.1448538927.20593.python-list@python.org> |
| In reply to | #99554 |
On Thu, Nov 26, 2015 at 10:24 PM, Ben Finney <ben+python@benfinney.id.au> wrote: > Dave Farrance <df@see.replyto.invalid> writes: > >> Marko Rauhamaa <marko@pacujo.net> wrote: >> >> >Dave Farrance <df@see.replyto.invalid>: >> > >> >> (Conversely, I see that unlike CPython, all PyPy's numbers have >> >> unchanging ids, even after exiting PyPy and restarting, so it seems >> >> that PyPy's numerical ids are "faked".) >> > >> >What's a faked id? >> >> You can figure out what I'm getting at -- i.e. I presume that the ids >> are not pointers to stored numbers in memory (as with CPython) but are >> a translation of the numerical variable's value. > > Why refer to that as “faked”? That's what I can't figure out about what > you're getting at. Perhaps Marko shares my uncomprehension. > > The Python language makes no promise about “pointers to stored numbers > in memory” for object identity. That is an implementation detail of > CPython, and is *explicitly* not promised for any other Python > implementation. > > If you are surprised that object identity appears to have no connection > with memory location, then you've made unwarranted assumptions that are > explicitly warned against in the Python documentation. I can't remember which language it was (maybe Lua?), but I know there's one that uses a machine word to store either a pointer to a heap object, or an integer of at most one less bit than the machine word, represented by 2*n+1. A system like this would work for Python object IDs; it guarantees that all heap objects have unique even IDs (because no two can share the same address; all it takes is requiring 16-bit alignment, and most modern CPUs will give at least 32-bit), and all small integers will be slotted in between them. So the integer objects might themselves be entirely faked, never actually existing in memory, yet never violating the rule of object IDs. (Any integer too big to fit in a machine word minus one bit would be heap-allocated, so they're safe.) That's "faked", in a sense, but still perfectly compliant. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| Date | 2015-11-26 13:04 +0100 |
| Subject | Re: Object identity has no necessary connection to memory location |
| Message-ID | <mailman.134.1448539496.20593.python-list@python.org> |
| In reply to | #99554 |
Op 26-11-15 om 12:49 schreef Chris Angelico: > I can't remember which language it was (maybe Lua?), but I know > there's one that uses a machine word to store either a pointer to a > heap object, or an integer of at most one less bit than the machine > word, represented by 2*n+1. I think that was smalltalk.
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2015-11-27 12:34 +1100 |
| Message-ID | <5657b30d$0$1600$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #99549 |
On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote: > (Conversely, I see that unlike CPython, all PyPy's numbers have > unchanging ids, even after exiting PyPy and restarting, so it seems that > PyPy's numerical ids are "faked".) > > [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>>> id(1+2j) > 679900119843984469027190799480815353863L > > [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>>> id(1+2j) > 679900119843984469027190799480815353863L I'm pretty sure that they are faked. I remember seeing a question on the pypy-dev mailing list asking whether it was important that object IDs remained stable. They had a problem where the JIT compiler would take a Python list, convert it to a low-level array of machine-sized ints for fast processing, and then recreate the list. This all happened in the background without the user knowing, and the PyPy devs needed to know if it was important that the object ID of the new list matched the old list. The language guarantees that the id of an object won't change for the lifespan of the object, and consequently PyPy has to fake them. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2015-11-27 12:40 +1100 |
| Message-ID | <mailman.160.1448588423.20593.python-list@python.org> |
| In reply to | #99614 |
Steven D'Aprano <steve@pearwood.info> writes: > On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote: > > > > (Conversely, I see that unlike CPython, all PyPy's numbers have > > unchanging ids, even after exiting PyPy and restarting, so it seems > > that PyPy's numerical ids are "faked".) > > I'm pretty sure that they are faked. It's still not been expressed what “fake” refers to here. Or, rather, what “real” thing was being expected, and how these don't qualify. The object IDs are real IDs, they identify the object, they're not pretending to be anything other than object IDs, they are perfectly compliant with the language definition and all the documentation. What is fake? What “real” thing was expected, and *why* was that expected? -- \ “Do unto others twenty-five percent better than you expect them | `\ to do unto you. (The twenty-five percent is [to correct] for | _o__) error.)” —Linus Pauling's Golden Rule | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2015-11-27 13:44 +1100 |
| Message-ID | <5657c376$0$1618$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #99615 |
On Fri, 27 Nov 2015 12:40 pm, Ben Finney wrote: > Steven D'Aprano <steve@pearwood.info> writes: > >> On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote: >> >> >> > (Conversely, I see that unlike CPython, all PyPy's numbers have >> > unchanging ids, even after exiting PyPy and restarting, so it seems >> > that PyPy's numerical ids are "faked".) >> >> I'm pretty sure that they are faked. > > It's still not been expressed what “fake” refers to here. Or, rather, > what “real” thing was being expected, and how these don't qualify. They are faked in the sense that in this implementation, the object lifespan that you think of as the Python programmer has little if any connection to the actual lifespan of the chunk of memory representing that object. Suppose you have a Python object which in turn contains three other objects: L = [10001, 10002, 10003] Take the id of that list: myid = id(L) You do some long-running processing of that list, and then compare the id at the end: assert myid == id(L) This is guaranteed to pass by the language definition. We can say that at *every instant* from the creation of the list to the moment it is garbage collected, if you took a snap-shot of the process' memory, and manually scanned through it, you could be able to identify four object structs, corresponding to the list and the three ints. They might move around and be found in different memory locations, (as in IronPython and Jython), but they will be there. But not with PyPy. Not only might the objects have moved location, but in some snapshots you won't find them at all. The JIT compiler may convert the high-level Python objects (a list, and three ints) to (let's say) a low-level array containing three C shorts, perform processing on that, and then recreate the Python objects only when finished. Looked at from the perspective of the implementation, the actual lifespan of the objects (in the sense of the struct in memory that represents that object) may be much less than what we see from the perspective of the high-level Python code. Of course in Python, the object continues to exist the whole time, as far as we can tell -- there is no test we can do from Python code that can distinguish the state of the object, just as there is no test we can do from Python to tell whether an object has moved memory location or not. But from outside of Python -- say, a debugger that hooks into the particular implementation, or by taking a dump of the memory and looking at it in a hex editor -- we can see the high-level objects come and go and move around. The PyPy implementation has to take special actions to preserve the ID across object recreations. That is what I mean by "faked". -- Steven
[toc] | [prev] | [next] | [standalone]
| From | MRAB <python@mrabarnett.plus.com> |
|---|---|
| Date | 2015-11-27 02:56 +0000 |
| Message-ID | <mailman.162.1448592976.20593.python-list@python.org> |
| In reply to | #99620 |
On 2015-11-27 02:44, Steven D'Aprano wrote: > On Fri, 27 Nov 2015 12:40 pm, Ben Finney wrote: > >> Steven D'Aprano <steve@pearwood.info> writes: >> >>> On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote: >>> >>> >>> > (Conversely, I see that unlike CPython, all PyPy's numbers have >>> > unchanging ids, even after exiting PyPy and restarting, so it seems >>> > that PyPy's numerical ids are "faked".) >>> >>> I'm pretty sure that they are faked. >> >> It's still not been expressed what “fake” refers to here. Or, rather, >> what “real” thing was being expected, and how these don't qualify. > > They are faked in the sense that in this implementation, the object lifespan > that you think of as the Python programmer has little if any connection to > the actual lifespan of the chunk of memory representing that object. > > Suppose you have a Python object which in turn contains three other objects: > > L = [10001, 10002, 10003] > > Take the id of that list: > > myid = id(L) > > You do some long-running processing of that list, and then compare the id at > the end: > > assert myid == id(L) > > This is guaranteed to pass by the language definition. > > We can say that at *every instant* from the creation of the list to the > moment it is garbage collected, if you took a snap-shot of the process' > memory, and manually scanned through it, you could be able to identify four > object structs, corresponding to the list and the three ints. They might > move around and be found in different memory locations, (as in IronPython > and Jython), but they will be there. > > But not with PyPy. Not only might the objects have moved location, but in > some snapshots you won't find them at all. The JIT compiler may convert the > high-level Python objects (a list, and three ints) to (let's say) a > low-level array containing three C shorts, perform processing on that, and > then recreate the Python objects only when finished. > > Looked at from the perspective of the implementation, the actual lifespan of > the objects (in the sense of the struct in memory that represents that > object) may be much less than what we see from the perspective of the > high-level Python code. > > Of course in Python, the object continues to exist the whole time, as far as > we can tell -- there is no test we can do from Python code that can > distinguish the state of the object, just as there is no test we can do > from Python to tell whether an object has moved memory location or not. But > from outside of Python -- say, a debugger that hooks into the particular > implementation, or by taking a dump of the memory and looking at it in a > hex editor -- we can see the high-level objects come and go and move > around. > > The PyPy implementation has to take special actions to preserve the ID > across object recreations. That is what I mean by "faked". > You could argue that it _does_ continue to exist, it just changes its form...
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2015-11-27 23:57 +1100 |
| Message-ID | <5658533c$0$1591$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #99622 |
On Fri, 27 Nov 2015 01:56 pm, MRAB wrote: > On 2015-11-27 02:44, Steven D'Aprano wrote: >> The PyPy implementation has to take special actions to preserve the ID >> across object recreations. That is what I mean by "faked". >> > You could argue that it _does_ continue to exist, it just changes its > form... *Something* continues to exist, but it is no longer an object. I like Chris' analogy of it being like quantum mechanics -- the *object* isn't guaranteed to exist except when you try to access it, until then you don't know what form it will take at any instance. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Laura Creighton <lac@openend.se> |
|---|---|
| Date | 2015-11-27 14:24 +0100 |
| Message-ID | <mailman.176.1448630691.20593.python-list@python.org> |
| In reply to | #99641 |
In a message of Fri, 27 Nov 2015 23:57:29 +1100, "Steven D'Aprano" writes: >On Fri, 27 Nov 2015 01:56 pm, MRAB wrote: > >> On 2015-11-27 02:44, Steven D'Aprano wrote: > >>> The PyPy implementation has to take special actions to preserve the ID >>> across object recreations. That is what I mean by "faked". >>> >> You could argue that it _does_ continue to exist, it just changes its >> form... > >*Something* continues to exist, but it is no longer an object. > >I like Chris' analogy of it being like quantum mechanics -- the *object* >isn't guaranteed to exist except when you try to access it, until then you >don't know what form it will take at any instance. I think it's just another instance of Just-In-Time Manufacturing https://en.wikipedia.org/wiki/Just-in-time_manufacturing "As soon as you need a object, we'll have one ready". :) Laura
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-28 00:29 +1100 |
| Message-ID | <mailman.177.1448630997.20593.python-list@python.org> |
| In reply to | #99641 |
On Sat, Nov 28, 2015 at 12:24 AM, Laura Creighton <lac@openend.se> wrote: > I think it's just another instance of Just-In-Time Manufacturing > https://en.wikipedia.org/wiki/Just-in-time_manufacturing > > "As soon as you need a object, we'll have one ready". :) Just-In-Time Quantum Manufacturing: "As soon as you need an electron, we'll have the same one ready!" ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-27 14:06 +1100 |
| Message-ID | <mailman.163.1448593611.20593.python-list@python.org> |
| In reply to | #99620 |
On Fri, Nov 27, 2015 at 1:56 PM, MRAB <python@mrabarnett.plus.com> wrote: > You could argue that it _does_ continue to exist, it just changes its > form... PyPy: The Quantum Mechanics of Python programming. If you aren't actually looking at something right at this instant, it might exist in a different form... or not exist at all. But hey! By the time you get to look at it again, it'll exist just as if it was never gone! ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2015-11-27 15:56 +1100 |
| Message-ID | <mailman.165.1448600216.20593.python-list@python.org> |
| In reply to | #99620 |
Steven D'Aprano <steve@pearwood.info> writes: > On Fri, 27 Nov 2015 12:40 pm, Ben Finney wrote: > > > It's still not been expressed what “fake” refers to here. Or, rather, > > what “real” thing was being expected, and how these don't qualify. > > They are faked in the sense that in this implementation, the object > lifespan that you think of as the Python programmer has little if any > connection to the actual lifespan of the chunk of memory representing > that object. Since that's nothing to do with the definition nor API of an object ID, I think all the uses of “faked” so far in this thread just don't apply to PyPy's object IDs. > The PyPy implementation has to take special actions to preserve the ID > across object recreations. That is what I mean by "faked". Thanks for the interesting explanation. I don't think any of this makes PyPy's object IDs in any sense not-real-object-IDs, so I disagree with using “faked” to characterise them. None of CPython, Jython, PyPy, etc. have object IDs that are anything but real object IDs, IMO. -- \ “[Entrenched media corporations will] maintain the status quo, | `\ or die trying. Either is better than actually WORKING for a | _o__) living.” —ringsnake.livejournal.com, 2007-11-12 | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Random832 <random832@fastmail.com> |
|---|---|
| Date | 2015-11-26 23:33 -0500 |
| Message-ID | <mailman.164.1448598850.20593.python-list@python.org> |
| In reply to | #99614 |
Steven D'Aprano <steve@pearwood.info> writes: > On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote: > > >> (Conversely, I see that unlike CPython, all PyPy's numbers have >> unchanging ids, even after exiting PyPy and restarting, so it seems that >> PyPy's numerical ids are "faked".) >> >> [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>>>> id(1+2j) >> 679900119843984469027190799480815353863L >> >> [PyPy 2.6.1 with GCC 4.9.2] on linux2 >>>>>> id(1+2j) >> 679900119843984469027190799480815353863L > > > I'm pretty sure that they are faked. The hex value may be instructive: 0x1ff800000000000020000000000000007L That's 0x3ff00000000000004000000000000000 << 3 | 7. 3ff000... is the double representation of 1, 400000... is 2. I bet that that three-bit field at the end has different values for all the different types they are "faked" for, and one for the ones that they're "not faked".
[toc] | [prev] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2015-11-25 19:46 -0700 |
| Message-ID | <mailman.110.1448506060.20593.python-list@python.org> |
| In reply to | #99521 |
On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico <rosuav@gmail.com> wrote: > On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden <alan@csail.mit.edu> wrote: >> (Note that nothing in the documentation I can find actually _guarantees_ >> that a Python implementation will only have one unique empty tuple, but >> I wouldn't be suprised if the following is nonetheless true in all >> current implementations: >> >> >>> tuple([]) is tuple([]) >> True >> >> ) > > Jython 2.5.3 (, Oct 8 2014, 03:39:09) > [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_85 > Type "help", "copyright", "credits" or "license" for more information. >>>> tuple([]) is tuple([]) > False > > Python 2.7.8 (2.4.0+dfsg-3, Dec 20 2014, 13:30:46) > [PyPy 2.4.0 with GCC 4.9.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>>> tuple([]) is tuple([]) > False Well, he did say all "current" implementations. CPython 2.7 may still be supported, but that doesn't make it current. And anything at 2.5 is just archaic.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-26 14:02 +1100 |
| Message-ID | <mailman.111.1448506929.20593.python-list@python.org> |
| In reply to | #99521 |
On Thu, Nov 26, 2015 at 1:46 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote: > On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico <rosuav@gmail.com> wrote: >> On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden <alan@csail.mit.edu> wrote: >>> (Note that nothing in the documentation I can find actually _guarantees_ >>> that a Python implementation will only have one unique empty tuple, but >>> I wouldn't be suprised if the following is nonetheless true in all >>> current implementations: >>> >>> >>> tuple([]) is tuple([]) >>> True >>> >>> ) >> >> Jython 2.5.3 (, Oct 8 2014, 03:39:09) >> [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_85 >> Type "help", "copyright", "credits" or "license" for more information. >>>>> tuple([]) is tuple([]) >> False >> >> Python 2.7.8 (2.4.0+dfsg-3, Dec 20 2014, 13:30:46) >> [PyPy 2.4.0 with GCC 4.9.2] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >>>>>> tuple([]) is tuple([]) >> False > > Well, he did say all "current" implementations. CPython 2.7 may still > be supported, but that doesn't make it current. And anything at 2.5 is > just archaic. Those are the versions of Jython and PyPy available from the Debian Jessie repositories. I'm not sure what Jython's compatibility is, but this is at least reasonably current. But I grabbed the latest 2.x-compatible PyPy nightly: Python 2.7.10 (b4515dee6ebf, Nov 25 2015, 23:01:41) [PyPy 4.1.0-alpha0 with GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``Every time someone argues with "Smalltalk has always done X", it is always a good hint that something needs to be changed fast. - Marcus Denker'' >>>> tuple([]) is tuple([]) False The latest PyPy3 nightly builds seem to be broken, though; I was unable to get one to run. The builds compatible with Python 3.2 work, though: Python 3.2.5 (b2091e973da6, Oct 19 2014, 18:29:55) [PyPy 2.4.0 with GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>> tuple([]) is tuple([]) False So current PyPy still behaves that way. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
|---|---|
| Date | 2015-11-26 09:15 +0100 |
| Message-ID | <mailman.118.1448525729.20593.python-list@python.org> |
| In reply to | #99466 |
Op 25-11-15 om 23:38 schreef Ian Kelly:
> On Wed, Nov 25, 2015 at 2:05 PM, Antoon Pardon
> <antoon.pardon@rece.vub.ac.be> wrote:
>> Op 25-11-15 om 21:39 schreef Ian Kelly:
>>
>>> I believe that sentence from the docs is using "some" to mean "not
>>> all", whereas you are apparently using it to mean "any".
>>>
>>> frozenset([1,2,3]) constructs a constant value of a built-in type.
>>> Would you consider that a literal?
>> I am inclined to say yes, because a sufficient intelligent compilor
>> can compute the value and store it do be retrieved and bound to a
>> target when needed.
> I'm curious then what you think of this:
>
> from collections import namedtuple
>
> class Point(namedtuple("Point", "x y")): pass
>
> Point(17, 12)
>
> Still a constant, but not a built-in type. Would you consider that a literal?
I think I would answer no to that. In this case we have a user class. So
the compilor has no intrinsic knowledge of the structure of this type.
So the language has no choice but to construct the object at the moment
of execution.
--
Antoon.
[toc] | [prev] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2015-11-24 14:33 -0700 |
| Message-ID | <mailman.37.1448400839.20593.python-list@python.org> |
| In reply to | #99111 |
On Tue, Nov 24, 2015 at 1:54 PM, Antoon Pardon <antoon.pardon@rece.vub.ac.be> wrote: > Op 24-11-15 om 20:15 schreef Ian Kelly: > >>> But no matter what you want to call it. The dis module shows that >>> -42 is treated in exactly the same way as 42, which is treated >>> exactly the same way as () or as (5, 8, 13) which is treated >>> differently from [] or [5, 8, 13]. >> >> This is an implementation detail. The compiler would also be free to >> compile -42 into byte code as the negation of the constant 42. That 42 >> is a literal, on the other hand, is part of the language >> specification. > > I think you are picking nits. Yes. This entire subtopic about literals is picking nits. :-)
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-11-25 09:09 +1100 |
| Message-ID | <mailman.40.1448402970.20593.python-list@python.org> |
| In reply to | #99111 |
On Wed, Nov 25, 2015 at 6:00 AM, Random832 <random832@fastmail.com> wrote:
> On 2015-11-24, Chris Angelico <rosuav@gmail.com> wrote:
>> Probably the grammar. In other words, it's part of the language's very
>> definition.
>
> Then the definition is wrong. I think "literal" is a word whose meaning is
> generally agreed on, rather than something each language's spec can invent from
> whole cloth for itself. It's not a python term, it's a programming term.
>
> And the documentation doesn't even use it consistently; it calls {} a literal.
Can you link to that, please? Maybe there's something that can be
improved. (Or maybe not.)
ChrisA
[toc] | [prev] | [next] | [standalone]
Page 6 of 10 — ← Prev page 1 … 4 5 [6] 7 8 … 10 Next page →
Back to top | Article view | comp.lang.python
csiph-web