Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.051 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.02; 'operator': 0.03; 'modified': 0.07; 'transform': 0.07; 'docstring': 0.16; 'function?': 0.16; "module's": 0.16; 'name)': 0.16; 'to:name:python list': 0.16; 'class.': 0.26; 'skip:" 30': 0.26; 'wondering': 0.29; 'message-id:@mail.gmail.com': 0.30; '(perhaps': 0.31; 'class': 0.32; "can't": 0.35; 'received:google.com': 0.35; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'back': 0.62; 'such': 0.63; 'bonafide': 0.84; 'consider...': 0.84; 'think:': 0.84; 'washington': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=HwVet43uGVXhW57b0L1lhaN/kcoGYVI2BhBYFfAMyMI=; b=ga94BhhmianbGwwjDFxGWWA/HePwnFU1CtBPzmW3AAxqM1CzgenpOP4a5tX1XapaVP wcAs5L+7KqadqMnKOtcCaIyyvY+VnEBLc9GGRAS7AdjG+thrbyFGsRMYY8PDYwhcKBNI OJZv6Q2fbgSHG88kR4IJQbNKrQ5n2xKq5eaGqXj+eNM9q9lc4Oi9E6EVQoxtynAWa2ov uDdK0nnQb+qhNiG2sopIVQDTsSY1ZSj74GsCPIP8+f96dkV7fFhUno9g1inDbhwQ9v3o Uk8kHlTGVgU0ZG0MMJ3RLBfnq0M7UC1GLC3Ar/7KQOtD1r/n4Fbj5vPwNmKCTIiuFeyU NLZQ== MIME-Version: 1.0 X-Received: by 10.194.121.132 with SMTP id lk4mr22696550wjb.25.1373588585050; Thu, 11 Jul 2013 17:23:05 -0700 (PDT) Date: Thu, 11 Jul 2013 17:23:04 -0700 Subject: Casting classes WAS: Documenting builtin methods From: Mark Janssen To: Python List Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373588593 news.xs4all.nl 15901 [2001:888:2000:d::a6]:35175 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50478 A user was wondering why they can't change a docstring in a module's class. This made me think: why not have a casting operator ("reciprocal"?) to transform a bonafide class into a mere carcass of a class which can then modified and reanimated back into its own type with the type function? Such that "type(reciprocal(myClass))==myClass"... reciprocal(myClass) returns a writeable, nonproxy class.__dict__ (perhaps also a list of its bases and name) Just a thought to consider... MarkJ Tacoma, Washington