Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91468 > unrolled thread
| Started by | Mike Driscoll <kyosohma@gmail.com> |
|---|---|
| First post | 2015-05-29 09:01 -0700 |
| Last post | 2015-06-01 23:30 -0400 |
| Articles | 20 on this page of 73 — 28 participants |
Back to article view | Back to comp.lang.python
What is considered an "advanced" topic in Python? Mike Driscoll <kyosohma@gmail.com> - 2015-05-29 09:01 -0700
Re: What is considered an "advanced" topic in Python? Joel Goldstick <joel.goldstick@gmail.com> - 2015-05-29 12:08 -0400
Re: What is considered an "advanced" topic in Python? Mike Driscoll <kyosohma@gmail.com> - 2015-05-29 09:55 -0700
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-30 02:09 +1000
Re: What is considered an "advanced" topic in Python? Mike Driscoll <kyosohma@gmail.com> - 2015-05-29 09:57 -0700
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-30 03:08 +1000
Re: What is considered an "advanced" topic in Python? random832@fastmail.us - 2015-05-31 23:18 -0400
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-06-01 13:43 +1000
Re: What is considered an "advanced" topic in Python? Laura Creighton <lac@openend.se> - 2015-06-01 09:58 +0200
Re: What is considered an "advanced" topic in Python? Marko Rauhamaa <marko@pacujo.net> - 2015-06-01 12:36 +0300
Zero [was Re: What is considered an "advanced" topic in Python?] Steven D'Aprano <steve@pearwood.info> - 2015-06-01 22:07 +1000
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Laura Creighton <lac@openend.se> - 2015-06-01 14:52 +0200
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-06-01 13:56 +0100
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Skip Montanaro <skip.montanaro@gmail.com> - 2015-06-01 08:14 -0500
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Dave Farrance <df@see.replyto.invalid> - 2015-06-01 15:39 +0100
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-01 18:35 +0100
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Terry Reedy <tjreedy@udel.edu> - 2015-06-01 17:32 -0400
Re: Zero [was Re: What is considered an "advanced" topic in Python?] Marko Rauhamaa <marko@pacujo.net> - 2015-06-01 16:18 +0300
Re: Zero [was Re: What is considered an "advanced" topic in Python?] random832@fastmail.us - 2015-06-01 09:32 -0400
Re: What is considered an "advanced" topic in Python? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-06-01 11:44 +0100
Re: What is considered an "advanced" topic in Python? Marko Rauhamaa <marko@pacujo.net> - 2015-06-01 13:54 +0300
Re: What is considered an "advanced" topic in Python? Rustom Mody <rustompmody@gmail.com> - 2015-06-01 22:33 -0700
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-06-01 19:45 +1000
Re: What is considered an "advanced" topic in Python? Laura Creighton <lac@openend.se> - 2015-06-01 12:28 +0200
Re: What is considered an "advanced" topic in Python? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-06-01 14:22 +0100
Re: What is considered an "advanced" topic in Python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-01 11:34 +0100
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-06-01 20:36 +1000
Re: What is considered an "advanced" topic in Python? Laura Creighton <lac@openend.se> - 2015-06-01 13:00 +0200
Re: What is considered an "advanced" topic in Python? Laura Creighton <lac@openend.se> - 2015-06-01 13:24 +0200
Re: What is considered an "advanced" topic in Python? Marko Rauhamaa <marko@pacujo.net> - 2015-06-01 14:57 +0300
Re: What is considered an "advanced" topic in Python? BartC <bc@freeuk.com> - 2015-06-01 13:27 +0100
Re: What is considered an "advanced" topic in Python? MRAB <python@mrabarnett.plus.com> - 2015-06-01 13:27 +0100
Re: What is considered an "advanced" topic in Python? Laura Creighton <lac@openend.se> - 2015-06-01 17:07 +0200
Re: What is considered an "advanced" topic in Python? alister <alister.nospam.ware@ntlworld.com> - 2015-06-01 15:26 +0000
Re: What is considered an "advanced" topic in Python? Laura Creighton <lac@openend.se> - 2015-06-01 17:51 +0200
Re: What is considered an "advanced" topic in Python? MRAB <python@mrabarnett.plus.com> - 2015-06-01 18:06 +0100
Re: What is considered an "advanced" topic in Python? Marko Rauhamaa <marko@pacujo.net> - 2015-06-01 20:14 +0300
Re: What is considered an "advanced" topic in Python? BartC <bc@freeuk.com> - 2015-06-01 16:42 +0100
Re: What is considered an "advanced" topic in Python? Grant Edwards <invalid@invalid.invalid> - 2015-06-01 17:02 +0000
Re: What is considered an "advanced" topic in Python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-01 18:45 +0100
Re: What is considered an "advanced" topic in Python? Grant Edwards <invalid@invalid.invalid> - 2015-06-01 18:23 +0000
Re: What is considered an "advanced" topic in Python? BartC <bc@freeuk.com> - 2015-06-01 13:24 +0100
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-06-01 23:52 +1000
Re: What is considered an "advanced" topic in Python? BartC <bc@freeuk.com> - 2015-06-01 16:17 +0100
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-06-02 02:10 +1000
Re: What is considered an "advanced" topic in Python? Rustom Mody <rustompmody@gmail.com> - 2015-06-01 21:46 -0700
Re: What is considered an "advanced" topic in Python? Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-29 11:39 -0500
Re: What is considered an "advanced" topic in Python? Mike Driscoll <kyosohma@gmail.com> - 2015-05-29 09:58 -0700
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-30 02:50 +1000
Re: What is considered an "advanced" topic in Python? Todd <toddrjen@gmail.com> - 2015-05-29 19:02 +0200
Re: What is considered an "advanced" topic in Python? sohcahtoa82@gmail.com - 2015-05-29 10:03 -0700
Re: What is considered an "advanced" topic in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-29 10:17 -0700
Re: What is considered an "advanced" topic in Python? sohcahtoa82@gmail.com - 2015-05-29 14:06 -0700
Re: What is considered an "advanced" topic in Python? Jason Swails <jason.swails@gmail.com> - 2015-05-29 17:28 -0400
Re: What is considered an "advanced" topic in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-29 14:39 -0700
Re: What is considered an "advanced" topic in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-29 14:44 -0700
Re: What is considered an "advanced" topic in Python? Marko Rauhamaa <marko@pacujo.net> - 2015-05-29 20:24 +0300
Re: What is considered an "advanced" topic in Python? Todd <toddrjen@gmail.com> - 2015-05-29 19:03 +0200
Re: What is considered an "advanced" topic in Python? Steven D'Aprano <steve@pearwood.info> - 2015-05-30 03:55 +1000
Re: What is considered an "advanced" topic in Python? Mike Driscoll <kyosohma@gmail.com> - 2015-05-29 13:38 -0700
Re: What is considered an "advanced" topic in Python? Sturla Molden <sturla.molden@gmail.com> - 2015-05-30 12:15 +0000
Re: What is considered an "advanced" topic in Python? jonathon <jonathon.blake@gmail.com> - 2015-05-30 19:32 +0000
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-31 08:24 +1000
Re: What is considered an "advanced" topic in Python? "C.D. Reimer" <chris@cdreimer.com> - 2015-05-30 18:28 -0700
Re: What is considered an "advanced" topic in Python? Rustom Mody <rustompmody@gmail.com> - 2015-05-30 20:30 -0700
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-31 14:25 +1000
Re: What is considered an "advanced" topic in Python? Rustom Mody <rustompmody@gmail.com> - 2015-05-30 21:46 -0700
Re: What is considered an "advanced" topic in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-31 14:58 +1000
Re: What is considered an "advanced" topic in Python? Rustom Mody <rustompmody@gmail.com> - 2015-05-30 22:18 -0700
Re: What is considered an "advanced" topic in Python? Gene Heskett <gheskett@wdtv.com> - 2015-06-01 09:49 -0400
Re: What is considered an "advanced" topic in Python? Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-01 15:30 +0000
Re: What is considered an "advanced" topic in Python? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-06-01 20:33 -0400
Re: What is considered an "advanced" topic in Python? Gene Heskett <gheskett@wdtv.com> - 2015-06-01 23:30 -0400
Page 1 of 4 [1] 2 3 4 Next page →
| From | Mike Driscoll <kyosohma@gmail.com> |
|---|---|
| Date | 2015-05-29 09:01 -0700 |
| Subject | What is considered an "advanced" topic in Python? |
| Message-ID | <c03de3a7-3429-44a3-8241-5a7d81b9aefc@googlegroups.com> |
Hi, I've been asked on several occasions to write about intermediate or advanced topics in Python and I was wondering what the community considers to be "intermediate" or "advanced". I realize we're all growing in our abilities with the language, so this is going to be very subjective, but I am still curious what my fellow Python developers think about this topic. Thanks, Mike
[toc] | [next] | [standalone]
| From | Joel Goldstick <joel.goldstick@gmail.com> |
|---|---|
| Date | 2015-05-29 12:08 -0400 |
| Message-ID | <mailman.191.1432915687.5151.python-list@python.org> |
| In reply to | #91468 |
Maybe itertools or generators On Fri, May 29, 2015 at 12:01 PM, Mike Driscoll <kyosohma@gmail.com> wrote: > Hi, > > I've been asked on several occasions to write about intermediate or advanced topics in Python and I was wondering what the community considers to be "intermediate" or "advanced". I realize we're all growing in our abilities with the language, so this is going to be very subjective, but I am still curious what my fellow Python developers think about this topic. > > Thanks, > Mike > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com
[toc] | [prev] | [next] | [standalone]
| From | Mike Driscoll <kyosohma@gmail.com> |
|---|---|
| Date | 2015-05-29 09:55 -0700 |
| Message-ID | <549f898c-3269-479c-9f96-6d2d97955c2e@googlegroups.com> |
| In reply to | #91469 |
On Friday, May 29, 2015 at 11:08:19 AM UTC-5, Joel Goldstick wrote: > Maybe itertools or generators > Yeah, I was thinking along those lines. I was also thinking about some of the cool stuff in the collections and contextlib modules. Mike
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-05-30 02:09 +1000 |
| Message-ID | <mailman.192.1432915802.5151.python-list@python.org> |
| In reply to | #91468 |
On Sat, May 30, 2015 at 2:01 AM, Mike Driscoll <kyosohma@gmail.com> wrote: > I've been asked on several occasions to write about intermediate or advanced topics in Python and I was wondering what the community considers to be "intermediate" or "advanced". I realize we're all growing in our abilities with the language, so this is going to be very subjective, but I am still curious what my fellow Python developers think about this topic. > Good fun! A few ideas: How to write decorators, particularly those that take parameters. The differences between the various number types (int, float, complex, Fraction, Decimal) and when you'd want each one. (CPython-specific) The dis.dis() function and what it can tell you about how Python operates These are all topics that have come up with my students; they're advanced enough to be outside the scope of the course itself (the course _uses_ decorators, but doesn't explain how to actually build them), but not beyond the grasp of someone who's mastered Python's fundamentals. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Mike Driscoll <kyosohma@gmail.com> |
|---|---|
| Date | 2015-05-29 09:57 -0700 |
| Message-ID | <28cec7df-0f51-4098-b027-72e913a9b656@googlegroups.com> |
| In reply to | #91470 |
> > Good fun! A few ideas: > > How to write decorators, particularly those that take parameters. Yes, this one always seems to trip people up. > > The differences between the various number types (int, float, complex, > Fraction, Decimal) and when you'd want each one. I hadn't considered this one > > (CPython-specific) The dis.dis() function and what it can tell you > about how Python operates I remember seeing on PyMOTW - http://pymotw.com/2/dis/ I agree that it's a module most programmers don't know about. > > These are all topics that have come up with my students; they're > advanced enough to be outside the scope of the course itself (the > course _uses_ decorators, but doesn't explain how to actually build > them), but not beyond the grasp of someone who's mastered Python's > fundamentals. > > ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-05-30 03:08 +1000 |
| Message-ID | <mailman.201.1432919309.5151.python-list@python.org> |
| In reply to | #91479 |
On Sat, May 30, 2015 at 2:57 AM, Mike Driscoll <kyosohma@gmail.com> wrote: >> >> Good fun! A few ideas: >> >> How to write decorators, particularly those that take parameters. > > Yes, this one always seems to trip people up. It's like a Sherlock Holmes pronouncement. When you see something like Flask's app.route(), or functools.wraps(), it's pure magic and completely incomprehensible. But break it down into little pieces (a function that takes a function and returns a function, then decorator syntax, then closures and the ability to call the original, and finally a decorator factory function, which is what a parameterized decorator is), and it becomes elementary. >> The differences between the various number types (int, float, complex, >> Fraction, Decimal) and when you'd want each one. > > I hadn't considered this one It's not often an actual *problem* - I've never seen anyone pick the wrong data type and mess up their code, not in Python - but it's a great way to explore some of the differences between real numbers and what computers work with. Also, I like talking about Fraction and Decimal for the simple reason that they're unobvious; you can poke around with Python and discover int and float, and if ever you need imaginary/complex numbers, you'll quickly come across complex, but you might use Python for years and not realize that decimal.Decimal even exists - nor when you'd want it. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | random832@fastmail.us |
|---|---|
| Date | 2015-05-31 23:18 -0400 |
| Message-ID | <mailman.259.1433129765.5151.python-list@python.org> |
| In reply to | #91479 |
On Fri, May 29, 2015, at 13:08, Chris Angelico wrote: > Also, I like talking about Fraction and > Decimal for the simple reason that they're unobvious; you can poke > around with Python and discover int and float, and if ever you need > imaginary/complex numbers, you'll quickly come across complex, but you > might use Python for years and not realize that decimal.Decimal even > exists - nor when you'd want it. Well, isn't that just a byproduct of what problem space you work in? If someone _does_ know they need a rational or decimal type (e.g. someone working with money who's clueful enough to know floats won't do), they'll find these types relatively quickly from a google search - there's no glut of third-party implementations, and neither is so obscure nor easily written from scratch that people wouldn't search for an existing implementation.
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-06-01 13:43 +1000 |
| Message-ID | <mailman.261.1433133429.5151.python-list@python.org> |
| In reply to | #91479 |
On Mon, Jun 1, 2015 at 1:18 PM, <random832@fastmail.us> wrote: > On Fri, May 29, 2015, at 13:08, Chris Angelico wrote: >> Also, I like talking about Fraction and >> Decimal for the simple reason that they're unobvious; you can poke >> around with Python and discover int and float, and if ever you need >> imaginary/complex numbers, you'll quickly come across complex, but you >> might use Python for years and not realize that decimal.Decimal even >> exists - nor when you'd want it. > > Well, isn't that just a byproduct of what problem space you work in? If > someone _does_ know they need a rational or decimal type (e.g. someone > working with money who's clueful enough to know floats won't do), > they'll find these types relatively quickly from a google search - > there's no glut of third-party implementations, and neither is so > obscure nor easily written from scratch that people wouldn't search for > an existing implementation. Yes, but how many people actually know they need a rational type? Just now there's a thread on python-ideas that was based around the expectation that a float could do that, which it can't; the OP just naturally assumed that float was the data type he should be using. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Laura Creighton <lac@openend.se> |
|---|---|
| Date | 2015-06-01 09:58 +0200 |
| Message-ID | <mailman.273.1433145516.5151.python-list@python.org> |
| In reply to | #91479 |
If you are giving a talk about Decimal -- and trying to stamp out the inappropriate use of floats you have to first inform people that what they learned as 'decimals' as children was not floating point, despite the fact that we write them the same way. If I ever get the time machine, I am going back in time and demand that floating point numbers be expressed as 12345:678 instead of 12345.678 because it would save so much trouble. Never has the adage 'It's not what you don't know, that bites you. It's what you know that ain't so.' been more apt. I have done much better in speaking about this topic to a bunch of incredulous people if you next explain that scientists really don't care about accuracy in their calculations. (This will surprise them). Most scentific calculations have some real world measurement in them, and for most real world measurements, if you are getting even 5 digits of precision, you are doing really, really, well. This means that scientists are going to be throwing away all the extra digits they get out a a floating point representation, so they don't have to care how accurate they are. As long as their results are good in the first 5, it won't matter. (Depending on time constraints, a review of significant figures -- what they are and what they mean is good here.) It is really hard to get the concept of Decimal across to people who already have that concept in their mind, but think it is called Float. You have to first teach them that they don't know anything about Float and get them to reboot their brains before you can install this new knowledge. Otherwise their brains will just overwrite your new knowledge with 'ah, just use a Float' as soon as you stop speaking. Same day, even. Laura
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2015-06-01 12:36 +0300 |
| Message-ID | <87d21fahyi.fsf@elektro.pacujo.net> |
| In reply to | #91631 |
Laura Creighton <lac@openend.se>: > It is really hard to get the concept of Decimal across to people who > already have that concept in their mind, but think it is called Float. I can't remember running into this frustration. However, I *constantly* run into engineers who don't understand what zero means. Marko
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve@pearwood.info> |
|---|---|
| Date | 2015-06-01 22:07 +1000 |
| Subject | Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <556c4b0e$0$13003$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #91639 |
On Mon, 1 Jun 2015 07:36 pm, Marko Rauhamaa wrote: > However, I constantly run into engineers who don't understand what > zero means. Okay, I'll bite. What does zero mean, and how do engineers misunderstand it? -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Laura Creighton <lac@openend.se> |
|---|---|
| Date | 2015-06-01 14:52 +0200 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <mailman.285.1433163148.5151.python-list@python.org> |
| In reply to | #91660 |
In a message of Mon, 01 Jun 2015 22:07:41 +1000, "Steven D'Aprano" writes: >On Mon, 1 Jun 2015 07:36 pm, Marko Rauhamaa wrote: > >> However, I constantly run into engineers who don't understand what >> zero means. > >Okay, I'll bite. > >What does zero mean, and how do engineers misunderstand it? > > > >-- >Steven I assume he meant 0 padding for fast fourier transforms, but I could be wrong about that, too. Laura
[toc] | [prev] | [next] | [standalone]
| From | Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> |
|---|---|
| Date | 2015-06-01 13:56 +0100 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <1jlomal1or023ian8rlaso1u5bnol52lag@4ax.com> |
| In reply to | #91660 |
Steven D'Aprano <steve@pearwood.info> wrote: >On Mon, 1 Jun 2015 07:36 pm, Marko Rauhamaa wrote: > >> However, I constantly run into engineers who don't understand what >> zero means. > >Okay, I'll bite. > >What does zero mean, and how do engineers misunderstand it? There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
[toc] | [prev] | [next] | [standalone]
| From | Skip Montanaro <skip.montanaro@gmail.com> |
|---|---|
| Date | 2015-06-01 08:14 -0500 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <mailman.286.1433164487.5151.python-list@python.org> |
| In reply to | #91666 |
[Multipart message — attachments visible in raw view] — view raw
On Mon, Jun 1, 2015 at 7:56 AM, Dave Farrance < DaveFarrance@omitthisyahooandthis.co.uk> wrote: > There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors. So it's 1 that engineers really don't understand? Just add 1 and you get the correct number of hard things. <wink> Skip P.S., Dave, your "omitthis" and "andthis" kind of sucks for the rest of us. And I just invalidated your attempts at obscurity by replying to your correct email address. I suggest you just omit that stuff going forward. Unfortunately, I now I have a crap address in my Gmail contacts I have to hunt down and remove. Maybe you should just install a decent spam filter <http://www.spambayes.org/> or switch to Gmail, which has a functioning spam filter (unlike Yahoo...)
[toc] | [prev] | [next] | [standalone]
| From | Dave Farrance <df@see.replyto.invalid> |
|---|---|
| Date | 2015-06-01 15:39 +0100 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <t0qomalg8ev0rt6350l30ovhnpkr79aak1@4ax.com> |
| In reply to | #91667 |
Skip Montanaro <skip.montanaro@gmail.com> wrote: >P.S., Dave, your "omitthis" and "andthis" kind of sucks for the rest of us. >And I just invalidated your attempts at >obscurity by replying to your correct email address. I suggest you just >omit that stuff going forward. Unfortunately, >I now I have a crap address in my Gmail contacts I have to hunt down and >remove. Maybe you should just install >a decent spam filter <http://www.spambayes.org/> or switch to Gmail, which >has a functioning spam filter (unlike Yahoo...) I've had that as my Usenet address since 2000 when Usenet was the prime spam harvesting source and the spammers were actively using anti-address-munging techniques. That's no longer so much of a problem, given Usenet's obscurity for today's average Internet user, but I'm still wary of posting email addresses directly to Usenet. I've changed the "from" address to end with ".invalid" which is the RFC way, and should be stopped at the Email client, if that helps. Since this is "comp.lang.python", I'm assuming that it should be treated primarily as a Usenet group in which you'd normally reply to the group -- rather than by personal email as you might do if this was primarily a Listserv group. I dunno what the group thinks about that. A quick header check tells me that the posters here are split about 50/50 between posting via Usenet or the list server.
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2015-06-01 18:35 +0100 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <mailman.8.1433180164.13271.python-list@python.org> |
| In reply to | #91666 |
On 01/06/2015 14:14, Skip Montanaro wrote: > > Maybe you should just install > a decent spam filter <http://www.spambayes.org/> or switch to Gmail, > which has a functioning spam filter (unlike Yahoo...) > Okay I'll bite, what's wrong with the Yahoo spam filter? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
[toc] | [prev] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2015-06-01 17:32 -0400 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <mailman.17.1433194398.13271.python-list@python.org> |
| In reply to | #91666 |
On 6/1/2015 9:14 AM, Skip Montanaro wrote: > remove. Maybe you should just install > a decent spam filter <http://www.spambayes.org/> or switch to Gmail, > which has a functioning spam filter (unlike Yahoo...) For me, Yahoo's spam filter is comparable to Gmail's. (My udel account is actually handled by gmail.) Either spam has decreased recently or both have gotten better at putting fewer things in the junk box for checking and tossing away more things. -- Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2015-06-01 16:18 +0300 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <87d21f8t46.fsf@elektro.pacujo.net> |
| In reply to | #91660 |
Steven D'Aprano <steve@pearwood.info>:
> What does zero mean, and how do engineers misunderstand it?
Off the top of my head:
* Code that does:
if elements:
for element in elements:
...
instead of:
for elements in elements:
...
* C++ insists that all objects have nonzero sizes. This program:
====================================================================
#include <stdio.h>
struct S {};
int main()
{
printf("%zd\n", sizeof(struct S));
return 0;
}
====================================================================
prints out 1 when compiled with c++ but 0 when compiled with cc.
* In C, it used to be illegal to define a struct without a dummy field
or a zero-length array. At one point, that created irritating trouble
for compilers that generated C.
* malloc(0) is allowed to return NULL as a successful return value
inviting application programming errors. Calling free(NULL) didn't
use to be guaranteed to work.
* Numerous shell commands assign special meaning to zero arguments.
For example:
$ ls a b c
a b c
$ ls a b
a b
$ ls a
a
$ ls
a b c d e f g
$ ln -s a b c
# creates two links under c, which must be a directory
$ ln -s c
# creates one link under .
* Wild-card expansion always produces at least one result:
for src in *.py; do
# executed even in the absence of a .py file
done
* Python insists that a block contain at least one statement even
though technically, it is not necessary for syntactic reasons. Not a
biggie but can cause a minor annoyance when commenting out a line.
* Numerous timer implementations take 0 to mean infinity. For example,
in Java:
public final void wait(long timeout)
throws InterruptedException
[...] If timeout is zero, however, then real time is not taken
into consideration and the thread simply waits until notified.
<URL: https://docs.oracle.com/javase/7/docs/api/java/lan
g/Object.html#wait%28long%29>
A nasty surprise for those who'd naively expect zero to mean zero,
especially if zero is the result of downward rounding.
Marko
[toc] | [prev] | [next] | [standalone]
| From | random832@fastmail.us |
|---|---|
| Date | 2015-06-01 09:32 -0400 |
| Subject | Re: Zero [was Re: What is considered an "advanced" topic in Python?] |
| Message-ID | <mailman.288.1433165522.5151.python-list@python.org> |
| In reply to | #91668 |
On Mon, Jun 1, 2015, at 09:18, Marko Rauhamaa wrote: > if elements: > for element in elements: > ... > > instead of: > > for elements in elements: TypeError: 'NoneType' object is not iterable
[toc] | [prev] | [next] | [standalone]
| From | Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> |
|---|---|
| Date | 2015-06-01 11:44 +0100 |
| Message-ID | <dkdoma1th5idudfbglrj5me4f3bjtur2ed@4ax.com> |
| In reply to | #91631 |
Laura Creighton <lac@openend.se> wrote:
>If you are giving a talk about Decimal -- and trying to stamp out the
>inappropriate use of floats you have to first inform people that
>what they learned as 'decimals' as children was not floating point,
>despite the fact that we write them the same way. ...
To be fair, prior to electronic computers, they were essentially
synonymous. It's a bit like finance experts chiding people for mixing
"cost" with "price".
>>> Decimal('0.3')
Decimal('0.3')
>>> Decimal(0.3)
Decimal('0.299999999999999988897769753748434595763683319091796875')
[toc] | [prev] | [next] | [standalone]
Page 1 of 4 [1] 2 3 4 Next page →
Back to top | Article view | comp.lang.python
csiph-web