ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> cpp-sig
cpp-sig
[C++-sig] Two Pyste suggestions
by Niall Douglas other posts by this author
Sep 29 2003 10:16AM messages near this date
Re: [C++-sig] Re: Boost.Python : Byref parameters - no problems with static/non-static overloading | Re: [C++-sig] Two Pyste suggestions
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yeah, more ideas!

The first is a bit radical. I've organised the policies for my 
project into a python package called "Policies". Within it is a .py 
file for every class in my library and within each of those is an 
apply() method.

In the pyste files, each class imports its policy from 
Policies.<classname>  and calls Policies.<classname>.apply(). This in 
turn imports the policy .py files for each of the base classes the 
class inherits from and calls their apply() methods first before 
setting its own policies for its own local class. Thus you see a 
change to a base class automatically propagates through the policy 
hierarchy.

Now my suggestion is that since pyste knows what classes any class 
inherits, it could spit out the import's and apply()'s for each 
policy for class. It would save some work (I've already done it 
manually, wish I'd thought of it sooner).

The second suggestion was as I made last time, a --files parameter to 
specify a file from which to read the list of pyste files as Win2k 
has a 2Kb limit. I've attached the pyste.py file for an example.

Cheers,
Niall





-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2

iQA/AwUBP3hjPsEcvDLFGKbPEQJanACg8exEBe66enOWYGcMeMEAh1bXbF4An1QO
BYYW2KwFEC8mV+ITYUtJAKxz
=4Y4o
-----END PGP SIGNATURE-----

_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
Niall Douglas
Nicodemus
Nicodemus

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved