Rick Johnson wrote:
> However, when we are talking about the Python
> programming language "readable" simply means: "neophyte readable".
> That is, "readable to someone with little or no experience with the
> language".
Nonsense. List comprehensions are not immediately obvious to new
Python users
On 15Mar2012 12:22, Ben Finney wrote:
| Roy Smith writes:
| > I'll admit I hadn't considered that, but I don't see it as a major
| > problem. The type intuition could be designed to only work for types
| > other than NoneType.
|
| −1, then. It's growing too many special cases, and is no longer s
On Mar 14, 7:27 pm, Chris Angelico wrote:
> Okay, here's something for debate.
>
> Should the readability of a language be gauged on the basis of its
> standard library, or should you be comparing actual code?
I think the library matters greatly. Yes, one could argue that the
same functionality "
On 03/14/2012 01:27 PM, Prasad, Ramit wrote:
It seems like an excellent thing to add to the "os" module.
If 'prctl' is a standard POSIX system call, then it should be a
candidate for inclusion in the os module if someone opens a tracker
enhancement issue and presents an argument in favor.
I th
On 15/03/2012 00:52, Roy Smith wrote:
In article<4f612a9d$0$12033$742ec...@news.sonic.net>,
John Nagle wrote:
On 3/13/2012 2:08 PM, Roy Smith wrote:
> Using argparse, if I write:
>
> parser.add_argument('--foo', default=100)
>
> it seems like it should be able to intuit that th
Roy Smith writes:
> I'll admit I hadn't considered that, but I don't see it as a major
> problem. The type intuition could be designed to only work for types
> other than NoneType.
−1, then. It's growing too many special cases, and is no longer simple
to describe, so that indicates it's probably
In article <4f612a9d$0$12033$742ec...@news.sonic.net>,
John Nagle wrote:
> On 3/13/2012 2:08 PM, Roy Smith wrote:
> > Using argparse, if I write:
> >
> > parser.add_argument('--foo', default=100)
> >
> > it seems like it should be able to intuit that the type of foo should
> > be int (i.e.
On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle wrote:
> I don't know this book and there may be a pedagogical reason for the
> implementation you quote, but pairwise_sum is probably better
> implemented in Python 3.X as:
>
> def pairwise_sum(list1, list2):
> return [x1 + x2 for x1, x2 in zi
On Thu, Mar 15, 2012 at 7:37 AM, Croepha wrote:
> Which is preferred:
>
> for value in list:
> if not value is another_value:
> value.do_something()
> break
>
> --or--
>
> if list and not list[0] is another_value:
> list[0].do_something()
>
> Comments are welcome, Thanks
General principle
On 14 March 2012 23:34, Kiuhnm wrote:
> I've just started to read
> The Quick Python Book (2nd ed.)
> The author claims that Python code is more readable than Perl code and
> provides this example:
>
> --- Perl ---
> sub pairwise_sum {
> my($arg1, $arg2) = @_;
> my(@result) = ();
> @list
I've just started to read
The Quick Python Book (2nd ed.)
The author claims that Python code is more readable than Perl code and
provides this example:
--- Perl ---
sub pairwise_sum {
my($arg1, $arg2) = @_;
my(@result) = ();
@list1 = @$arg1;
@list2 = @$arg2;
for($i=0; $i <
On 3/13/2012 2:08 PM, Roy Smith wrote:
Using argparse, if I write:
parser.add_argument('--foo', default=100)
it seems like it should be able to intuit that the type of foo should
be int (i.e. type(default)) without my having to write:
parser.add_argument('--foo', type=int, default=10
On Thu, 15 Mar 2012 08:26:22 +1100, Ben Finney wrote:
> Jon Clements writes:
>
>> import inspect
>> if inspect.ismethod(foo):
>># ...
>>
>> Will return True if foo is a bound method.
>
> But under what other conditions will it return True? The name suggests
> that *any* method – static meth
> > Only use 'is' if you are looking for objects like True,
> > False, None or something that MUST be exactly the same object.
>
> I've rarely seen valid uses of 'is True' or 'is False'.
It can be useful when you think something might be None or False. Although,
I suppose you could always just us
On 14 March 2012 22:15, Prasad, Ramit wrote:
> Only use 'is' if you are looking for objects like True,
> False, None or something that MUST be exactly the same object.
I've rarely seen valid uses of 'is True' or 'is False'.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
> >> Which is preferred:
> >>
> >> for value in list:
> >> if not value is another_value:
> >> value.do_something()
> >> break
>
> Do you really mean 'is' or '=='?
Let me expound on how 'is' and '==' are very different. It may work
for some comparisons but often not for others. Certain
On 3/14/2012 4:53 PM, Herman wrote:
I followed the rule because it was a very good advice. For example,
def test_plus_1Plus1_2(self):
Suppose you want to test that a function call returns a particular
300-char multiline string?
If this test fails, you immediately know that it's testing the
Jon Clements writes:
> import inspect
> if inspect.ismethod(foo):
># ...
>
> Will return True if foo is a bound method.
But under what other conditions will it return True? The name suggests
that *any* method – static method, class method, bound method, unbound
method – will also result in T
On 3/14/2012 4:49 PM, Arnaud Delobelle wrote:
On 14 March 2012 20:37, Croepha wrote:
Which is preferred:
for value in list:
if not value is another_value:
value.do_something()
break
Do you really mean 'is' or '=='?
If you mean x is not y, write it that way.
'not x is y' can be mis
I followed the rule because it was a very good advice. For example,
def test_plus_1Plus1_2(self):
If this test fails, you immediately know that it's testing the "plus"
method, with 1 and 1 as the arguments, and expect to return 2.
Sticking this rule also means your test cases are small enough, so
On 14 March 2012 20:37, Croepha wrote:
> Which is preferred:
>
> for value in list:
> if not value is another_value:
> value.do_something()
> break
>
> --or--
>
> if list and not list[0] is another_value:
> list[0].do_something()
Hard to say, since they don't do the same thing :)
I suspe
Which is preferred:
for value in list:
if not value is another_value:
value.do_something()
break
--or--
if list and not list[0] is another_value:
list[0].do_something()
Comments are welcome, Thanks
--
http://mail.python.org/mailman/listinfo/python-list
On 03/14/12 12:06, Terry Reedy wrote:
On 3/14/2012 6:07 AM, Gelonida N wrote:
Now I'm looking for a library, which behaves like config parser, but
with one minor difference.
The write() mehtod should keep existing comments.
Assuming that you have not overlooked anything, I would just subclass
On Wed, Mar 14, 2012 at 7:30 AM, Roy Smith wrote:
> It's already inferred that the type is a string if you don't give it any
> value. What possible meaning could:
>
> parser.add_argument('--foo', default=100)
>
> have? If I run the program with:
>
> $ prog
>
> then foo defaults to the integer 10
Darrel Grant wrote:
> In the virtualenv example bootstrap code, a global join function is used.
>
> http://pypi.python.org/pypi/virtualenv
At this point there is probably an import that you have overlooked:
from os.path import join
> subprocess.call([join(home_dir, 'bin', 'easy_install'),
On Wed, Mar 14, 2012 at 11:41 AM, Darrel Grant wrote:
> In the virtualenv example bootstrap code, a global join function is used.
>
> http://pypi.python.org/pypi/virtualenv
>
> subprocess.call([join(home_dir, 'bin', 'easy_install'),
> 'BlogApplication'])
>
>
> In interpeter,
On Wednesday, 14 March 2012 18:41:27 UTC, Darrel Grant wrote:
> In the virtualenv example bootstrap code, a global join function is used.
>
> http://pypi.python.org/pypi/virtualenv
>
> subprocess.call([join(home_dir, 'bin', 'easy_install'),
> 'BlogApplication'])
>
>
>
In the virtualenv example bootstrap code, a global join function is used.
http://pypi.python.org/pypi/virtualenv
subprocess.call([join(home_dir, 'bin', 'easy_install'),
'BlogApplication'])
In interpeter, I tried this:
>>> [join([], 'bin', 'easy_install')]
Traceback (mo
Can i come in am i welcome
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy writes:
> On 3/14/2012 12:02 PM, Grant Edwards wrote:
>
>> It seems like an excellent thing to add to the "os" module.
>
> If 'prctl' is a standard POSIX system call, then it should be a
> candidate for inclusion in the os module if someone opens a tracker
> enhancement issue and pres
On 14/03/2012 13:30, Roy Smith wrote:
In article<87399bgw18@benfinney.id.au>,
Ben Finney wrote:
Right. I dislike proposals for run-time type inference in Python, since
they are too magical.
Especially since we're talking about user input (arguments from the
command line to the progr
> > > It seems like an excellent thing to add to the "os" module.
> >
> > If 'prctl' is a standard POSIX system call, then it should be a
> > candidate for inclusion in the os module if someone opens a tracker
> > enhancement issue and presents an argument in favor.
>
>
> I think this request wa
> > It seems like an excellent thing to add to the "os" module.
>
> If 'prctl' is a standard POSIX system call, then it should be a
> candidate for inclusion in the os module if someone opens a tracker
> enhancement issue and presents an argument in favor.
I think this request was already denied
On 3/14/2012 12:02 PM, Grant Edwards wrote:
It seems like an excellent thing to add to the "os" module.
If 'prctl' is a standard POSIX system call, then it should be a
candidate for inclusion in the os module if someone opens a tracker
enhancement issue and presents an argument in favor.
-
On 3/14/2012 6:07 AM, Gelonida N wrote:
Hi,
At the moment I use ConfigParser
http://docs.python.org/library/configparser.html
for one of my applications.
Now I'm looking for a library, which behaves like config parser, but
with one minor difference.
The write() mehtod should keep existing co
On 2012-03-14, Chris Angelico wrote:
> On Thu, Mar 15, 2012 at 1:43 AM, xliiv wrote:
>> Like the topic.. .
>> I use Python a lot, both Windows and Linux, and it's little weird to have
>> many python process without fast distinction which is what.
>
> I've no idea if it's even possible on Windows
On Thu, Mar 15, 2012 at 1:43 AM, xliiv wrote:
> Like the topic.. .
> I use Python a lot, both Windows and Linux, and it's little weird to have
> many python process without fast distinction which is what.
I've no idea if it's even possible on Windows. On Linux, what you want
is the prctl functio
Disregard, apparently you can't include a {block} more than once in a Jinja2
template, which was causing the error.
Cheers,
Joed
--
http://mail.python.org/mailman/listinfo/python-list
Like the topic.. .
I use Python a lot, both Windows and Linux, and it's little weird to have many
python process without fast distinction which is what.
--
http://mail.python.org/mailman/listinfo/python-list
On Wednesday, 14 March 2012 14:16:35 UTC, JoeM wrote:
> Hi All,
>
> I'm having issues including a {block} of content from Jinja2
> template into a jQueryUI tab. Does anyone know if such a thing is
> possible? An example is below, which gives me a 500 error when loading
> the page.
>
> Thank
Hi there,
The problem has been solved. I 've decided to run the python script as
argument of qsub instead of run qsub from inside of the script itself. I
also use .wait() as suggest by colleagues above.
Final code goes here:
http://ompldr.org/vZDFiag
Thank you very much for helping.
--
View th
Ok, I have it :)
PyImport_Import , PyModule_GetDict, PyDict_GetItemString and
PyObject_CallObject
Need to take a second look at cython when I have a spare cycle or 2.
Thanks for the the tip :)
A+
Dids,
--
http://mail.python.org/mailman/listinfo/python-list
Dids, 14.03.2012 14:46:
> Apologies if this was asked before, I couldn't find anything.
>
> I have a class defined in a python file:
> for example:
>
> class demo:
> [ class definition goes here]
>
> I'm writing a C extension.
> In the first function, I take an instance of the "demo" class
On Wednesday, 14 March 2012 13:28:58 UTC, Cosmia Luna wrote:
> class Foo(object):
> def bar(self):
> return 'Something'
>
> func = Foo().bar
>
> if type(func) == : # This should be always true
> pass # do something here
>
> What should type at ?
>
> Thanks
> Cosmia
import insp
Hi,
Apologies if this was asked before, I couldn't find anything.
I have a class defined in a python file:
for example:
class demo:
[ class definition goes here]
I'm writing a C extension.
In the first function, I take an instance of the "demo" class and do
my magic. It's working, all is
In article <87399bgw18@benfinney.id.au>,
Ben Finney wrote:
> Right. I dislike proposals for run-time type inference in Python, since
> they are too magical.
>
> Especially since we're talking about user input (arguments from the
> command line to the program); that requires more explicit de
class Foo(object):
def bar(self):
return 'Something'
func = Foo().bar
if type(func) == : # This should be always true
pass # do something here
What should type at ?
Thanks
Cosmia
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano writes:
> On Wed, 14 Mar 2012 08:35:12 +1100, Ben Finney wrote:
> > That feels too magical to me. I don't see a need to special-case
> > that usage. There's not much burden in being explicit for the
> > argument type.
>
> And yet you are programming in Python instead of Java, Pasc
Am 13.03.2012 22:08, schrieb Roy Smith:
Using argparse, if I write:
parser.add_argument('--foo', default=100)
it seems like it should be able to intuit that the type of foo should
be int (i.e. type(default)) without my having to write:
parser.add_argument('--foo', type=int, default=1
On Wed, 14 Mar 2012 08:35:12 +1100, Ben Finney wrote:
> r...@panix.com (Roy Smith) writes:
>
>> Using argparse, if I write:
>>
>> parser.add_argument('--foo', default=100)
>>
>> it seems like it should be able to intuit that the type of foo should
>> be int (i.e. type(default))
> […]
>
> -0.
Hi Sir
I have installed the robot framework but have a problem understanding
the RIDE and how to execute Data driven Test Case
If you can take me through this on Skype it will be really great.
Thanks
Laloo Thadhani
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 14, 2:08 am, r...@panix.com (Roy Smith) wrote:
> Using argparse, if I write:
>
> parser.add_argument('--foo', default=100)
>
> it seems like it should be able to intuit that the type of foo should
> be int (i.e. type(default)) without my having to write:
>
> parser.add_argument('--fo
Hi,
At the moment I use ConfigParser
http://docs.python.org/library/configparser.html
for one of my applications.
Now I'm looking for a library, which behaves like config parser, but
with one minor difference.
The write() mehtod should keep existing comments.
Does anybody know or implement so
Oh wait, just realised it was loading the (x86) tools. Doing a quick
search I noticed that I didn't have the x64 components installed, so
loading up the MSVC08 setup again and installing it, then:
copying vcvarsamd64.bat to vcvarsall.bat and adding its directory
(C:\Program Files (x86)\Microsoft Vi
54 matches
Mail list logo