Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Jussi Piitulainen
MRAB writes: > On 2016-08-18 10:46, Jussi Piitulainen wrote: >> Marko Rauhamaa writes: >> >>> Jussi Piitulainen wrote: >>> That looks a bit funny if the "keyword" does not look like a word, but then programming languages do look funny, so why not: (c ? t : e) #

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Chris Angelico
On Fri, Aug 19, 2016 at 3:00 AM, Terry Reedy wrote: > On 8/18/2016 5:32 AM, Steven D'Aprano wrote: > >>> Beginners often do not understand that the body of a lambda expression >>> is evaluated in a new local namespace, and only when the resulting >>> function is called, the same

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Terry Reedy
On 8/18/2016 5:32 AM, Steven D'Aprano wrote: Beginners often do not understand that the body of a lambda expression is evaluated in a new local namespace, and only when the resulting function is called, the same as with a def statement. They then neglect to capture current values when writing

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread MRAB
On 2016-08-18 10:46, Jussi Piitulainen wrote: Marko Rauhamaa writes: Jussi Piitulainen wrote: That looks a bit funny if the "keyword" does not look like a word, but then programming languages do look funny, so why not: (c ? t : e) # ?-expression (c -> t, e) # ->-expression That

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Marko Rauhamaa
Chris Angelico : > Folks, read the whole thread before posting :) Corollary: Folks, start a new thread before posting :) Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Chris Angelico
On Thu, Aug 18, 2016 at 7:32 PM, Steven D'Aprano wrote: > So I don't see any > benefit over this: > > for section_name, line_number in text.parser.toc: > drop.add_command(label=section_name, command=lambda >

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Peter Otten
Steven D'Aprano wrote: > On Thursday 18 August 2016 06:25, Terry Reedy wrote: > Sure. But since the behaviour of def functions and lambda functions are > identical, writing a named def won't solve that problem. > > >> for section_name, line_number in text.parser.toc: >>

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Jussi Piitulainen wrote: > >> That looks a bit funny if the "keyword" does not look like a word, >> but then programming languages do look funny, so why not: >> >>(c ? t : e) # ?-expression >> >>(c -> t, e) # ->-expression > > That ship has already sailed.

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Steven D'Aprano
On Thursday 18 August 2016 06:25, Terry Reedy wrote: > On 8/17/2016 2:07 AM, Steven D'Aprano wrote: > >> I realise that there are occasions where we might deliberate choose to >> assign an intermediate value to its own variable, but all else being equal, >> which would you prefer? >> >> #A >>

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Marko Rauhamaa
Jussi Piitulainen : > That looks a bit funny if the "keyword" does not look like a word, but > then programming languages do look funny, so why not: > >(c ? t : e) # ?-expression > >(c -> t, e) # ->-expression That ship has already sailed. Marko --

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Jussi Piitulainen
Lawrence D’Oliveiro writes: > On Thursday, August 18, 2016 at 7:22:50 PM UTC+12, Jussi Piitulainen wrote: >> But please consider calling them conditional expressions. > > And don’t forget switch-expressions, or case-expressions, as some > other advanced languages have had. Which my article showed

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Lawrence D’Oliveiro
On Thursday, August 18, 2016 at 7:22:50 PM UTC+12, Jussi Piitulainen wrote: > But please consider calling them conditional expressions. And don’t forget switch-expressions, or case-expressions, as some other advanced languages have had. Which my article showed how to do in Python. --

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Jussi Piitulainen
Terry Reedy writes: > On 8/17/2016 2:39 AM, Steven D'Aprano wrote: [- -] >> Because the C syntax is horrifically ugly, whereas the Python syntax >> is very close to real English syntax. >> >> "What will you do tonight?" >> >> "Go to the movies, if I finish work on time, otherwise just go home."

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Gregory Ewing
Terry Reedy wrote: One of the ironies (or puzzles) of Guido's choice is that he once condemned Perl's 'value if cond' as wretched. I don't think that's the same thing. Perl allows 'statement if cond' as an alternative way of writing "if (cond) statement'. Nobody has ever seriously considered

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Jussi Piitulainen
Ben Bacarisse writes: > Jussi Piitulainen writes: > >> BartC writes: >> >>> On 17/08/2016 07:39, Steven D'Aprano wrote: Rather than ask why Python uses `trueval if cond else falseval`, you should ask why C uses `cond ? trueval : falseval`. Is that documented anywhere? >>> >>> I'm

Re: I am new to python. I have a few questions coming from an armature!

2016-08-18 Thread Gregory Ewing
Terry Reedy wrote: What the *current* version removed from an earlier version is that there was a clear community consensus against the condition-in-the-middle syntax Guido proposed The way I remember it, condition-in-the-middle was first suggested by others, and Guido expressed dislike for

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Lawrence D’Oliveiro
On Thursday, August 18, 2016 at 12:55:33 PM UTC+12, Terry Reedy wrote: > > On 8/17/2016 7:13 PM, Lawrence D’Oliveiro wrote: > >> On Thursday, August 18, 2016 at 8:25:37 AM UTC+12, Terry Reedy wrote: >>> >>> for section_name, line_number in text.parser.toc: >>> def

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Larry Hudson via Python-list
On 08/17/2016 04:24 AM, Jussi Piitulainen wrote: ... http://www-formal.stanford.edu/jmc/recursive/node2.html (the paper famously titled "Part I" without any Part II, unless I mistake much.) Totally OT here, but... This reminds me of a old record I have with the (deliberately tongue-in-cheek)

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Terry Reedy
On 8/17/2016 7:13 PM, Lawrence D’Oliveiro wrote: On Thursday, August 18, 2016 at 8:25:37 AM UTC+12, Terry Reedy wrote: for section_name, line_number in text.parser.toc: def goto(line=line_number): text.yview(line)

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Chris Angelico
On Thu, Aug 18, 2016 at 9:13 AM, Dennis Lee Bieber wrote: > On Wed, 17 Aug 2016 18:52:22 +0100, MRAB > declaimed the following: > > >> >>If "p" points to a struct (record), then "*p" is that struct, and if >>that struct has a member (field) "m",

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Lawrence D’Oliveiro
On Thursday, August 18, 2016 at 8:25:37 AM UTC+12, Terry Reedy wrote: > > for section_name, line_number in text.parser.toc: > def goto(line=line_number): > text.yview(line) > drop.add_command(label=section_name, command=goto) You don’t think of

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Lawrence D’Oliveiro
On Thursday, August 18, 2016 at 6:28:06 AM UTC+12, Terry Reedy wrote: >> https://www.python.org/dev/peps/pep-0308/ > > What the *current* version removed from an earlier version is that there > was a clear community consensus against the condition-in-the-middle > syntax Guido proposed and for

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Lawrence D’Oliveiro
On Thursday, August 18, 2016 at 5:53:14 AM UTC+12, MRAB wrote: > C uses "->" for dereferencing a pointer to the member of a struct. The only reason why “s->f” was added was because “(*s).f” was considered an unwieldy thing to have to write all the time. And the only thing that made that

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Lawrence D’Oliveiro
On Thursday, August 18, 2016 at 6:28:06 AM UTC+12, Terry Reedy wrote: > >> Why couldn’t they have adopted the standard C >> syntax, as used in a whole bunch of other C-derivative languages? >> cond ? trueval : falseval > > That particular syntax was not really considered. At least 10

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Terry Reedy
On 8/17/2016 2:39 PM, Random832 wrote: On Wed, Aug 17, 2016, at 14:27, Terry Reedy wrote: That particular syntax was not really considered. At least 10 versions using 'if', 'then', 'else', and other tokens were. They all had the problem of requiring a new keyword such as 'then' or some other

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Terry Reedy
On 8/17/2016 2:43 PM, Marko Rauhamaa wrote: Terry Reedy : On 8/17/2016 2:39 AM, Steven D'Aprano wrote: "If I finish work on on time, go to the movies, otherwise just go home." is also real English syntax, and to me, more graceful. It is certainly more neutral among the

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Ben Bacarisse
Jussi Piitulainen writes: > BartC writes: > >> On 17/08/2016 07:39, Steven D'Aprano wrote: >>> Rather than ask why Python uses `trueval if cond else falseval`, you >>> should ask why C uses `cond ? trueval : falseval`. Is that documented >>> anywhere? >> >> I'm not

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Ben Bacarisse
MRAB writes: > On 2016-08-17 18:19, Jussi Piitulainen wrote: >> MRAB writes: >> >>> On 2016-08-17 12:24, Jussi Piitulainen wrote: BartC writes: > On 17/08/2016 07:39, Steven D'Aprano wrote: >> Rather than ask why Python uses `trueval if cond else

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Terry Reedy
On 8/17/2016 2:07 AM, Steven D'Aprano wrote: I realise that there are occasions where we might deliberate choose to assign an intermediate value to its own variable, but all else being equal, which would you prefer? #A alist = [] alist.append(2) alist.append(4) alist.append(8) process(alist)

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Marko Rauhamaa
MRAB : > On 2016-08-17 19:39, Random832 wrote: >> Why not just if(cond, trueval, falseval), a la Visual Basic? > > Well, it looks too much like a function call, which don't > short-circuit. Well, in Scheme, everything looks like a function call: (define (deflate

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread MRAB
On 2016-08-17 19:39, Random832 wrote: On Wed, Aug 17, 2016, at 14:27, Terry Reedy wrote: That particular syntax was not really considered. At least 10 versions using 'if', 'then', 'else', and other tokens were. They all had the problem of requiring a new keyword such as 'then' or some other

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread MRAB
On 2016-08-17 19:00, Grant Edwards wrote: On 2016-08-17, MRAB wrote: C uses "->" for dereferencing a pointer to the member of a struct. If "p" points to a struct (record), then "*p" is that struct, and if that struct has a member (field) "m", then that member can

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread MRAB
On 2016-08-17 18:58, Marko Rauhamaa wrote: MRAB : C uses "->" for dereferencing a pointer to the member of a struct. What "->" is for C, "." is Python and Java. Python doesn't have C's ".". C has both stacked-allocated and heap-allocated records. That's not the

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Marko Rauhamaa
Terry Reedy : > On 8/17/2016 2:39 AM, Steven D'Aprano wrote: > "If I finish work on on time, go to the movies, otherwise just go home." > is also real English syntax, and to me, more graceful. It is certainly > more neutral among the alternatives. The inverted version implies

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Random832
On Wed, Aug 17, 2016, at 14:27, Terry Reedy wrote: > That particular syntax was not really considered. At least 10 versions > using 'if', 'then', 'else', and other tokens were. > > They all had the problem of requiring a new keyword such as 'then' or > some other innovation. Why not just

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Terry Reedy
On 8/17/2016 2:39 AM, Steven D'Aprano wrote: On Wednesday 17 August 2016 06:59, Lawrence D’Oliveiro wrote: Here are some examples of that varying mileage. Quote: The Python syntax for conditional expressions

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Grant Edwards
On 2016-08-17, MRAB wrote: > C uses "->" for dereferencing a pointer to the member of a struct. > > If "p" points to a struct (record), then "*p" is that struct, and if > that struct has a member (field) "m", then that member can be accessed > by "(*p)->m" (the

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Marko Rauhamaa
MRAB : > C uses "->" for dereferencing a pointer to the member of a struct. What "->" is for C, "." is Python and Java. Python doesn't have C's ".". Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread MRAB
On 2016-08-17 18:19, Jussi Piitulainen wrote: MRAB writes: On 2016-08-17 12:24, Jussi Piitulainen wrote: BartC writes: On 17/08/2016 07:39, Steven D'Aprano wrote: Rather than ask why Python uses `trueval if cond else falseval`, you should ask why C uses `cond ? trueval : falseval`. Is that

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Jussi Piitulainen
MRAB writes: > On 2016-08-17 12:24, Jussi Piitulainen wrote: >> BartC writes: >> >>> On 17/08/2016 07:39, Steven D'Aprano wrote: Rather than ask why Python uses `trueval if cond else falseval`, you should ask why C uses `cond ? trueval : falseval`. Is that documented anywhere? >>>

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread MRAB
On 2016-08-17 12:24, Jussi Piitulainen wrote: BartC writes: On 17/08/2016 07:39, Steven D'Aprano wrote: Rather than ask why Python uses `trueval if cond else falseval`, you should ask why C uses `cond ? trueval : falseval`. Is that documented anywhere? I'm not fond of C's a ? b : c but the

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Marko Rauhamaa
Grant Edwards : > On 2016-08-17, Marko Rauhamaa wrote: > >> Somewhat analogously, I remember how confusing it was to learn formal >> logic in college. I was having a hard time getting the point of >> definitions like: >> >>(x ∧ y) is true iff x is

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Grant Edwards
On 2016-08-17, Marko Rauhamaa wrote: > Somewhat analogously, I remember how confusing it was to learn formal > logic in college. I was having a hard time getting the point of > definitions like: > >(x ∧ y) is true iff x is true and y is true > > That's because I had learned

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Marko Rauhamaa
"D'Arcy J.M. Cain" : > On Wed, 17 Aug 2016 16:39:30 +1000 > Steven D'Aprano wrote: >> cond ? trueval : falseval >> >> Because the C syntax is horrifically ugly, whereas the Python syntax >> is very close to real English syntax. > >

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread D'Arcy J.M. Cain
On Wed, 17 Aug 2016 16:39:30 +1000 Steven D'Aprano wrote: > cond ? trueval : falseval > > Because the C syntax is horrifically ugly, whereas the Python syntax > is very close to real English syntax. Or, put another way, Python prefers English over

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Sivan Greenberg
My first attempt at a large code base was with an Ubuntu project, the reason I learned Python was Ubuntu's sabdfl insisting on it be used throughout the OS (back in 2004 I was an Ubuntu developer contributing packages to main) . It was easy to get a job , but I started very early when there were

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Jussi Piitulainen
BartC writes: > On 17/08/2016 07:39, Steven D'Aprano wrote: >> Rather than ask why Python uses `trueval if cond else falseval`, you >> should ask why C uses `cond ? trueval : falseval`. Is that documented >> anywhere? > > I'm not fond of C's a ? b : c but the principle is sound. I generally [-

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread BartC
On 17/08/2016 07:39, Steven D'Aprano wrote: On Wednesday 17 August 2016 06:59, Lawrence D’Oliveiro wrote: [Quote] trueval if cond else falseval "Go to the movies, if I finish work on time, otherwise just go home." Is there /any/ programming language that uses a similar form?

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Christian Gollwitzer
Am 17.08.16 um 08:39 schrieb Steven D'Aprano: Quote: The Python syntax for conditional expressions (introduced in Python 2.5) is trueval if cond else falseval I think this is bloody awful. Why couldn’t they have adopted the standard C syntax, as used in a whole bunch of

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Steven D'Aprano
On Wednesday 17 August 2016 06:59, Lawrence D’Oliveiro wrote: > On Wednesday, August 17, 2016 at 6:46:22 AM UTC+12, alister wrote: >> I don't think I am missing anything by not bothering with them YMMV > > Here > > are

Re: I am new to python. I have a few questions coming from an armature!

2016-08-17 Thread Steven D'Aprano
On Wednesday 17 August 2016 04:46, alister wrote: > > squared_plus_one_list = map(lambda x: x**2 + 1, some_list) > > probably the cleanest example I have seen so far, & I still cant see the > point Hmmm. Well, let's have a look at some analogies with other kinds of values. Out of each pair of

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Lawrence D’Oliveiro
On Wednesday, August 17, 2016 at 6:46:22 AM UTC+12, alister wrote: > I don't think I am missing anything by not bothering with them YMMV Here are some examples of that varying mileage. --

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread alister
On Mon, 15 Aug 2016 11:35:07 -0700, sohcahtoa82 wrote: > On Monday, August 15, 2016 at 8:07:32 AM UTC-7, alister wrote: >> On Mon, 15 Aug 2016 07:00:47 -0700, Sickfit92 wrote: >> >> > 1. How long did it take you guys to master the language or, let me >> > put it this way to completely get the

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Paul Rudin
Lawrence D’Oliveiro writes: > On Tuesday, August 16, 2016 at 6:26:01 PM UTC+12, Paul Rudin wrote: >> sohcahtoa82 writes: >>> squared_plus_one_list = map(lambda x: x**2 + 1, some_list) >> >> I realise that this is about understanding lambda, but it's worth noting >> in

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Marko Rauhamaa
Chris Angelico : > most of the point of map() is to make use of an existing function: > > # Instead of > lengths = (len(x) for x in items) > # Use > lengths = map(len, items) Both methods are available and I have used each of them, but the former is probably always preferable.

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Chris Angelico
On Tue, Aug 16, 2016 at 5:18 PM, Ian Kelly wrote: > Also, unless the mapped function is already defined (and preferably > built-in), a generator expression or list comprehension is usually more > readable and avoids the significant overhead of repeatedly calling a Python >

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Jussi Piitulainen
Lawrence D’Oliveiro writes: > On Tuesday, August 16, 2016 at 6:53:24 PM UTC+12, Jussi Piitulainen wrote: >> Lawrence D’Oliveiro writes: >> >>> Why could this difference be important? >> >> Different comprehensions (pun!) and performance characteristics. > > A potential difference in memory

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Christian Gollwitzer
Am 15.08.16 um 16:00 schrieb Sickfit92: 1. How long did it take you guys to master the language or, let me put it this way to completely get the hang and start writing code? You never learn a language completely. I'm using Python for 3 years, getting started was a matter of one or two days.

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Lawrence D’Oliveiro
On Tuesday, August 16, 2016 at 7:19:01 PM UTC+12, Ian wrote: > On Aug 16, 2016 12:36 AM, "Lawrence D’Oliveiro" wrote: > > The difference being that the “map” function takes an iterable and returns > an iterator. > > In Python 3, yes. However, assigning the result to the name >

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Lawrence D’Oliveiro
On Tuesday, August 16, 2016 at 6:53:24 PM UTC+12, Jussi Piitulainen wrote: > Lawrence D’Oliveiro writes: > >> Why could this difference be important? > > Different comprehensions (pun!) and performance characteristics. A potential difference in memory usage. When could this be important?

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Lawrence D’Oliveiro
On Tuesday, August 16, 2016 at 7:22:42 PM UTC+12, Ian wrote: > On Aug 16, 2016 12:57 AM, "Lawrence D’Oliveiro" wrote: > > But perhaps this limitation wasn’t intentional, just an inherent > consequence of the fact that Python’s significant-whitespace rules only > apply to statements, not

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Marko Rauhamaa
Steven D'Aprano : > E.g. out of the following: > > [len(x)+1 for x in sequence] > > list(map(lambda x: len(x) + 1, sequence)) > > the first will probably be faster as well as easier to read and write. It's mostly about idioms. Comprehensions belong to

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Ian Kelly
On Aug 16, 2016 12:57 AM, "Lawrence D’Oliveiro" wrote: I see. I thought I saw a mention somewhere else that Python lambdas were designed to be less functional than full def-style functions. But perhaps this limitation wasn’t intentional, just an inherent consequence of

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Ian Kelly
On Aug 16, 2016 12:36 AM, "Lawrence D’Oliveiro" wrote: On Tuesday, August 16, 2016 at 6:26:01 PM UTC+12, Paul Rudin wrote: > sohcahtoa82 writes: >> squared_plus_one_list = map(lambda x: x**2 + 1, some_list) > > I realise that this is about understanding lambda, but it's

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Steven D'Aprano
On Tuesday 16 August 2016 16:28, Lawrence D’Oliveiro wrote: > On Tuesday, August 16, 2016 at 6:26:01 PM UTC+12, Paul Rudin wrote: >> sohcahtoa82 writes: >>> squared_plus_one_list = map(lambda x: x**2 + 1, some_list) >> >> I realise that this is about understanding lambda, but it's worth noting

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Jussi Piitulainen
Lawrence D’Oliveiro writes: > On Tuesday, August 16, 2016 at 6:26:01 PM UTC+12, Paul Rudin wrote: >> sohcahtoa82 writes: >>> squared_plus_one_list = map(lambda x: x**2 + 1, some_list) >> >> I realise that this is about understanding lambda, but it's worth noting >> in passing that we tend to

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Lawrence D’Oliveiro
On Tuesday, August 16, 2016 at 6:34:53 PM UTC+12, Ian wrote: > On Aug 15, 2016 6:57 PM, "Lawrence D’Oliveiro" wrote: > > Python, on the other hand, introduces the special word “lambda” for this > purpose, eschewing its usual “def”. > > Why? Something to do with GvR’s allergy to anonymous

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Ian Kelly
On Aug 15, 2016 6:57 PM, "Lawrence D’Oliveiro" wrote: Python, on the other hand, introduces the special word “lambda” for this purpose, eschewing its usual “def”. Why? Something to do with GvR’s allergy to anonymous functions... Actually, GvR is on record stating that

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Lawrence D’Oliveiro
On Tuesday, August 16, 2016 at 6:26:01 PM UTC+12, Paul Rudin wrote: > sohcahtoa82 writes: >> squared_plus_one_list = map(lambda x: x**2 + 1, some_list) > > I realise that this is about understanding lambda, but it's worth noting > in passing that we tend to write this sort of thing as: > >

Re: I am new to python. I have a few questions coming from an armature!

2016-08-16 Thread Paul Rudin
sohcahto...@gmail.com writes: > On Monday, August 15, 2016 at 8:07:32 AM UTC-7, alister wrote: >> On Mon, 15 Aug 2016 07:00:47 -0700, Sickfit92 wrote: >> >> > 1. How long did it take you guys to master the language or, let me put >> > it this way to completely get the hang and start writing

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Lawrence D’Oliveiro
On Tuesday, August 16, 2016 at 6:36:41 AM UTC+12, sohca...@gmail.com wrote: > What helped me understand Lambdas is figuring out that they're really just > a $1,000 term for a $5 concept. The excuse for the “$1,000 term” is that it came from Alonzo Church’s λ-calculus, which was an alternative

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread sohcahtoa82
On Monday, August 15, 2016 at 8:07:32 AM UTC-7, alister wrote: > On Mon, 15 Aug 2016 07:00:47 -0700, Sickfit92 wrote: > > > 1. How long did it take you guys to master the language or, let me put > > it this way to completely get the hang and start writing code? > > > Some concepts took more

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Paul Rubin
Sickfit92 writes: > 1. How long did it take you guys to master the language or, let me put > it this way to completely get the hang and start writing code? Just a day or two, but I was already experienced with several similar languages. It would take longer for a beginning

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Grant Edwards
On 2016-08-15, Sickfit92 wrote: > 1. How long did it take you guys to master the language or, let me >put it this way to completely get the hang and start writing code? A few hours. The core language is pretty simple. [I was already fluent in a number of other

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Jan Erik Moström
On 15 Aug 2016, at 16:00, Sickfit92 wrote: 1. How long did it take you guys to master the language or, let me put it this way to completely get the hang and start writing code? I'm probably not representative since I had used about 10-15 different language before looking at Python. To learn

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Chris Angelico
On Tue, Aug 16, 2016 at 12:00 AM, Sickfit92 wrote: > 1. How long did it take you guys to master the language or, let me put it > this way to completely get the hang and start writing code? Python wasn't my first language, so it was a lot easier for me to learn one more

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread alister
On Mon, 15 Aug 2016 07:00:47 -0700, Sickfit92 wrote: > 1. How long did it take you guys to master the language or, let me put > it this way to completely get the hang and start writing code? > > 2. What made you want to learn python? > > 3. Was it difficult to learn the language? > > 4. Have

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Uri Even-Chen
1. After one/two months I knew the language, but after a year really knew it well. 2. I love Python but at first I didn't understand indentation in Python and it was confusing. 3. No. Except indentation. 4. Yes, I got 2 jobs in Python. But I also had to know JavaScript and jQuery. Uri. *Uri

I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread Sickfit92
1. How long did it take you guys to master the language or, let me put it this way to completely get the hang and start writing code? 2. What made you want to learn python? 3. Was it difficult to learn the language? 4. Have you been able to get a job out of your new skill? Thank you guys!