On Fri, Jun 21, 2013 at 12:49 AM, Russel Walker wrote:
> On Thursday, June 20, 2013 12:45:27 PM UTC+2, Antoon Pardon wrote:
>> Op 19-06-13 18:14, russ.po...@gmail.com schreef:
>>
>> >
>>
>> all(map(lambda x: bool(x), xrange(10**9)))
>>
>> Since you already have your answer, I just like to get
On Thursday, June 20, 2013 12:45:27 PM UTC+2, Antoon Pardon wrote:
> Op 19-06-13 18:14, russ.po...@gmail.com schreef:
>
> >
>
> all(map(lambda x: bool(x), xrange(10**9)))
>
>
>
> Since you already have your answer, I just like to get your attention
>
> to the fact the the lambda is super
Op 19-06-13 18:14, russ.po...@gmail.com schreef:
>
all(map(lambda x: bool(x), xrange(10**9)))
Since you already have your answer, I just like to get your attention
to the fact the the lambda is superfluous here. Your expression
above is equivallent to
all(map(bool, xrange(10**9)))
--
ht
> If you're getting this via the mailing list, just hit Reply, and then
>
> change the To: address to python-list@python.org - that's the simplest
>
> (assuming you don't have a Reply To List feature, but you wouldn't be
>
> saying the above if you had one). That way, you get a citation line,
>
>All you need is the iterator version of map(). In Python 3, that's the
>normal map(); in Python 2, use this:
from itertools import imap
all(imap(lambda x: bool(x), xrange(10**9)))
>False
>It's roughly instant, like you would expect.
>ChrisA
This probably isn't the way to post a reply
On Thu, Jun 20, 2013 at 2:32 AM, wrote:
>>All you need is the iterator version of map(). In Python 3, that's the
>>normal map(); in Python 2, use this:
>
> from itertools import imap
> all(imap(lambda x: bool(x), xrange(10**9)))
>>False
>
>>It's roughly instant, like you would expect.
>
>
On Thu, Jun 20, 2013 at 2:14 AM, wrote:
> And the following, although the same thing really as all(xrange(10**9)), is
> not as instant and will take even longer than the above.
>
all(map(lambda x: bool(x), xrange(10**9)))
>
> However if all by some chance (I don't know how this stuff works
> You code fail, see below for other comment
>
> Traceback (most recent call last):
> File "Download/pastie-2379978.rb", line 108, in
> make_template(template1)
> File "Download/pastie-2379978.rb", line 60, in make_template
> ast.fix_missing_locations(astFromSrc)
> File "/usr/lib/pyt
On Aug 17, 5:23 am, Irmen de Jong wrote:
> On 16-08-11 13:33, Paul Wray wrote:
>
>
>
>
>
>
>
>
>
> > The idea:
> > Python syntax allows a statement to be a bare literal or identifier.
> > These have no effect on the program.
>
> > So the function below is legal python:
>
> > def myFunc():
> > 'a'
"Paul Wray" wrote:
>
>Ive had what I think is a great idea for pure-python templates (I can almost
>hear the groans, bear with me...)
>...
>The idea:
>Python syntax allows a statement to be a bare literal or identifier. These
>have no effect on the program.
>...
>So is this (within the appropria
On Wed, Aug 17, 2011 at 12:57 AM, Paul Wray wrote:
> Thanks yes ama aware of docstrings but did not consider.
> They are easy to strip out though.
>
Maybe. You'd have to take notice of what's a docstring and what's the
first element to be outputted. Or alternatively, just forbid
docstrings on tho
On Aug 17, 2:14 am, Chris Angelico wrote:
> On Tue, Aug 16, 2011 at 12:33 PM, Paul Wray wrote:
> > The idea is simply to use python ASTs to transform this code so that it
> > accumulates the values of the bare expressions.
>
> That'd be similar to what the interactive loop does. Are you aware,
>
On 16-08-11 13:33, Paul Wray wrote:
The idea:
Python syntax allows a statement to be a bare literal or identifier.
These have no effect on the program.
So the function below is legal python:
def myFunc():
'a'
x = 45
'b'; 'c'; x
So is this (within the appropriate class context of course):
def
On Tue, Aug 16, 2011 at 12:33 PM, Paul Wray wrote:
> The idea is simply to use python ASTs to transform this code so that it
> accumulates the values of the bare expressions.
That'd be similar to what the interactive loop does. Are you aware,
though, that docstrings are bare expressions? You may
Hi all,
I did it. Finally managed to port mysqltuner.pl to python. Was a
real pain in the butt doing it from bottom up manually, without ever
really learing perl syntax. But i finally got it done. Now i need help
testing it. find it here.
g...@github.com:anandjeyahar/mysqlDbAdmin-python.git.
A
On 8/16/2011 7:33 AM, Paul Wray wrote:
Hello all
Ive had what I think is a great idea for pure-python templates (I can
almost hear the groans, bear with me...)
For the impatient, proof of concept is at http://pastie.org/2379978
demonstrating simple substitution, balanced tags using context mana
On Aug 16, 1:33 pm, "Paul Wray" wrote:
> Hello all
>
> Ive had what I think is a great idea for pure-python templates (I can almost
> hear the groans, bear with me...)
>
> For the impatient, proof of concept is athttp://pastie.org/2379978
> demonstrating simple substitution, balanced tags using co
Aahz, 01.03.2011 03:02:
Carl Banks wrote:
The real reason they never replaced the GIL is that fine-grained
locking is expensive with reference counting. The only way the cost
of finer-grained locking would be acceptable, then, is if they got rid
of the reference counting altogether, and that w
In article ,
Carl Banks wrote:
>
>The real reason they never replaced the GIL is that fine-grained
>locking is expensive with reference counting. The only way the cost
>of finer-grained locking would be acceptable, then, is if they got rid
>of the reference counting altogether, and that was cons
On Feb 8, 7:12 pm, Paul Rubin wrote:
> But the refcount scheme is just an implementation hack
> that gets rationalized way too much. I hope PyPy abandons it.
Done. :)
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list
sturlamolden writes:
> comes with a cost. The interpreter will sometimes pause to collect
> garbage. The memory use will be larger as well, as garbage remain
> uncollected for a while and is not immediately reclaimed. Many rely on
> CPython because the interpreter does not pause and a Python proce
On 8 Feb, 10:39, Vishal wrote:
> Is it possible that the Python process, creates copies of the
> interpreter for each thread that is launched, and some how the thread
> is bound to its own interpreter ?
In .NET lingo this is called an 'AppDomain'. This is also how tcl
works -- one interpreter p
On Feb 8, 11:49 am, John Nagle wrote:
> The real reason for the GIL, though, is to support dynamic
> code modification in multi-thread progrems. It's the ability
> to replace a function while it's being executed in another thread
> that's hard to do without a global lock. If it were just a d
On 2/8/2011 1:39 AM, Vishal wrote:
Hello,
This might sound crazy..and dont know if its even possible, but...
Is it possible that the Python process, creates copies of the
interpreter for each thread that is launched, and some how the thread
is bound to its own interpreter ?
This will increase
On Tue, 2011-02-08 at 11:52 -0500, Roy Smith wrote:
> In article ,
> Robert Kern wrote:
> > Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write
> > semantics for initializing the memory of the new process. If you want to
> > pass
> > data to the children, the data must be
Roy Smith, 08.02.2011 17:52:
Robert Kern wrote:
Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write
semantics for initializing the memory of the new process. If you want to pass
data to the children, the data must be pickled and sent across the process
boundary. He's not sa
In article ,
Robert Kern wrote:
> Unlike a UNIX fork, CreateProcess() does not have the same copy-on-write
> semantics for initializing the memory of the new process. If you want to pass
> data to the children, the data must be pickled and sent across the process
> boundary. He's not saying t
On 2/8/11 10:11 AM, Brian Curtin wrote:
On Tue, Feb 8, 2011 at 06:34, Vishal mailto:vsapr...@gmail.com>> wrote:
Also, multiprocessing has issues on Windows (most probably because of
the way CreateProcess() functions...)
Such as?
Unlike a UNIX fork, CreateProcess() does not have the sa
On Tue, Feb 8, 2011 at 06:34, Vishal wrote:
> Also, multiprocessing has issues on Windows (most probably because of
> the way CreateProcess() functions...)
Such as?
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 8, 7:34 am, Vishal wrote:
> On Feb 8, 3:05 pm, Adam Tauno Williams wrote:
>
> > On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
> > > Is it possible that the Python process, creates copies of the
> > > interpreter for each thread that is launched, and some how the thread
> > > is bound to
On Feb 8, 3:05 pm, Adam Tauno Williams wrote:
> On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
> > Is it possible that the Python process, creates copies of the
> > interpreter for each thread that is launched, and some how the thread
> > is bound to its own interpreter ?
> > and it "may" also a
On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
> Is it possible that the Python process, creates copies of the
> interpreter for each thread that is launched, and some how the thread
> is bound to its own interpreter ?
> and it "may" also allow the two threads to run in parallel, assuming
> the
r-w wrote:
> Redirect sys.stderr to the log file in ANUGA logging.
> This might catch unexpected exceptions.
brillant.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
Brian Allen Vanderburg II a écrit :
Okay so I don't really care about public/private but I was watching the
lists (Does python follow its idea of readability or something like
that) and I thought of a 'possible' way to add this support to the
language.
It has already been done at least a coup
There was a small error in setprivate/getprivate:
import sys
import inspect
def get_private_codes(class_):
codes = []
for i in class_.__dict__:
value = class_.__dict__[i]
if inspect.isfunction(value):
codes.append(value.func_code)
return codes
def get_protect
M�ta-MCI (MVP) wrote:
> Hi!
>
>> I don't often feel like using this word
>
> Look at languages like OCAML or F #
The point being? Yes, shockingly enough other languages have other syntax &
semantics.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
On 7 mai, 23:20, John Roth <[EMAIL PROTECTED]> wrote:
> On May 7, 3:03 pm, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > On 7 mai, 21:41, Gary Herron <[EMAIL PROTECTED]> wrote:
>
> > > Méta-MCI (MVP) wrote:
> > > > Hi!
>
> > > >> I don't often feel like using this word
>
> > > > Look
On May 7, 3:03 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 7 mai, 21:41, Gary Herron <[EMAIL PROTECTED]> wrote:
>
> > Méta-MCI (MVP) wrote:
> > > Hi!
>
> > >> I don't often feel like using this word
>
> > > Look at languages like OCAML or F #
>
> > > @-salutations
>
> > Well of course,
On 7 mai, 21:41, Gary Herron <[EMAIL PROTECTED]> wrote:
> Méta-MCI (MVP) wrote:
> > Hi!
>
> >> I don't often feel like using this word
>
> > Look at languages like OCAML or F #
>
> > @-salutations
>
> Well of course, we're all well aware of other languages that allow
> variables to be bound in the
> > I don't often feel like using this word
>
> Look at languages like OCAML or F #
>
I looked at OCAML and F#. Now what?
Cheers,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
"Méta-MCI (MVP)" <[EMAIL PROTECTED]> writes:
> Hi!
>
>> I don't often feel like using this word
>
> Look at languages like OCAML or F #
While I like Objective Caml, it is definitively not Python!
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
Méta-MCI (MVP) wrote:
Hi!
I don't often feel like using this word
Look at languages like OCAML or F #
@-salutations
Well of course, we're all well aware of other languages that allow
variables to be bound in the middle of an expression. It's just that
Python was purposely created without
Hi!
I don't often feel like using this word
Look at languages like OCAML or F #
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
"Méta-MCI (MVP)" <[EMAIL PROTECTED]> writes:
> Hi!
>
> print become a function ; OK
>
> I thought: and why the affection (=) would not become, also, a function?
> Examples:
>a = 123return 123
>b,c = 543.21, "LOL"return (543.21, "LOL")
Do you m
> That's hardly desirable. If one is writing a test library that goes as
> far as reparsing the assert statements, I can't see the point of
> requiring the user to clutter his test suite with such spurious print
> statements. After all, that's one of the main points of test suites in
> the first pl
Jens Theisen <[EMAIL PROTECTED]> writes:
> def test_some():
> assert a == b
>
> didn't reveal the values for a and b, though some more complex cases
> showed something.
I usually use
assert a == b, (a,b)
--
http://mail.python.org/mailman/listinfo/python-list
> #!/usr/bin/python
>
> a = 1
> b = 2
>
> def test_some():
> assert a == b
>
> didn't reveal the values for a and b, though some more complex cases
> showed something.
def test_some():
print 'a:', a, 'b:', b
assert a == b
http://codespeak.net/py/current/doc/test.html#debug-w
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> http://codespeak.net/py/current/doc/test.html#assert-with-the-assert-statement
Ok, I didn't come across this before.
I didn't work for me though, even the simple case
#!/usr/bin/python
a = 1
b = 2
def test_some():
assert a == b
Jens Theisen a écrit :
> Hello,
>
> I find it annoying that one has to write
>
> self.assertEqual(x, y)
>
> rather than just
>
> assert x == y
>
> when writing tests. This is a nuisance in all the programming
> languages I know of (which are not too many).
http://codespeak.net/py/current/doc/
metaperl wrote:
> [EMAIL PROTECTED] wrote:
>
> > | would use a recursive approach for this - given that you have a sort
> > of recursive datastructure:
> >
> > py> def SetNewDataParam2(Data, NewData):
> > ... if type(Data[Data.keys()[0]]) == type(dict()):
> > ... SetNewDataParam2(Data[
[EMAIL PROTECTED] wrote:
> | would use a recursive approach for this - given that you have a sort
> of recursive datastructure:
>
> py> def SetNewDataParam2(Data, NewData):
> ... if type(Data[Data.keys()[0]]) == type(dict()):
> ... SetNewDataParam2(Data[Data.keys()[0]], NewData)
> ...
Once again,
Thanks to all
I did not expect to receive such a response.
Very very helpful indeed,
jojoba
o(-_-)o
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> | would use a recursive approach for this - given that you have a sort
> of recursive datastructure:
>
> py> def SetNewDataParam2(Data, NewData):
> ... if type(Data[Data.keys()[0]]) == type(dict()):
Note:
|>> type(dict()) is dict
True
"dict" *is* a type...
--
ht
Like for the list.sort() method, to remind you that this function
operate by side effect, maybe it's better if it doesn't return the
modified nested dict:
def setNested(nest, path, val):
nest2 = nest
for key in path[:-1]:
nest2 = nest2[key]
nest2[path[-1]] = val
Bye,
bearophil
[EMAIL PROTECTED] wrote:
> py> def SetNewDataParam2(Data, NewData):
> ... if type(Data[Data.keys()[0]]) == type(dict()):
> ... SetNewDataParam2(Data[Data.keys()[0]], NewData)
> ... else:
> ... Data[Data.keys()[0]] = NewData
> ...
> ... return Data
> py> Data = {'a':{'b':
hey thank you so much!
that should work fantastically
i like your method much better
more elegant
thanks!
jojoba
=)
--
http://mail.python.org/mailman/listinfo/python-list
jojoba wrote:
> hello!
>
> i am trying to come up with a simple way to access my values in my
> nested python dictionaries
>
> here is what i have so far, but i wanted to run it by the geniuses out
> there who might see any probems with this...
> here is an example:
>
> +++
...
--
http://mail.python.org/mailman/listinfo/python-list
Kenneth McDonald wrote:
> Would a mailing list and newsgroup for "python contributions" be of
> interest? I currently have a module which is built on top of, and is
...
> I'd very much likes a ML/newsgroup wherein potential python contributors
> could
>
> * Post alphas/betas and seek feedback.
> *
On Fri, 03 Mar 2006 22:31:49 -0800, Paul Rubin wrote:
> I'd like to suggest adding a builtin abstract class to Python called
> AsynchronousException, which would be a subclass of Exception.
[snip rationale]
+1 on this.
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
Hello David,
Is SciPy works with python 2.4.2, Windows XP?
I thought it is only for python 2.3?
pujo
--
http://mail.python.org/mailman/listinfo/python-list
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> For example stastical module like commulative probability function for
> t distribution, or other numerical module which incorporate looping to
> get the result.
>
> I found that pyrex is very helpfull when dealing with looping
> things.
Pyrex is
For example stastical module like commulative probability function for
t distribution, or other numerical module which incorporate looping to
get the result.
I found that pyrex is very helpfull when dealing with looping things.
pujo
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I just wonder if someone has already build it.
built what? it's not like nobody's ever built a Python module using Pyrex
before, so
I guess you have to be a bit more precise if you want feedback.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I just wonder if someone has already build it.
Thanks for the response.
Best Regards,
pujo
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I have an idea to build python module to speed up python code in some
> of field where pyrex shines such as numeric, code which needs a lot of
> looping etc.
>
> What do you think?
I don't think you need anyone's permission to do that, really. Just grab
the tools and s
[EMAIL PROTECTED] wrote:
> Hello,
>
> I have an idea to build python module to speed up python code in some
> of field where pyrex shines such as numeric, code which needs a lot of
> looping etc.
Isn't numeric already written in C?
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailma
67 matches
Mail list logo