Cameron Simpson writes:
>
> In xterm and I think several other X11 terminals, Shift-Insert
> pastes. I found that _way_ more convenient than middle click. The
> mouse is not your friend.
>
This information might prove as useful as your answer to my
original question. ;-)
Thanks for both!
--
A
On 28Mar2015 20:57, Steven D'Aprano
wrote:
On Sat, 28 Mar 2015 08:19 pm, Ian Kelly wrote:
I've never been a fan of the primary selection style anyway. Copying
text is conceptually an action. Selecting text is how one indicates
the target of an action; conceptually it is not an action itself an
On Sat, 28 Mar 2015 08:19 pm, Ian Kelly wrote:
> I've never been a fan of the primary selection style anyway. Copying
> text is conceptually an action. Selecting text is how one indicates
> the target of an action; conceptually it is not an action itself and
> shouldn't cause an action to be perfo
On Sat, 28 Mar 2015 06:50 pm, Marko Rauhamaa wrote:
> Larry Hudson :
>
>> Highlight the selection you want copied, move the mouse cursor to the
>> location you want it copied to and middle-click with the mouse. Works
>> between programs as well as within a single program. And it copies
>> directl
On Sat, Mar 28, 2015 at 1:50 AM, Marko Rauhamaa wrote:
> Larry Hudson :
>
>> Highlight the selection you want copied, move the mouse cursor to the
>> location you want it copied to and middle-click with the mouse. Works
>> between programs as well as within a single program. And it copies
>> direc
Larry Hudson :
> Highlight the selection you want copied, move the mouse cursor to the
> location you want it copied to and middle-click with the mouse. Works
> between programs as well as within a single program. And it copies
> directly without going through the clipboard.
Unfortunately, Linux
On Sat, Mar 28, 2015 at 6:32 PM, Steven D'Aprano
wrote:
>> | Methods defined here:
>
> This is the usual guff that help() prints when you pass it a class or type.
> Occasionally it is useful. Often it is not, especially the dunder methods.
>
> Unfortunately help's UI is rather primitive. It woul
By the way, you're not alone in recognising that Python 3 may be a little
harder to teach to beginners than Python 2. Raymond Hettinger, one of the
most respected Pythonistas around, has pointed out the same thing.
More below.
On Sat, 28 Mar 2015 12:48 am, Rustom Mody wrote:
> On Friday, March
On Saturday, March 28, 2015 at 5:57:08 AM UTC+5:30, Larry Hudson wrote:
> On 03/26/2015 06:56 PM, Chris Angelico wrote:
> > On Fri, Mar 27, 2015 at 12:41 PM, Rustom Mody wrote:
> [snip]
> >> After selecting the line above [inside python inside help(filter) ]for
> >> cut-pasting here, by mistake I p
On 03/26/2015 06:56 PM, Chris Angelico wrote:
On Fri, Mar 27, 2015 at 12:41 PM, Rustom Mody wrote:
[snip]
After selecting the line above [inside python inside help(filter) ]for
cut-pasting here, by mistake I pressed Ctrl-C rather than Ctrl-Shift-C
An exception was thrown and the terminal remai
On 27Mar2015 21:02, Manuel Graune wrote:
Cameron Simpson writes:
This passes the local variables inside test1() to "condition" as a
single parameter. Now, I grant that vars['i'] is a miracle of
tediousness. So consider this elaboration:
from collections import namedtuple
condition_test =
Manuel Graune wrote:
> Peter Otten <__pete...@web.de> writes:
>
>> Cameron Simpson wrote:
>>
>>> test1([0,1,2,3], [1,2,3,4], condition_test)
>>>
>>> This passes the local variables inside test1() to "condition" as a
>>> single parameter. Now, I grant that vars['i'] is a miracle of
>>> tediousn
Cameron Simpson writes:
> This passes the local variables inside test1() to "condition" as a
> single parameter. Now, I grant that vars['i'] is a miracle of
> tediousness. So consider this elaboration:
>
> from collections import namedtuple
>
> condition_test = lambda vars: vars.i + vars.j > 4
Peter Otten <__pete...@web.de> writes:
> Cameron Simpson wrote:
>
>> test1([0,1,2,3], [1,2,3,4], condition_test)
>>
>> This passes the local variables inside test1() to "condition" as a single
>> parameter. Now, I grant that vars['i'] is a miracle of tediousness. So
>> consider this elaboration
On 27/03/2015 13:48, Rustom Mody wrote:
On Friday, March 27, 2015 at 10:05:21 AM UTC+5:30, Steven D'Aprano wrote:
On Fri, 27 Mar 2015 01:21 pm, Rustom Mody wrote:
Anyway my point is that in python (after 2.2??) saying something is an
object is a bit of a tautology -- ie verbiage without inform
On Sat, Mar 28, 2015 at 12:48 AM, Rustom Mody wrote:
> Knows some C, not much else.
> Starts studying python.
> Good until a point.
> Then suddenly hit... map, filter, and the worst of all lambda.
> More he reads less he understands.
> Tries help... Gets the above.
>
> So which do you think helps
On Friday, March 27, 2015 at 10:05:21 AM UTC+5:30, Steven D'Aprano wrote:
> On Fri, 27 Mar 2015 01:21 pm, Rustom Mody wrote:
>
> > Anyway my point is that in python (after 2.2??) saying something is an
> > object is a bit of a tautology -- ie verbiage without information.
>
>
> Er, it's *always*
On 03/26/2015 09:41 PM, Rustom Mody wrote:
On Thursday, March 26, 2015 at 11:30:57 AM UTC+5:30, Chris Angelico wrote:
Python 3.5.0a0 (default:4709290253e3, Jan 20 2015, 21:48:07)
[GCC 4.7.2] on linux
class filter(object)
| filter(function or None, iterable) --> filter object
|
| Retur
On Fri, 27 Mar 2015 01:21 pm, Rustom Mody wrote:
> Anyway my point is that in python (after 2.2??) saying something is an
> object is a bit of a tautology -- ie verbiage without information.
Er, it's *always* been a tautology. Every value in Python is an object,
including classes, and that has b
On Friday, March 27, 2015 at 7:56:16 AM UTC+5:30, Ian wrote:
> On Thu, Mar 26, 2015 at 7:56 PM, Chris Angelico wrote:
> >> On a more specific note, its the 1st line:
> >>
> >> class filter(object)
> >>
> >> which knocks me off.
> >> If a more restricted type from the ABC was shown which exactly ca
On Friday, March 27, 2015 at 7:26:54 AM UTC+5:30, Chris Angelico wrote:
> On Fri, Mar 27, 2015 at 12:41 PM, Rustom Mody wrote:
> > On a more specific note, its the 1st line:
> >
> > class filter(object)
> >
> > which knocks me off.
> > If a more restricted type from the ABC was shown which exactly
On Thu, Mar 26, 2015 at 7:56 PM, Chris Angelico wrote:
>> On a more specific note, its the 1st line:
>>
>> class filter(object)
>>
>> which knocks me off.
>> If a more restricted type from the ABC was shown which exactly captures all
>> the iterator-specific stuff like __iter__, __next__ it would
On Fri, Mar 27, 2015 at 12:41 PM, Rustom Mody wrote:
> On Thursday, March 26, 2015 at 11:30:57 AM UTC+5:30, Chris Angelico wrote:
>> On Thu, Mar 26, 2015 at 3:02 PM, Rustom Mody wrote:
>> > [And BTW
>> > help(filter) in python2 is much better documention than in python3
>> > ]
>>
>> Python 2.7.3
On Thursday, March 26, 2015 at 11:30:57 AM UTC+5:30, Chris Angelico wrote:
> On Thu, Mar 26, 2015 at 3:02 PM, Rustom Mody wrote:
> > [And BTW
> > help(filter) in python2 is much better documention than in python3
> > ]
>
> Python 2.7.3 (default, Mar 13 2014, 11:03:55)
> [GCC 4.7.2] on linux2
>
>
On 26Mar2015 11:37, Peter Otten <__pete...@web.de> wrote:
You are right. [...]
By the way, in this case you don't need the list at all:
def vartuple(vars):
return namedtuple("locals", vars)._make(vars.values())
Hmm. Neat. I had not realised that was available.
You'd need "vars.keys()", no
On 2015-03-25, Ian Kelly wrote:
> On Wed, Mar 25, 2015 at 1:53 PM, Grant Edwards
> wrote:
>> On 2015-03-25, Ian Kelly wrote:
>>> On Wed, Mar 25, 2015 at 11:29 AM, Manuel Graune
>>> wrote:
>>>
I'm looking for a way to supply a condition to an if-statement inside a
function body when
Cameron Simpson wrote:
> On 26Mar2015 10:03, Peter Otten <__pete...@web.de> wrote:
>>Cameron Simpson wrote:
>>> vars = locals()
>>> varnames = list(vars.keys())
>>
>>That leaves varnames in undefined order. Consider
>>
>>varnames = sorted(vars)
>
> Actually, not necessary.
>
> I star
On 26Mar2015 10:03, Peter Otten <__pete...@web.de> wrote:
Cameron Simpson wrote:
vars = locals()
varnames = list(vars.keys())
That leaves varnames in undefined order. Consider
varnames = sorted(vars)
Actually, not necessary.
I started with sorted, but it is irrelevant, so I bac
Cameron Simpson wrote:
> On 26Mar2015 07:27, Manuel Graune wrote:
>>Gary Herron writes:
>>> On 03/25/2015 10:29 AM, Manuel Graune wrote:
def test1(a, b, condition="True"):
for i,j in zip(a,b):
c=i+j
if eval(condition):
print("Foo")
On 26Mar2015 07:27, Manuel Graune wrote:
Gary Herron writes:
On 03/25/2015 10:29 AM, Manuel Graune wrote:
def test1(a, b, condition="True"):
for i,j in zip(a,b):
c=i+j
if eval(condition):
print("Foo")
test1([0,1,2,3],[1,2,3,4],"i+j >4")
print("Bar")
test1([
Gary Herron writes:
> On 03/25/2015 10:29 AM, Manuel Graune wrote:
>>
>> def test1(a, b, condition="True"):
>> for i,j in zip(a,b):
>> c=i+j
>> if eval(condition):
>> print("Foo")
>>
>> test1([0,1,2,3],[1,2,3,4],"i+j >4")
>> print("Bar")
>> test1([0,1,2,3],[1,2,
On Thu, Mar 26, 2015 at 3:02 PM, Rustom Mody wrote:
> [And BTW
> help(filter) in python2 is much better documention than in python3
> ]
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
filter(...)
filter(function or None, sequence) -> list, tuple, or string
Return tho
On Thursday, March 26, 2015 at 12:44:03 AM UTC+5:30, Gary Herron wrote:
> On 03/25/2015 10:29 AM, Manuel Graune wrote:
> > Hi,
> >
> > I'm looking for a way to supply a condition to an if-statement inside a
> > function body when calling the function. I can sort of get what I want
> > with using ev
On Wed, Mar 25, 2015 at 1:53 PM, Grant Edwards wrote:
> On 2015-03-25, Ian Kelly wrote:
>> On Wed, Mar 25, 2015 at 11:29 AM, Manuel Graune
>> wrote:
>>
>>> I'm looking for a way to supply a condition to an if-statement inside a
>>> function body when calling the function. I can sort of get what
On 2015-03-25, Ian Kelly wrote:
> On Wed, Mar 25, 2015 at 11:29 AM, Manuel Graune
> wrote:
>
>> I'm looking for a way to supply a condition to an if-statement inside a
>> function body when calling the function. I can sort of get what I want
>> with using eval [...]
>
> Pass the condition as a f
On 03/25/2015 10:29 AM, Manuel Graune wrote:
Hi,
I'm looking for a way to supply a condition to an if-statement inside a
function body when calling the function. I can sort of get what I want
with using eval (see code below) but I would like to achieve this in a
safer way. If there is a solution
On 3/25/2015 1:29 PM, Manuel Graune wrote:
Hi,
I'm looking for a way to supply a condition to an if-statement inside a
function body when calling the function. I can sort of get what I want
with using eval (see code below) but I would like to achieve this in a
safer way. If there is a solution w
On Wed, Mar 25, 2015 at 2:22 PM, Ian Kelly wrote:
> On Wed, Mar 25, 2015 at 12:17 PM, Joel Goldstick
> wrote:
>> Oh, now I see. Do you know about this:
>> https://docs.python.org/2/library/ast.html#ast.literal_eval
>
> As the name suggests, that only evals literals. It won't work for
> complex e
On Wed, Mar 25, 2015 at 12:17 PM, Joel Goldstick
wrote:
> Oh, now I see. Do you know about this:
> https://docs.python.org/2/library/ast.html#ast.literal_eval
As the name suggests, that only evals literals. It won't work for
complex expressions like "i + j > 4"
--
https://mail.python.org/mailma
On Wed, Mar 25, 2015 at 1:51 PM, Manuel Graune wrote:
> Joel Goldstick writes:
>
>> On Wed, Mar 25, 2015 at 1:29 PM, Manuel Graune
>> wrote:
>>>
>>> def test1(a, b, condition="True"):
>>> for i,j in zip(a,b):
>>> c=i+j
>>> if eval(condition):
>>>print("Foo")
>>>
Joel Goldstick writes:
> On Wed, Mar 25, 2015 at 1:29 PM, Manuel Graune wrote:
>>
>> def test1(a, b, condition="True"):
>> for i,j in zip(a,b):
>> c=i+j
>> if eval(condition):
>>print("Foo")
>>
> I'm not sure I understand your question, but condition will evaluate
On Wed, Mar 25, 2015 at 11:29 AM, Manuel Graune wrote:
> Hi,
>
> I'm looking for a way to supply a condition to an if-statement inside a
> function body when calling the function. I can sort of get what I want
> with using eval (see code below) but I would like to achieve this in a
> safer way. If
On Wed, Mar 25, 2015 at 1:29 PM, Manuel Graune wrote:
> Hi,
>
> I'm looking for a way to supply a condition to an if-statement inside a
> function body when calling the function. I can sort of get what I want
> with using eval (see code below) but I would like to achieve this in a
> safer way. If
Hi,
I'm looking for a way to supply a condition to an if-statement inside a
function body when calling the function. I can sort of get what I want
with using eval (see code below) but I would like to achieve this in a
safer way. If there is a solution which is safer while being
less flexible, that
44 matches
Mail list logo