Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20212
| From | 88888 Dihedral <dihedral88888@googlemail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: frozendict |
| Date | 2012-02-10 21:52 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <11277623.419.1328939579823.JavaMail.geo-discussion-forums@pbcql8> (permalink) |
| References | (10 earlier) <CAPTjJmrjjmxgPctMfz-69KN_BHYjpR+=VRHoX-efdMh_fBTyVQ@mail.gmail.com> <CAOFbRmJSntQUtt3_ooWZ12RiEW_pYdxehgr7GzYU-NvD7py9DQ@mail.gmail.com> <CAMZYqRT+r699_j8JohaAkOPApPb1JRCR6X=Ugp4VB40XrB988w@mail.gmail.com> <mailman.5673.1328897669.27778.python-list@python.org> <4f356898$0$11996$742ec2ed@news.sonic.net> |
在 2012年2月11日星期六UTC+8上午2时57分34秒,John Nagle写道: > On 2/10/2012 10:14 AM, Nathan Rice wrote: > >>> Lets also not forget that knowing an object is immutable lets you do a > >>> lot of optimizations; it can be inlined, it is safe to convert to a > >>> contiguous block of memory and stuff in cache, etc. If you know the > >>> input to a function is guaranteed to be frozen you can just go crazy. > >>> Being able to freeze(anyobject) seems like a pretty clear win. > >>> Whether or not it is pythonic is debatable. I'd argue if the meaning > >>> of pythonic in some context is limiting, we should consider updating > >>> the term rather than being dogmatic. > > A real justification for the ability to make anything immutable is > to make it safely shareable between threads. If it's immutable, it > doesn't have to be locked for access. Mozilla's new "Rust" > language takes advantage of this. Take a look at Rust's concurrency > semantics. They've made some progress. > > John Nagl Lets model the system as an asynchronous set of objects with multiple threads performing operatons on objects as in the above. This reminds me the old problem solved before in the digital hardware.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-08 22:43 -0500
Re: frozendict Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-09 10:33 +0000
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 09:36 -0500
Re: frozendict Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-09 14:52 +0000
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 10:19 -0500
Re: frozendict Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-09 18:47 +0000
Re: frozendict Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-09 09:35 -0700
Re: frozendict Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-10 01:24 +0000
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 21:30 -0500
Re: frozendict Terry Reedy <tjreedy@udel.edu> - 2012-02-09 22:33 -0500
Re: frozendict Chris Angelico <rosuav@gmail.com> - 2012-02-10 21:08 +1100
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-10 11:53 -0500
Re: frozendict Chris Rebert <clp2@rebertia.com> - 2012-02-10 09:00 -0800
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-10 13:14 -0500
Re: frozendict John Nagle <nagle@animats.com> - 2012-02-10 10:57 -0800
Re: frozendict 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-10 21:52 -0800
Re: frozendict John Nagle <nagle@animats.com> - 2012-02-13 13:15 -0800
Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 11:50 -0500
csiph-web