Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91886
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.038 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'string.': 0.04; '===': 0.09; 'python': 0.11; 'subject:python': 0.14; '"new': 0.16; 'objects?': 0.16; 'subject:class': 0.16; 'subject:object': 0.16; 'subject:type': 0.16; 'wrote:': 0.16; 'string': 0.17; '(not': 0.20; 'bit': 0.23; '2015': 0.23; 'seems': 0.24; 'header:In-Reply- To:1': 0.24; 'message-id:@mail.gmail.com': 0.28; 'skip:( 20': 0.28; 'accomplished': 0.29; 'equivalent.': 0.29; 'implicitly': 0.29; 'objects': 0.29; "can't": 0.32; 'class': 0.33; 'third': 0.33; 'steven': 0.33; 'add': 0.34; 'received:google.com': 0.34; 'to:addr:python-list': 0.35; 'done': 0.35; 'false': 0.35; 'but': 0.36; 'subject:: ': 0.37; "skip:' 20": 0.37; 'tue,': 0.38; 'pm,': 0.39; 'method': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'here.': 0.61; 'detail.': 0.66; 'believe': 0.67; 'accessed.': 0.84; 'batchelder': 0.84; 'to:name:python': 0.84; 'utc-4,': 0.84; 'many,': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=gwKTVwrX84GdfMWB9UHvGIww8eONOliYPxLKG4xZMz4=; b=YD0kX/5NtT2NqlNV6AsL2sFMU2zcnDknwlatW/om7mE+dyouSPP/54ptWkRXukRMOE wZvPkAVoLEhWm9JbqAGX5e/3wJihj0LBc1PkMoiEZliP3cePFyFjUlifYnd6FrokDDUl kmoN7XWk7xR3i6vPbww7zGWXh+V7Sbe2NJsDzKuL22vBDx5ulwUbhEDoFuQF9/wXzptO 5qgcUuvuFL8E0vQ8EaYSpjLJVMwApE2DjynsgGA6F9zeLIrArWdxcSIYncAw68wy5nOI 7Hbu5/8K8uEoIKduZa1E44gklsb/DNc8I6eTz4PHlvjCFy7cZ4jCkn/6LVu6OTTZBHRk 4vGQ== |
| X-Received | by 10.107.6.136 with SMTP id f8mr34435964ioi.61.1433273817426; Tue, 02 Jun 2015 12:36:57 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <4d0ad8f5-d29f-442e-9374-5cda12153f88@googlegroups.com> |
| References | <14976c1b-a620-426f-b529-41a3c04e9c1a@googlegroups.com> <48fc36e9-fa67-45d5-9864-0921b7e819ce@googlegroups.com> <556d931a$0$12991$c3e8da3$5496439d@news.astraweb.com> <yDhbx.572527$oZ4.306159@fx38.am4> <556de143$0$13009$c3e8da3$5496439d@news.astraweb.com> <%9mbx.608935$JH2.445461@fx11.am4> <4d0ad8f5-d29f-442e-9374-5cda12153f88@googlegroups.com> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Tue, 2 Jun 2015 13:36:16 -0600 |
| Subject | Re: Everything is an object in python - object class and type class |
| To | Python <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.76.1433273826.13271.python-list@python.org> (permalink) |
| Lines | 46 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1433273826 news.xs4all.nl 2868 [2001:888:2000:d::a6]:57029 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:91886 |
Show key headers only | View raw
On Tue, Jun 2, 2015 at 12:10 PM, Ned Batchelder <ned@nedbatchelder.com> wrote: > On Tuesday, June 2, 2015 at 1:59:37 PM UTC-4, BartC wrote: >> Javascript primitives include Number and String. >> >> What does Python allow to be done with its Number (int, etc) and String >> types that can't be done with their Javascript counterparts, that makes >> /them/ objects? > > They have methods (not many, but a few): > >>>> i, f = 1000001, 2.5 >>>> i.bit_length() > 20 >>>> i.to_bytes(6, "big") > b'\x00\x00\x00\x0fBA' >>>> f.as_integer_ratio() > (5, 2) >>>> f.hex() > '0x1.4000000000000p+1' To add a wrinkle to this discussion, Javascript numbers also have methods: js> (24).toExponential(3) "2.400e+1" I believe this is accomplished by implicitly boxing the number in the Number class when a method or property is accessed. This can be seen with: js> (24).toSource() "(new Number(24))" Note that "24" and "new Number(24)" are not equivalent. js> 24 === 24 true js> 24 === new Number(24) false js> typeof(24) "number" js> typeof(new Number(24)) "object" But this is a bit of an implementation detail. So what distinguishes Javascript primitives from objects? Steven listed "identity" as a third property of objects upthread; that seems applicable here.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-05-31 07:34 -0700
Re: Everything is an object in python - object class and type class Marco Buttu <marco.buttu@gmail.com> - 2015-05-31 17:13 +0200
Re: Everything is an object in python - object class and type class Terry Reedy <tjreedy@udel.edu> - 2015-05-31 11:37 -0400
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-01 04:00 +1000
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-01 10:35 -0700
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-05-31 17:29 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-01 14:09 +1000
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-05-31 20:09 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-01 14:24 +1000
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-06-01 05:03 -0700
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-01 23:59 +0100
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-02 11:45 +0100
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-02 04:16 -0700
Re: Everything is an object in python - object class and type class Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-02 09:09 -0600
Re: Everything is an object in python - object class and type class TheDoctor <dreamingforward@gmail.com> - 2015-06-01 17:24 -0700
Re: Everything is an object in python - object class and type class Chris Angelico <rosuav@gmail.com> - 2015-06-02 10:32 +1000
Re: Everything is an object in python - object class and type class TheDoctor <dreamingforward@gmail.com> - 2015-06-01 18:02 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-02 16:30 +1000
Re: Everything is an object in python - object class and type class TheDoctor <dreamingforward@gmail.com> - 2015-06-01 18:15 -0700
Re: Everything is an object in python - object class and type class Chris Angelico <rosuav@gmail.com> - 2015-06-02 11:30 +1000
Re: Everything is an object in python - object class and type class random832@fastmail.us - 2015-06-02 00:13 -0400
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-02 16:23 +1000
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-01 20:15 -0700
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-02 04:46 +0100
Re: Everything is an object in python - object class and type class TheDoctor <dreamingforward@gmail.com> - 2015-06-01 21:47 -0700
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-01 22:01 -0700
Religion [was Re: Everything is an object in python - object class and type class] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-02 16:04 +1000
Re: Religion [was Re: Everything is an object in python - object class and type class] Rustom Mody <rustompmody@gmail.com> - 2015-06-01 23:17 -0700
Re: Religion [was Re: Everything is an object in python - object class and type class] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-02 07:20 +0100
Re: Everything is an object in python - object class and type class random832@fastmail.us - 2015-06-02 00:08 -0400
Re: Everything is an object in python - object class and type class TheDoctor <dreamingforward@gmail.com> - 2015-06-01 21:54 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-02 17:12 +1000
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-02 00:44 -0700
Re: Everything is an object in python - object class and type class Chris Angelico <rosuav@gmail.com> - 2015-06-02 18:37 +1000
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-02 02:18 -0700
Re: Everything is an object in python - object class and type class Marko Rauhamaa <marko@pacujo.net> - 2015-06-02 12:23 +0300
Re: Everything is an object in python - object class and type class vern.muhr@gmail.com - 2015-06-01 14:12 -0700
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-06-02 03:36 -0700
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-02 12:11 +0100
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-02 21:27 +1000
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-02 04:40 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-03 01:08 +1000
Re: Everything is an object in python - object class and type class Rustom Mody <rustompmody@gmail.com> - 2015-06-02 09:14 -0700
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-02 13:49 +0100
Re: Everything is an object in python - object class and type class Marko Rauhamaa <marko@pacujo.net> - 2015-06-02 16:13 +0300
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-03 03:00 +1000
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-02 18:59 +0100
Re: Everything is an object in python - object class and type class random832@fastmail.us - 2015-06-02 14:07 -0400
Re: Everything is an object in python - object class and type class Ned Batchelder <ned@nedbatchelder.com> - 2015-06-02 11:10 -0700
Re: Everything is an object in python - object class and type class Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-02 13:36 -0600
Re: Everything is an object in python - object class and type class Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-06-02 18:10 +0000
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-02 11:22 -0700
Re: Everything is an object in python - object class and type class Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-06-02 18:47 +0000
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-02 12:00 -0700
Re: Everything is an object in python - object class and type class Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2015-06-02 19:31 +0000
Re: Everything is an object in python - object class and type class Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-02 13:50 -0600
Re: Everything is an object in python - object class and type class Grant Edwards <invalid@invalid.invalid> - 2015-06-02 21:19 +0000
Re: Everything is an object in python - object class and type class Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 01:33 +0300
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-02 15:49 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-03 18:13 +1000
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-03 21:38 -0700
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-03 18:24 +1000
Re: Everything is an object in python - object class and type class Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 11:57 +0300
Re: Everything is an object in python - object class and type class Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-03 07:57 -0600
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-03 21:42 -0700
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-02 12:58 -0700
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-02 22:47 +0100
Re: Everything is an object in python - object class and type class Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-02 18:49 -0600
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-03 18:32 +1000
Re: Everything is an object in python - object class and type class Ian Kelly <ian.g.kelly@gmail.com> - 2015-06-02 13:37 -0600
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-06-03 18:08 +1000
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-02 11:00 -0700
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-06-02 21:16 -0700
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-03 06:23 +0100
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 11:20 +0100
Re: Everything is an object in python - object class and type class Chris Angelico <rosuav@gmail.com> - 2015-06-03 20:38 +1000
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 12:08 +0100
Re: Everything is an object in python - object class and type class Marko Rauhamaa <marko@pacujo.net> - 2015-06-03 15:08 +0300
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 17:00 +0100
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-03 17:29 +0100
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 19:59 +0100
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-03 21:58 +0100
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 22:33 +0100
Re: Everything is an object in python - object class and type class Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-03 22:49 +0100
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-04 00:04 +0100
Re: Everything is an object in python - object class and type class Laura Creighton <lac@openend.se> - 2015-06-04 12:06 +0200
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-04 13:01 +0100
Re: Everything is an object in python - object class and type class Laura Creighton <lac@openend.se> - 2015-06-04 15:39 +0200
Re: Everything is an object in python - object class and type class "Dr. Bigcock" <dreamingforward@gmail.com> - 2015-06-03 21:50 -0700
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-06-03 22:43 -0700
Re: Everything is an object in python - object class and type class Michael Torrie <torriem@gmail.com> - 2015-06-03 10:36 -0600
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 18:26 +0100
Re: Everything is an object in python - object class and type class Steven D'Aprano <steve@pearwood.info> - 2015-06-05 00:11 +1000
Re: Everything is an object in python - object class and type class Terry Reedy <tjreedy@udel.edu> - 2015-06-03 13:17 -0400
Re: Everything is an object in python - object class and type class Chris Angelico <rosuav@gmail.com> - 2015-06-03 22:19 +1000
Re: Everything is an object in python - object class and type class Marco Buttu <marco.buttu@gmail.com> - 2015-06-03 14:10 +0200
Re: Everything is an object in python - object class and type class BartC <bc@freeuk.com> - 2015-06-03 12:13 +0100
Re: Everything is an object in python - object class and type class Terry Reedy <tjreedy@udel.edu> - 2015-06-03 13:05 -0400
Re: Everything is an object in python - object class and type class Terry Reedy <tjreedy@udel.edu> - 2015-06-02 12:23 -0400
Re: Everything is an object in python - object class and type class Eddilbert Macharia <edd.cowan@gmail.com> - 2015-06-03 06:17 -0700
csiph-web