[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-09 Thread Paul G
ove* the "dateutil.tz" header, since it refers to the Python standard library. - On the subject of the dateutil.tz callout (thanks for that, by the way), it may be worth noting that while pytz only provides IANA zones, dateutil.tz also provides other zones, such as zones parsed from GNU

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Paul (p-ganssle), based on your recent experience implementing PEP 495, what are the main points that we should cover in What's New? Also, any comments/criticism on the recent changes to the datetime module documentation are welcome. --

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-08 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: See also #27595. -- assignee: belopolsky components: Documentation messages: 280320 nosy: belopolsky, p-ganssle, tim.peters priority: normal severity: normal stage: needs patch status: open title: Describe PEP 495 features in "What'

Re: New to python

2016-10-18 Thread Chris Warrick
On 17 October 2016 at 21:51, Bill Cunningham wrote: > I just installed python I might start with 3. But there is version 2 out > too. So far I can '3+4' and get the answer. Nice. I typed the linux man page > and got a little info. So to learn this language is there an

Re: New to python

2016-10-17 Thread justin walters
On Mon, Oct 17, 2016 at 12:51 PM, Bill Cunningham wrote: > I just installed python I might start with 3. But there is version 2 out > too. So far I can '3+4' and get the answer. Nice. I typed the linux man > page > and got a little info. So to learn this language is there

Re: New to python

2016-10-17 Thread breamoreboy
On Monday, October 17, 2016 at 8:51:52 PM UTC+1, Bill Cunningham wrote: > I just installed python I might start with 3. But there is version 2 out > too. So far I can '3+4' and get the answer. Nice. I typed the linux man page > and got a little info. So to learn this language is there an online

Re: New to python

2016-10-17 Thread Jan Erik Moström
On 17 Oct 2016, at 21:51, Bill Cunningham wrote: I just installed python I might start with 3. But there is version 2 out too. So far I can '3+4' and get the answer. Nice. I typed the linux man page and got a little info. So to learn this language is there an online tutorial? I am

Re: New to python

2016-10-17 Thread Skip Montanaro
> So to learn this language is there an online > tutorial? Yup, go to https://docs.python.org/3/ and check out the tutorial links. Also, if you want useful replies in the future, please provide a valid email address. A private reply to this particular question would have been better than bombing

New to python

2016-10-17 Thread Bill Cunningham
I just installed python I might start with 3. But there is version 2 out too. So far I can '3+4' and get the answer. Nice. I typed the linux man page and got a little info. So to learn this language is there an online tutorial? I am interested in the scripting too. Bill --

[issue28051] Typo and broken links in page "What's New In Python 3.5"

2016-09-09 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28051] Typo and broken links in page "What's New In Python 3.5"

2016-09-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8e74e76deda1 by Benjamin Peterson in branch '3.5': repair errors in (set|get)_task_factory note (#28051) https://hg.python.org/cpython/rev/8e74e76deda1 New changeset ace662dbfdb6 by Benjamin Peterson in branch 'default': merge 3.5 (#28051)

[issue28051] Typo and broken links in page "What's New In Python 3.5"

2016-09-09 Thread Lorenzo Pascucci
New submission from Lorenzo Pascucci: In the documentation page "What's New In Python 3.5" there is a small typo within the section "Improved Modules" related to `asyncio` [0], along with 3 broken links. Typo: The function `loop.set_task_factory()` appears linked twice,

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!

[issue27163] IDLE entry for What's New in Python 3.6

2016-06-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: Provisional addition a bit revised from above. I did not markup idlelib as a module because there is currently no section to link to. I don't know if or how IDLE can be linked to the IDLE doc. I linked to the name change issue that started the change

[issue27163] IDLE entry for What's New in Python 3.6

2016-06-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset a3cffed2c9ad by Terry Jan Reedy in branch 'default': Issue #27163: Add idlelib/IDLE entry to What's New in 3.6. https://hg.python.org/cpython/rev/a3cffed2c9ad -- nosy: +python-dev ___ Python tracker

[issue27163] IDLE entry for What's New in Python 3.6

2016-05-31 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- components: +Documentation, IDLE -ctypes ___ Python tracker ___

[issue27163] IDLE entry for What's New in Python 3.6

2016-05-31 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- dependencies: +Add idlelib.interface module, Idle: add ttk widgets as an option priority: low -> critical ___ Python tracker

[issue27163] IDLE entry for What's New in Python 3.6

2016-05-31 Thread Terry J. Reedy
rmal stage: needs patch status: open title: IDLE entry for What's New in Python 3.6 type: enhancement versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Joel Goldstick
On Sat, Mar 26, 2016 at 1:31 AM, Juan Dent wrote: > > I am trying to run ‘python cppdep.py’ but get the following: > > > > analyzing dependencies among all components ... > Traceback (most recent

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Gary Herron
On 03/25/2016 10:31 PM, Juan Dent wrote: I am trying to run ‘python cppdep.py’ but get the following: I would guess that this code was written some time ago for Python2, but that you have downloaded and run it with Python3. Try installing Python2 instead of Python3. Or try talking

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Ned Batchelder
On Saturday, March 26, 2016 at 5:59:30 AM UTC-4, Juan Dent wrote: > I am trying to run 'python cppdep.py' but get the following: > > > analyzing dependencies among all components ... > Traceback (most recent call

Re: PLEASE HELP -- TOTALLY NEW TO PYTHON

2016-03-26 Thread Steven D'Aprano
On Sat, 26 Mar 2016 04:31 pm, Juan Dent wrote: > > I am trying to run ‘python cppdep.py’ but get the following: > > > analyzing dependencies among all components ... > Traceback (most recent call last): > File

<    1   2   3   4   5   6   7   8   9   10   >