durusmail: quixote-users: Why class 'Session' has no method get_user() ?
Why class 'Session' has no method get_user() ?
2005-03-17
2005-03-17
2005-03-17
2005-03-17
2005-03-17
Why class 'Session' has no method get_user() ?
2005-03-17
Why class 'Session' has no method get_user() ?
2005-03-17
2005-03-17
2005-03-17
2005-03-17
2005-03-17
2005-03-17
Why class 'Session' has no method get_user() ?
Why class 'Session' has no method get_user() ?
Why class 'Session' has no method get_user() ?
2005-03-18
Why class 'Session' has no method get_user() ?
2005-03-18
Why class 'Session' has no method get_user() ?
2005-03-18
Why class 'Session' has no method get_user() ?
2005-03-18
Why class 'Session' has no method get_user() ?
"Template" components. Was: Why class 'Session' has no method get_user()?
2005-03-19
"Template" components. Was: Why class 'Session' has no method get_user()?
2005-03-19
Why class 'Session' has no method get_user() ?
2005-03-17
2005-03-17
2005-03-17
2005-03-17
2005-03-17
2005-03-17
Why class 'Session' has no method get_user() ?
Mike Orr
2005-03-17
David Binger wrote:

>
> On Mar 17, 2005, at 9:02 AM, Ioan Coman wrote:
>
>> Since there is a set_user(self, user)
>> why not have
>>     def get_user(self):
>>          return self.user
>
>
> Good idea.  Just checked in.
>
> I'm a little worried about the clarity of
> the 'has_info' question, (with or without your other change).
> I think adding the items container doesn't make this clearer,
> since some 'info' may also come from other session attributes,
> not involved in __setitem__ calls.


Grr, gratuitous accessor functions get my goat.  This is Python, not
Java.  We have properties in case an attribute setting needs
validation.  (Another reason to make all classes new-style...)  There's
already quixote.get_user() if you reeeeally want to use a function.  I
thought .set_user() was a method because of the significance it had for
the application.

+0.5 for making Session dictionary-like though.  No reason to
arbitrarily limit its usability.

+1 to rename .has_info().

reply