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


Groups > comp.lang.python > #27185

Re: Dynamically determine base classes on instantiation

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <thbach@students.uni-mainz.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; '(at': 0.03; '16,': 0.03; 'memory.': 0.05; 'python': 0.09; 'none.': 0.09; 'parsed': 0.09; 'structure,': 0.09; "wouldn't": 0.11; 'assume': 0.11; 'aug': 0.13; 'arbitrarily': 0.16; 'sense,': 0.16; "{'foo':": 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'parse': 0.22; 'subject:skip:i 10': 0.22; 'pass': 0.25; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '???': 0.27; 'merge': 0.27; 'set.': 0.27; 'thus,': 0.29; 'probably': 0.29; "skip:' 10": 0.30; 'returned': 0.30; 'could': 0.32; '+0200,': 0.33; 'extract': 0.33; 'right?': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; "can't": 0.34; 'wrong': 0.34; 'sometimes': 0.35; 'should': 0.36; 'charset:us- ascii': 0.36; 'ok,': 0.37; 'one,': 0.37; 'two': 0.37; 'why': 0.37; 'quite': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'skip:" 10': 0.40; 'think': 0.40; 'content-disposition:inline': 0.60; 'first': 0.61; 'thomas': 0.62; 'here': 0.65; 'walk': 0.71; 'lying': 0.84; 'received:10.94': 0.84; 'vocabulary': 0.84; 'dennis': 0.91; 'imagine': 0.96
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-mainz.de; i=@uni-mainz.de; q=dns/txt; s=ironport; t=1345137497; x=1376673497; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=JXi9VKDDdKcRQKCdoPxEhrKex7sOwN1dgykg/N+yJNI=; b=aEdv/4ErczM5Id+BIiWU5/L8E6W5kiaXOSdkR7fwNkLfa2txeBWOV8kY VReP2oqdpF3kQZkQlXkiHKjw+7HIBMSIHkisdhCAFtp96aNNiNdVXZ3qT NRBkbe8yPBGe+gK5aQnguzu18VhkKCfd5qVPXeDlSTdSPsjaow05U+IK3 s=;
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result ApwEAN0qLVAKXgZQ/2dsb2JhbABFuzSCIAEBBTpPCAMYHhAUKCETiBG6aosKgzuCPGADlU6QE4Jh
Date Thu, 16 Aug 2012 19:18:18 +0200
From Thomas Bach <thbach@students.uni-mainz.de>
To <python-list@python.org>
Subject Re: Dynamically determine base classes on instantiation
References <mailman.3324.1345065532.4697.python-list@python.org> <502c3bc2$0$29978$c3e8da3$5496439d@news.astraweb.com> <20120816125230.GA6195@roku> <vv4q285ngti575g3babb9m0l885e7vbqor@invalid.netcom.com>
MIME-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-Disposition inline
In-Reply-To <vv4q285ngti575g3babb9m0l885e7vbqor@invalid.netcom.com>
User-Agent Mutt/1.5.21 (2010-09-15)
X-Originating-IP [92.225.137.41]
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.3384.1345137498.4697.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1345137498 news.xs4all.nl 6926 [2001:888:2000:d::a6]:35080
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:27185

Show key headers only | View raw


On Thu, Aug 16, 2012 at 12:29:21PM -0400, Dennis Lee Bieber wrote:
> On Thu, 16 Aug 2012 14:52:30 +0200, Thomas Bach
> <thbach@students.uni-mainz.de> declaimed the following in
> gmane.comp.python.general:
> 
> 	Of course, since the parse result (at least from my recent
> experiment) is a Python structure, it isn't difficult to walk that
> structure...

I prefer that one, as I have the parsed data already lying around in
memory. But, as I think about it, I could also pass it to json.dumps
and parse it again. But, that wouldn't make much sense, right?

> 
> 	"But, sometimes a data field on returned data set is simply None.
> Thus, I want to extract the types from another data set and merge the
> two." ??? A "data field" /value/ of None has the /type/ "<type
> 'NoneType'>", so I don't quite understand what you intend to merge? You
> can't arbitrarily change the "type" without changing the "value".

OK, I am probably using the wrong vocabulary here again. :(

Imagine you have two data sets:

d1 = {'foo': None}
d2 = {'foo': 8}

Where I would assume that d1 has "foo" not set. That's why I want this
whole "merge"-thing in the first place: to be able to extract the type
{'foo': None} from d1 and {'foo': int} from d2 and merge the two
together which should result in {'foo': int}.

Regards,
	Thomas Bach.

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


Thread

Dynamically determine base classes on instantiation Thomas Bach <thbach@students.uni-mainz.de> - 2012-08-15 23:17 +0200
  Re: Dynamically determine base classes on instantiation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-16 00:16 +0000
    Re: Dynamically determine base classes on instantiation Thomas Bach <thbach@students.uni-mainz.de> - 2012-08-16 14:52 +0200
      Re: Dynamically determine base classes on instantiation Hans Mulder <hansmu@xs4all.nl> - 2012-08-16 17:10 +0200
        Re: Dynamically determine base classes on instantiation Thomas Bach <thbach@students.uni-mainz.de> - 2012-08-16 18:54 +0200
          Re: Dynamically determine base classes on instantiation Richard Thomas <chardster@gmail.com> - 2012-08-16 10:03 -0700
            Re: Dynamically determine base classes on instantiation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-16 17:49 +0000
              Re: Dynamically determine base classes on instantiation Richard Thomas <chardster@gmail.com> - 2012-08-17 04:50 -0700
                Re: Dynamically determine base classes on instantiation Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-17 14:53 -0400
                Re: Dynamically determine base classes on instantiation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-18 01:44 +0000
                Re: Dynamically determine base classes on instantiation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-18 11:36 +0100
          Re: Dynamically determine base classes on instantiation Richard Thomas <chardster@gmail.com> - 2012-08-16 10:03 -0700
            Re: Dynamically determine base classes on instantiation Thomas Bach <thbach@students.uni-mainz.de> - 2012-08-16 19:27 +0200
      Re: Dynamically determine base classes on instantiation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-16 18:04 +0000
    Re: Dynamically determine base classes on instantiation Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-16 12:29 -0400
    Re: Dynamically determine base classes on instantiation Richard Thomas <chardster@gmail.com> - 2012-08-16 10:09 -0700
      Re: Dynamically determine base classes on instantiation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-16 17:45 +0000
    Re: Dynamically determine base classes on instantiation Thomas Bach <thbach@students.uni-mainz.de> - 2012-08-16 19:18 +0200
      Re: Dynamically determine base classes on instantiation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-16 18:08 +0000

csiph-web