2012/10/30 alex23 :
> On Oct 30, 2:33 am, Johannes Bauer wrote:
>> I'm currently looking for a good solution to the following problem: I
>> have two classes A and B, which interact with each other and which
>> interact with the user. Instances of B are always created by A.
>>
>> Now I want A to ca
On Oct 30, 2:33 am, Johannes Bauer wrote:
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to call some private methods of
On Mon, 29 Oct 2012 17:33:24 +0100, Johannes Bauer wrote:
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A
On Mon, Oct 29, 2012 at 10:58 AM, Johannes Bauer wrote:
> Ah, that's nice. I didn't know that nested classes could access their
> private members naturally (i.e. without using any magic, just with plain
> old attribute access).
There is nothing at all special about nested classes that is differen
On 2012-10-29, Johannes Bauer wrote:
> On 29.10.2012 17:47, Chris Angelico wrote:
>
>> The usual convention for private methods is a leading underscore on the name:
>
> Yup, that's what I'm using.
>
>> It's only a convention, though; it doesn't make it "hard" to call
>> them, it just sends the mes
Johannes Bauer wrote:
> On 29.10.2012 17:52, Grant Edwards wrote:
>
>> By "decleare them privide" do you mean using __ASDF__ name-munging?
>>
>> It sounds to me like you're just making life hard on yourself.
>
> Gaah, you are right. I just noticed that using the single underscore
> (as I do
Johannes Bauer writes:
> This makes the source files largish however (they're currently split up
> in different files). Can I use the nested class advantage and somehow
> include the inner class from another file?
You could possibly duck-punch class A:
import B
class A:
...
A.B = B.B
Johannes Bauer wrote:
> Now I want A to call some private methods of B and vice versa (i.e. what
> C++ "friends" are), but I want to make it hard for the user to call
> these private methods.
>
> Currently my ugly approach is this: I delare the internal methods
> private (hide from user). Then I
On 29.10.2012 17:52, Grant Edwards wrote:
> By "decleare them privide" do you mean using __ASDF__ name-munging?
>
> It sounds to me like you're just making life hard on yourself.
Gaah, you are right. I just noticed that using the single underscore
(as I do) does not restrict usage in any "no
On 29.10.2012 17:47, Chris Angelico wrote:
> The usual convention for private methods is a leading underscore on the name:
Yup, that's what I'm using.
> It's only a convention, though; it doesn't make it "hard" to call
> them, it just sends the message "this is private, I don't promise that
> it
On 2012-10-29, Johannes Bauer wrote:
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to call some private methods of B an
On Tue, Oct 30, 2012 at 3:33 AM, Johannes Bauer wrote:
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to ca
On Mon, Oct 29, 2012 at 9:33 AM, Johannes Bauer wrote:
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to ca
2012/10/29 Johannes Bauer :
> Hi there,
>
> I'm currently looking for a good solution to the following problem: I
> have two classes A and B, which interact with each other and which
> interact with the user. Instances of B are always created by A.
>
> Now I want A to call some private methods of B
Hi there,
I'm currently looking for a good solution to the following problem: I
have two classes A and B, which interact with each other and which
interact with the user. Instances of B are always created by A.
Now I want A to call some private methods of B and vice versa (i.e. what
C++ "friends"
15 matches
Mail list logo