Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset befd56673c80 by Nick Coghlan in branch 'default':
Close #14588: added a PEP 3115 compliant dynamic type creation mechanism
http://hg.python.org/cpython/rev/befd56673c80
--
nosy: +python-dev
resolution: -
Éric Araujo mer...@netwok.org added the comment:
Great doc patch. I think it would be worthwhile to backport it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14588
___
Daniel Urban urban.dani...@gmail.com added the comment:
Here is my first attempt at creating a pure Python version of the
operator.build_class function (in my previous patch) as types.new_class.
The three added functions (two private and one public) correspond to the
following functions in my
Éric Araujo mer...@netwok.org added the comment:
Implementing in pure Python seems to have a lot of pros and no con to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14588
___
Nick Coghlan ncogh...@gmail.com added the comment:
Based on the python-dev thread [1], the proposed name for this API is now
types.new_class().
This parallels the existing imp.new_module() naming scheme and avoids various
problems with the idea of using a static method on type itself
Nick Coghlan ncogh...@gmail.com added the comment:
In going to add documentation for your patch, I realised the operator module is
not the right place for this.
The types module actually seems like the most appropriate home, but that will
require adding a _types module to back it.
I'll post
Daniel Urban urban.dani...@gmail.com added the comment:
I've attached the third patch with the eval_body - exec_body change;
explicitly passing the default (None) now also allowed. I also fixed a refleak
(I think).
--
Added file:
Daniel Urban urban.dani...@gmail.com added the comment:
Fair enough.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14588
___
___
Nick Coghlan ncogh...@gmail.com added the comment:
It occurs to me that, for naming consistency, the callback arg should be
documented as exec_body rather than eval_body.
I'll try to get to a proper patch review this weekend.
--
___
Python tracker
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14588
___
___
Daniel Urban urban.dani...@gmail.com added the comment:
I've attached a patch with more tests. I simply copied and modified the tests
about metaclass calculation and __prepare__ in test_descr.py, to create the
tested classes with operator.build_class (and not the class statement).
Although,
Nick Coghlan ncogh...@gmail.com added the comment:
I thought about that, and I'd prefer a dedicated dictionary to avoid questions
of name conflicts.
Wrapping the keyword args in a dict() call is still pretty clean:
C = operator.build_class('C', (A, B), dict(metaclass=MyMeta))
--
Changes by R. David Murray rdmur...@bitdance.com:
--
assignee: - ncoghlan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14588
___
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14588
___
___
Python-bugs-list
: 158382
nosy: durban, ncoghlan
priority: normal
severity: normal
status: open
title: PEP 3115 compliant dynamic class creation
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25231/operator_build_class.patch
___
Python tracker rep
In article 8d79f0cb-9c5b-4243-8891-a15fb311f...@z18g2000prh.googlegroups.com,
Josh English joshua.r.engl...@gmail.com wrote:
market code='anlg' tier='ProMarket' mail='True'
title field=prefAnalog Science Fiction and Fact/title
nicknameAnalog/nickname
keywordScience Fiction/keyword
Chris,
Thanks. This worked for the attributes, but I think the tactic is
still misleading. There are child elements I can't quite determine how
to deal with:
market code='anlg' tier='ProMarket' mail='True'
title field=prefAnalog Science Fiction and Fact/title
nicknameAnalog/nickname
Josh English wrote:
Chris,
Thanks. This worked for the attributes, but I think the tactic is
still misleading. There are child elements I can't quite determine how
to deal with:
market code='anlg' tier='ProMarket' mail='True'
title field=prefAnalog Science Fiction and Fact/title
I have a large program with lots of data stored in XML. I'm upgrading
my GUI to use ObjectListView, but with my data in XML, I don't have
regular objects to interact with the OLV. I do have an XML validator
that defines the structure of the XML elements, and I'm trying to
dynamically create a
On Mon, Mar 15, 2010 at 11:01 PM, Josh English
joshua.r.engl...@gmail.com wrote:
I have a large program with lots of data stored in XML. I'm upgrading
my GUI to use ObjectListView, but with my data in XML, I don't have
regular objects to interact with the OLV. I do have an XML validator
that
On Tue, Mar 16, 2010 at 2:18 AM, Chris Rebert c...@rebertia.com wrote:
On Mon, Mar 15, 2010 at 11:01 PM, Josh English
joshua.r.engl...@gmail.com wrote:
I have a large program with lots of data stored in XML. I'm upgrading
my GUI to use ObjectListView, but with my data in XML, I don't have
On Tue, Mar 16, 2010 at 9:49 AM, Jack Diederich jackd...@gmail.com wrote:
On Tue, Mar 16, 2010 at 2:18 AM, Chris Rebert c...@rebertia.com wrote:
On Mon, Mar 15, 2010 at 11:01 PM, Josh English
joshua.r.engl...@gmail.com wrote:
snip
What's the best way to create these helper methods?
You can
22 matches
Mail list logo