> Oops, I misread your code. I'm not used to seeing python code in a class
> definition other than defining methods. Sorry. However that clarifies why
> you are putting it into a class.
Actually, it would have been the same outside a class, with the enclosing
module playing the role of the class
On Saturday, January 16, 2016 at 1:08:08 AM UTC-8, fhivert wrote:
>
> On Fri, Jan 15, 2016 at 03:36:23PM -0800, Travis Scrimshaw wrote:
> > In the interest of speed, to avoid calls to `sys,platform`, I would make
> > foo a (module level) @lazy_attribute or @cached_function. IMO a full
> class
On Sat, Jan 16, 2016 at 05:55:01AM -0800, Dima Pasechnik wrote:
> IMHO this is still far from the best way of doing such things - namely,
> wrap whatever platform-specific you must do with semaphores in a special
> class, so that the code where they are used does not do any
> platform-specific th
IMHO this is still far from the best way of doing such things - namely,
wrap whatever platform-specific you must do with semaphores in a special
class, so that the code where they are used does not do any
platform-specific things at all.
Otherwise platform-specific code would proliferate like ver
On Fri, Jan 15, 2016 at 03:36:23PM -0800, Travis Scrimshaw wrote:
> In the interest of speed, to avoid calls to `sys,platform`, I would make
> foo a (module level) @lazy_attribute or @cached_function. IMO a full class
> is a lot more than you need.
First of all, in my usecase, those are only two
On Friday, January 15, 2016 at 3:36:24 PM UTC-8, Travis Scrimshaw wrote:
>
> In the interest of speed, to avoid calls to `sys,platform`, I would make
> foo a (module level) @lazy_attribute or @cached_function. IMO a full class
> is a lot more than you need.
>
> According to https://docs.python.or
In the interest of speed, to avoid calls to `sys,platform`, I would make
foo a (module level) @lazy_attribute or @cached_function. IMO a full class
is a lot more than you need.
Best,
Travis
On Friday, January 15, 2016 at 8:49:40 AM UTC-8, Volker Braun wrote:
>
> THats fine (except that you sho
THats fine (except that you should use new-style classes)
On Friday, January 15, 2016 at 5:34:35 PM UTC+1, fhivert wrote:
>
> Dear all,
>
> I'd like to have a class with a method with some implementation internal
> that
> differ if the os is MacOS of anything else.
>
> Context
> ===