Re: [BangPypers] Any python metaclasses for UID
We will have to wait for UID I guess. In a ''real world scenario'' class ClassI(Gates): def __init__(): super(UID,self).Wind(7) friend void exchange(ClassI x, Gates y) void exchange(A x, B y) { B.x = A.location.awards A.x = B.location.banks.outsource } These classes extended from probably c++ or so (of whose patchy source is closed) . Now the issue is this class has also a friend in UID but can be extended by python in real world. class UID(): friend void A::show(ClassI x, UID y); UID is meant to be in public domain of whose behaviour is unknown. Should be available near future Py 3.0 Coming back to the question: Can there be a metaclass in python which can change the behaviour of object at creation stage by extending it and nullifying friend functions? -- Regards ___ Shivaraj ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Any python metaclasses for UID
On 27-Jul-09, at 1:50 PM, Shivaraj M S wrote: [snip] Can there be a metaclass in python which can change the behaviour of object at creation stage by extending it and nullifying friend functions? (I must confess this is the only sentence in the email that I could comprehend...) If what you are looking for is a way to customize object creation, have a look at the __new__ class method. It is called before __init__, and can return _any_ object when the client code attempts to instantiate the class. In some cases I have dynamically generated a subclass of the class using type(), and returned a new instance of that. I think this is the kind of thing you are looking for. -Taj. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Any python metaclasses for UID
On Mon, Jul 27, 2009 at 02:50:39PM +0530, Sirtaj Singh Kang wrote: On 27-Jul-09, at 1:50 PM, Shivaraj M S wrote: [snip] Can there be a metaclass in python which can change the behaviour of object at creation stage by extending it and nullifying friend functions? (I must confess this is the only sentence in the email that I could comprehend...) Very true. Shivaraj: It is nearly incomprehensible as what you are trying to convey. If you are a beginning python programmer (but a good other language programmer), a couple of tutorials at www.python.org may help perhaps? -- Senthil Needs are a function of what other people have. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] User group meeting this weekend
Thanks for the reply. Looking forward for the next meeting. Senthil Kumaran-6 wrote: On Sun, Jul 26, 2009 at 04:42:38PM +0530, Arvind Jamuna Dixit wrote: I am feeling very bad for myself for having missed yesterday's meeting and am interested in knowing the minutes of yesterday's meeting. You might join the next meeting perhaps. The checked the wiki but did not find much details about the meeting. We are lazy to write the minutes of the meeting. Perhaps we need someone who is interested in writing the minutes (and he/she sees some form of personal benefit in doing so). Roughly we discussed the following. * Python 3.1 - How to get started with it. * Subtopics included Unicode vs Strings. Strings vs Bytes. Whats new * in python * Brad showed the audience some interesing programming paradigms used at ZeOmega for their purposes. * We discussed about logging module of Python * Discussed about PyCon and Brad shared some of his thoughts on how PyCon is organized. The essence of PyCon, etc. The meeting started around 2:00 /2:30 ( I was unfortunately late at 3:00 pm) and went till 6:30 pm. I enjoyed it, I learnt a lot of things and I hope others enjoyed the meet too. -- Senthil Your society will be sought by people of taste and refinement. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers -- View this message in context: http://www.nabble.com/User-group-meeting-this-weekend-tp24581644p24680724.html Sent from the BangPypers - Bangalore Python Users Group mailing list archive at Nabble.com. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers