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


Groups > comp.lang.python > #69030

Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.052
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'found,': 0.07; 'suddenly': 0.07; 'cc:addr:python-list': 0.11; 'cleanly': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subclassing': 0.16; 'subject:sub': 0.16; 'think.': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'things.': 0.19; 'not,': 0.20; 'seems': 0.21; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'filed': 0.31; 'could': 0.34; 'classes': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'library.': 0.36; 'should': 0.36; 'issue': 0.38; 'sure': 0.39; 'how': 0.40; 'easy': 0.60; 'break': 0.61; 'managers': 0.61; "you're": 0.61; "you've": 0.63; 'more': 0.64; 'details': 0.65; 'mar': 0.68; '26,': 0.68; 'rework': 0.84; 'safer': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=mFxzTCHlXzs2uOnxdkWMd9ZSKQQqcCjE0GiQGtyPr3Y=; b=OQ68ZyNc3cFDJLCQgdEbeZMEmcK05krh070sLZMf0Fd/V+KMdRfovTZgK6UPhP68jg erfn2qBFrx/riYPBD3bj35n87n1X6TuR4eN+Kk64EuOT2XWBf7MkVIIZw3tk578YBBnJ s2W0Kc/T1g5yXMx7OOkxMWqw3HfwdVnkJ7DX0LEhi2S0xr8Uv0u++8jYyauMByfTkpPC TvYQlhey0dafE0PGtia7c9mBc3sLKCEWZWklvfsTb/LIEjlXkjhwYphS+9WQfqWGTbW3 lZBpTEe7LwAtJWai2H3JpyZcSvrSuslTDsA1PWK4cEVvLTGAkX4ZimwXeDdzoqRRoQ+Y qrGg==
MIME-Version 1.0
X-Received by 10.68.112.164 with SMTP id ir4mr10928862pbb.153.1395756052870; Tue, 25 Mar 2014 07:00:52 -0700 (PDT)
In-Reply-To <8d59e3a4-e6af-4633-869b-53568f6091cd@googlegroups.com>
References <CA+7ESbr9i6VEO709jPF8ghoPRsUggqBrCEJhoXBn7LK6wYSA+w@mail.gmail.com> <mailman.8474.1395707125.18130.python-list@python.org> <80cf8fb7-d0c5-43a9-bc6f-c61ce6214f98@googlegroups.com> <mailman.8484.1395719089.18130.python-list@python.org> <8d59e3a4-e6af-4633-869b-53568f6091cd@googlegroups.com>
Date Wed, 26 Mar 2014 01:00:52 +1100
Subject Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.8522.1395756056.18130.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1395756056 news.xs4all.nl 2909 [2001:888:2000:d::a6]:49066
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:69030

Show key headers only | View raw


On Wed, Mar 26, 2014 at 12:34 AM,  <matt.newville@gmail.com> wrote:
> Monkey-patching multiprocessing.Process seems more fragile than subclassing it.  It turned out that multiprocessing.pool.Pool was also very easy to subclass.  But cleanly subclassing the Managers in multiprocessing.managers look much harder.  I'm not sure if this is intentional or not, or if it should be filed as an issue for multiprocessing.   For now, I'm willing to say that the multiprocessing managers are not yet available with the pyepics library.
>

Subclassing is actually more fragile than you might think. As you've
found, you need to fidget with more and more classes to make your
change "stick", and also, any small change to implementation details
in the superclass could suddenly break things. It's not really any
safer than monkeypatching, despite all the OO fanatics saying how easy
it is to rework by subclassing. At least when you monkeypatch, you
*know* you're fiddling with internals.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager Chris Angelico <rosuav@gmail.com> - 2014-03-25 11:19 +1100
  Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager matt.newville@gmail.com - 2014-03-24 20:27 -0700
    Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager Chris Angelico <rosuav@gmail.com> - 2014-03-25 14:44 +1100
      Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager matt.newville@gmail.com - 2014-03-25 06:34 -0700
        Re: advice on sub-classing multiprocessing.Process and multiprocessing.BaseManager Chris Angelico <rosuav@gmail.com> - 2014-03-26 01:00 +1100

csiph-web