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


Groups > comp.lang.python > #50478

Casting classes WAS: Documenting builtin methods

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 <dreamingforward@gmail.com>
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 <dreamingforward@gmail.com>
To Python List <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4605.1373588592.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

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


Thread

Casting classes WAS: Documenting builtin methods Mark Janssen <dreamingforward@gmail.com> - 2013-07-11 17:23 -0700

csiph-web