On Friday, February 1, 2013 12:09:04 AM UTC-5, Chris Angelico wrote:
> On Fri, Feb 1, 2013 at 4:00 PM, Steven D'Aprano
>
> wrote:
>
> > dg.google.gro...@thesamovar.net wrote:
>
> >
>
> >> If you could take one minute to make sure you
>
> >> are signed in to your Google+ account
>
> >
>
> >
On Thursday, January 31, 2013 10:06:44 PM UTC-5, Terry Reedy wrote:
> On 1/31/2013 8:05 PM, dg.google.gro...@thesamovar.net wrote:
> > Here's the link to the article:
> > http://www.scholarpedia.org/article/Brian_simulator
>
> 'Brian' is obviously a play on 'brain', with two letters transposed. Bu
Hi everyone,
There is currently a competition running that could help give Python in
computational science a bit of visibility. The competition is for the
most popular recently published article on the Scholarpedia website, one
of which is about a Python package "Brian" for computational
neuroscie
Hi all,
Has anyone managed to get any of the Python CUDA libraries working on
Windows using cygwin? Which one, and was anything special required?
Thanks in advance for any advice.
Dan
--
http://mail.python.org/mailman/listinfo/python-list
I also wrote a units package which I'm using for a project of my own
(a spiking neural network simulator package called 'Brian'), released
separately as a package called Piquant which you can get at
sourceforge:
http://sourceforge.net/projects/piquant
I'm also looking for people to help improve i
On Feb 14, 11:06 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> It depends on what you mean by "an interactive shell"? If you start your
> script with:
> python -i whatever.py
> is it an interactive shell or not?
>
> I tried these two criteria:
> a) See if the __main__ module has a __file__ a
Thanks for the replies, but it's not what I meant. What I want to be
able to determine is whether or not the user is running from an
interactive shell (like IPython or IDLE). Checking if
__name__=='__main__' checks if the current module is the one being
run, but suppose you have two modules A and B
Hi all,
Is there any standard way to tell if the user is running from a module
or from an interactive shell like IDLE or IPython? The best I've come
up with so far is for a function to look at
getouterframes(currentframe())[1][1] (the filename in the frame record
of the frame that called the funct
> > Does this mean that __setattr__
> > incurs the same performance penalty that overriding __getattribute__
> > would?
>
> Not quite AFAICT - there's less going on here. Also, getting an
> attribute is (usually at least) more common than setting it.
>
> > Possibly I can live with this because I th
> As a side note: the naming symetry between __getattr__ and __setattr__
> is a gotcha, since __setattr__ is mostly symetric to __getattribute__ -
> IOW, customizing __setattr__ is a bit tricky. The naive approach, ie:
Ah I see - so __setattr__ is called immediately whereas __getattr__ is
only cal
On Feb 6, 11:09 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> While this is technically possible (I tried a couple years ago), it
> requires hacking the __getattribute__ method, which is something I
> would not recommand, not only because it can be tricky, but mostly
> because this is a very
On Feb 6, 10:54 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> I'd suggest a small improvement: _A as a class name isn't very nice.
> Replace the inner class statement with:
> _A = type(self.__class__.__name__ + '_autoprops', (self.__class__,), {})
Ah yes, that's much nicer.
> A problem wit
Hi all,
So I understand that properties belong to a class not an instance, but
nonetheless I want to add properties to an instance. I have a class
which when an instance is created runs some fairly complicated code
and produces a set of names which I'd like to be able to access via
properties. At
Hi all,
As I understand it, the idea behind duck typing is that you just take
an object and if it has the methods you want to use you use it
assuming it to be the right type of object. I'm interested in
extending this idea a bit, but I feel the sort of thing I have in mind
has already been thought
It's a bit cheap, but how about
>>> from inspect import getsource
>>> print getsource(getsource)
or similarly
def f(g):
import inspect
return inspect.getsource(g)
print f(f)
Dan
--
http://mail.python.org/mailman/listinfo/python-list
Well I tried the NumPy array thing that I was talking about, to
parallelise the problem, and there were some difficulties with it.
Firstly, the pruning makes a really big difference to the speed, and
you don't get that if you're trying to parallelise the problem because
what is an equivalent calcul
Arnaud and Terry,
Great solutions both of you! Much nicer than mine. I particularly like
Arnaud's latest one based on folding because it's so neat and
conceptually simple. For me, it's the closest so far to my goal of the
most elegant solution.
So anyone got an answer to which set of numbers give
Decided I may as well post my other solution while I'm at it. The neat
trick here is redefining the add, mul, etc. functions so that they
raise exceptions for example if x>y then add(x,y) raises an exception
which is handled by the search algorithm to mean don't continue that
computation - this sto
Hi all,
It's great how many different sorts of solutions (or almost solutions)
this puzzle has generated. Speedwise, for reference my solution posted
above takes about 40 seconds on my 1.8GHz laptop, and the less elegant
version (on my webpage linked to in the original post) takes about 15
seconds
Hi Marek,
That's a really nice solution (and ultrafast).
Unfortunately I realise I stated the problem imprecisely. You're only
allowed to use each number once (otherwise there's a trivial solution
for every problem, i.e. x/x + x/x + x/x + ... + x/x repeated y times
for target y given any source n
Ever since I learnt to program I've always loved writing solvers for
the Countdown numbers game problem in different languages, and so now
I'm wondering what the most elegant solution in Python is.
If you don't know the game, it's simple: you're given six randomly
chosen positive integers, and a t
Hi Rüdiger,
Thanks for your message. I liked your approach and I've been trying
something along exactly these sorts of lines, but I have a few
problems and queries.
The first problem is that the id of the frame object can be re-used,
so for example this code (where I haven't defined InstanceTrac
Thanks everyone for the comments.
I had previously thought about the possibility of the classes keeping
track of their instances. I guess this could probably be done quite
transparently with a decorator too (as we have many different types of
objects being collected together). The only issue is th
Hi all,
I'm part of a small team writing a Python package for a scientific
computing project. The idea is to make it easy to use for relatively
inexperienced programmers. As part of that aim, we're using what we're
calling 'magic functions', and I'm a little bit concerned that they
are dangerous c
24 matches
Mail list logo