Stefan Behnel wrote:
> Kay Schluehr wrote:
>
>>What about letting your teammates editing certain data-structures in
>>different files ( physical modules ) but using them in a uniform way
>>and enable a single access point. If you have partial classes there is
>>no reason why your team has to share
Kay Schluehr wrote:
> What about letting your teammates editing certain data-structures in
> different files ( physical modules ) but using them in a uniform way
> and enable a single access point. If you have partial classes there is
> no reason why your team has to share a large file where they h
> Anyway, I would suggest you NOT to use this code in production. Yes,
> Python
> can imitate Ruby, but using this kind of classes would confuse
> everybody and
> make your code extremely unpythonic. As always, consider changing your
> mindset,
> when you switch language. For you problem, you could
Sanjay ha scritto:
> Thanks for the code showing how to implement partial classes. Infact, I
> was searching for this code pattern. I will have a study on metaclass
> and then try it.
>
> Thanks
> Sanjay
Anyway, I would suggest you NOT to use this code in production. Yes,
Python
can imitate Ruby
Bruno Desthuilliers wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> John Salerno wrote:
>> Marc 'BlackJack' Rintsch wrote:
>>
>>> Can you flesh out your use case a little bit and tell why you can't
>>> solve the problem with inheritance or a meta class?
>>
>>
>> From my experience with
Bruno Desthuilliers wrote:
> John Salerno wrote:
>> Marc 'BlackJack' Rintsch wrote:
>>
>>> Can you flesh out your use case a little bit and tell why you can't solve
>>> the problem with inheritance or a meta class?
>>
>> From my experience with C#, the only real use for partial classes is
>> when y
> > Class PersonBO(Person):
> > def Block():
> > blocked = True
>
>
> shouldn't it be:
> class PersonBO(Person):
> def block(self):
> self.blocked = True
>
Yes, it should be as you mentioned. However, I had posted it to
elaborate the case. Actually, I tested using the follow
John Salerno wrote:
> Marc 'BlackJack' Rintsch wrote:
>
> > Can you flesh out your use case a little bit and tell why you can't solve
> > the problem with inheritance or a meta class?
>
> From my experience with C#, the only real use for partial classes is
> when you want to separate your GUI cod
Sanjay wrote:
>>Can you flesh out your use case a little bit and tell why you can't solve
>>the problem with inheritance or a meta class?
>
>
> I have to study about metaclass and see whether this can be handled. It
> seemed inheritence is not working.
>
> PROBLEM: Separating plumbing code and b
John Salerno wrote:
> Marc 'BlackJack' Rintsch wrote:
>
>> Can you flesh out your use case a little bit and tell why you can't solve
>> the problem with inheritance or a meta class?
>
>
> From my experience with C#, the only real use for partial classes is
> when you want to separate your GUI co
Marc 'BlackJack' Rintsch wrote:
> Can you flesh out your use case a little bit and tell why you can't solve
> the problem with inheritance or a meta class?
From my experience with C#, the only real use for partial classes is
when you want to separate your GUI code from the rest of your logic. B
Kay Schluehr wrote:
> This definition lacks a check for disjointness of the parts. No two
> partial classes shall contain a method with the same name.
Yes - I mentioned at the bottom that the last one evaluated will
overwrite any existing one. You're right that its probably a better
idea to che
[EMAIL PROTECTED] wrote:
> Sanjay wrote:
> > Hi All,
> >
> > Not being able to figure out how are partial classes coded in Python.
> >
> > Example: Suppose I have a code generator which generates part of a
> > business class, where as the custome part is to be written by me. In
> > ruby (or C#), I
Thanks for the code showing how to implement partial classes. Infact, I
was searching for this code pattern. I will have a study on metaclass
and then try it.
Thanks
Sanjay
--
http://mail.python.org/mailman/listinfo/python-list
Kay Schluehr wrote:
> Bruno Desthuilliers wrote:
>
>>Sanjay wrote:
>>
>>>Hi Alex,
>>>
>>>Thanks for the input.
>>>
>>>Being new to Python, and after having selected Python in comparison to
>>>ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
>>>be an obvious and easy to imple
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files. Li
Bruno Desthuilliers wrote:
> Sanjay wrote:
> > Hi Alex,
> >
> > Thanks for the input.
> >
> > Being new to Python, and after having selected Python in comparison to
> > ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
> > be an obvious and easy to implement feature and must
Sanjay wrote:
> Hi Alex,
>
> Thanks for the input.
>
> Being new to Python, and after having selected Python in comparison to
> ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
> be an obvious and easy to implement feature and must be, if not already
> have been, planned in
> Can you flesh out your use case a little bit and tell why you can't solve
> the problem with inheritance or a meta class?
I have to study about metaclass and see whether this can be handled. It
seemed inheritence is not working.
PROBLEM: Separating plumbing code and business logic while using
S
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files.
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files.
On Wed, 18 Jul 2006, Sanjay wrote:
> What is the equivalent in Python? Inheriting is a way, but is not
> working in all scenerios.
Have you tried multiple inheritance? For example:
from GeneratedPerson import GeneratedPerson
from HandcraftedPerson import HandcraftedPerson
class Person(Generated
In <[EMAIL PROTECTED]>, Sanjay wrote:
> Being new to Python, and after having selected Python in comparison to
> ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
> be an obvious and easy to implement feature and must be, if not already
> have been, planned in future releases
Hi Alex,
Thanks for the input.
Being new to Python, and after having selected Python in comparison to
ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should
be an obvious and easy to implement feature and must be, if not already
have been, planned in future releases of Python.
W
Sanjay wrote:
> Hi All,
>
> Not being able to figure out how are partial classes coded in Python.
>
> Example: Suppose I have a code generator which generates part of a
> business class, where as the custome part is to be written by me. In
> ruby (or C#), I divide the code into two source files. L
Sanjay wrote:
> Not being able to figure out how are partial classes coded in Python.
Hi Sanjay,
To the best of my knowledge, Python currently has no support for
partial classes.
However, BOO (http://boo.codehaus.org/) - which is a Python-like
language for the .NET CLI)- _does_ support partial c
26 matches
Mail list logo