Re: How to wow someone new to Python

2015-01-21 Thread Steve Hayes
On Sat, 17 Jan 2015 02:03:57 +1100, Chris Angelico ros...@gmail.com wrote: Scenario: You're introducing someone to Python for the first time. S/he may have some previous programming experience, or may be new to the whole idea of giving a computer instructions. You have a couple of minutes to show

Re: How to wow someone new to Python

2015-01-21 Thread Irmen de Jong
On 21-1-2015 18:59, Steve Hayes wrote: 3. When I started to look at it, I found that strings could be any length and were not limited to swomething arbitrary, like 256 characters. Even more fun is that Python's primitive integer type (longs for older Python versions) has no arbitrary

Re: How to wow someone new to Python

2015-01-21 Thread André Roberge
On Friday, 16 January 2015 11:04:20 UTC-4, Chris Angelico wrote: Scenario: You're introducing someone to Python for the first time. S/he may have some previous programming experience, or may be new to the whole idea of giving a computer instructions. You have a couple of minutes to show off

Re: How to wow someone new to Python

2015-01-21 Thread André Roberge
On Wednesday, 21 January 2015 15:06:33 UTC-4, Chris Angelico wrote: On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong wrote: On 21-1-2015 18:59, Steve Hayes wrote: 3. When I started to look at it, I found that strings could be any length and were not limited to swomething arbitrary,

Re: How to wow someone new to Python

2015-01-21 Thread Mario Figueiredo
Chris, Scenario: You're introducing someone to Python for the first time. S/he may have some previous programming experience, or may be new to the whole idea of giving a computer instructions. You have a couple of minutes to show off how awesome Python is. What do you do? Some ideas where

Re: How to wow someone new to Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong irmen.nos...@xs4all.nl wrote: On 21-1-2015 18:59, Steve Hayes wrote: 3. When I started to look at it, I found that strings could be any length and were not limited to swomething arbitrary, like 256 characters. Even more fun is that Python's

[issue23292] Enum doc suggestion

2015-01-21 Thread Mark Summerfield
Mark Summerfield added the comment: Georg said to assign this to Ethan Furman but I don't seem to have that facility. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Grant Edwards
On 2015-01-21, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. But does he answer the more important question and can we use it to kill PHP?. -- Grant Edwards

[issue23291] Documentation about Py_Finalize(): Freeing objects

2015-01-21 Thread Albert Zeyer
New submission from Albert Zeyer: The documentation about Py_Finalize() about freeing objects is not exactly clear. Esp., when I have called Py_INCREF somewhere, those objects will always have ob_refcnt 0 unless I call Py_DECREF somewhere, what about these objects? Will they be freed in

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Michiel Overtoom
Hi Steven, you wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. I've yet to watch the video, I'll do that later tonight, but I also remember what DHH said about Smalltalk in his FLOSS interview about Rails, with Randal Schwartz, in July

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Tim Chase
On 2015-01-22 03:34, Steven D'Aprano wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. Holy pacing, Batman. Watching it at 2x leaves me wondering how much of the stage was worn off during the presentation. And now it's all but dead. Why did

[issue23292] Enum doc suggestion

2015-01-21 Thread Mark Summerfield
New submission from Mark Summerfield: I think it would be worth documenting globals().update(MyEnumeration.__members__) in the Interesting Examples section of the enum docs. I suspect that most people will find that importing enums is annoying because they'll get import A

Re: python traceroute

2015-01-21 Thread William Ray Wing
On Jan 21, 2015, at 12:06 AM, Denis McMahon denismfmcma...@gmail.com wrote: On Tue, 20 Jan 2015 19:37:26 -0800, Chandrakant Tiwari wrote: in the program below i want it to make it work the same way as TRACERT command. As an observation, you're re-inventing a wheel that already works

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: To wait for the exit of the subprocess, we use RegisterWaitForSingleObject(). To cancel this wait, we can use UnregisterWait() which returns immediatly. Problem: UnregisterWait() doesn't tell us if the wait was cancelled or not, the cancellation is

Re: Trees

2015-01-21 Thread Rustom Mody
On Wednesday, January 21, 2015 at 6:06:06 PM UTC+5:30, Chris Angelico wrote: On Wed, Jan 21, 2015 at 11:09 PM, Rustom Mody wrote: I would like a set to be {1,2,3} or at worst ⦃1,2,3⦄ and a bag to be ⟅1,2,3⟆ Apart from the unicode niceness that Ive described here

[issue17620] Python interactive console doesn't use sys.stdin for input

2015-01-21 Thread Drekin
Drekin added the comment: Unfortunately, I have little or no experience with Python C code and I even don't have a C compiler installed so I cannot experiment. I'll just put my ideas how to solve this here. • Add sys.__readlinehook__ attribute, which can be set to a function taking a prompt

Re: Trees

2015-01-21 Thread Ian Kelly
On Wed, Jan 21, 2015 at 9:15 AM, Ian Kelly ian.g.ke...@gmail.com wrote: class MultiSet(MutableSet): In retrospect this probably shouldn't derive from MutableSet, since that carries the expectation that all elements are unique (much like how bool shouldn't be subclassed). For instance,

Re: Trees

2015-01-21 Thread Ian Kelly
On Wed, Jan 21, 2015 at 7:47 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: More irksome that for the second we've to preface with from collections import Counter And still more a PITA that a straightforward standard name like bag (or multiset) is called by such an

What killed Smalltalk could kill Python

2015-01-21 Thread Steven D'Aprano
In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. (No cheering, that sort of attitude is one of the things that killed Smalltalk.) Although Martin discusses Ruby, the lessons could also apply to Python. Video is available here:

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- priority: normal - high stage: - patch review versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22885 ___

[issue23292] Enum doc suggestion

2015-01-21 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- assignee: docs@python - ethan.furman nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23292 ___

Re: How to wow someone new to Python

2015-01-21 Thread Matthew Ruffalo
On 01/21/2015 02:06 PM, Chris Angelico wrote: On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong irmen.nos...@xs4all.nl wrote: On 21-1-2015 18:59, Steve Hayes wrote: 3. When I started to look at it, I found that strings could be any length and were not limited to swomething arbitrary, like 256

Re: How to wow someone new to Python

2015-01-21 Thread Alan Bawden
Chris Angelico ros...@gmail.com writes: ..., and I would guess a 64-bit Java would also raise the limit. Even in a 64-bit Java, the _type_ returned by String.length() is 'int', and is thus at most (2**31 - 1). This isn't a problem for strings, which never get that long in practice, but for

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: I think I've fixed the memory leaks (plural). There were also a host of other problems with the _UNPACK opcodes in ceval. Here are the things I remember fixing, although I think I did slightly more: - Not throwing an error when PyDict_New or PyDict_Update

Re: How to wow someone new to Python

2015-01-21 Thread Mario Figueiredo
In article w2dsif33j2k@scooby-doo.csail.mit.edu, alan@scooby- doo.csail.mit.edu says... Even in a 64-bit Java, the _type_ returned by String.length() is 'int', and is thus at most (2**31 - 1). This isn't a problem for strings, which never get that long in practice, but for some other Java

[issue23166] urllib2 ignores opener configuration under certain circumstances

2015-01-21 Thread Enrico Tröger
Enrico Tröger added the comment: I got the same error suddenly with Python 2.7.9. I think this is quite unfortunate because it somewhat breaks existing behaviour, especially that SSL certificate verification is enabled by default. Don't get me wrong, this is the right thing in general and it

Re: How to wow someone new to Python

2015-01-21 Thread Alan Bawden
Alan Bawden a...@scooby-doo.csail.mit.edu writes: ... Score one for untyped languages. Drat. I should have writted dynamically typed languages. The language has changed. When I was a novice Lisp hacker, we were comfortable saying that Lisp was untyped. But nowadays we always say that Lisp

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Python 3's exception chaining allows us to do the second (easier to catch without resorting to except Exception: or even except:) while still showing the original exception in the traceback. -- nosy: +gvanrossum

Re: How to wow someone new to Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 8:20 AM, Matthew Ruffalo mm...@case.edu wrote: Yes, length-unlimited strings are *extremely* useful in some applications. I remember bitterly cursing Java's string length limit of 2 ** 31 (maybe - 1) on multiple occasions. Python's strings seem to behave like integers

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Claudiu Popa
Claudiu Popa added the comment: Here's a patch which uses ast.literal_eval instead. This doesn't get code executed, since literal_eval will fail loudly for anything other than a literal. There are some issues to consider: - let the current ast.literal_eval call bubble out with a lot of

Re: How to wow someone new to Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 8:46 AM, Matthew Ruffalo mm...@case.edu wrote: No, Java's String.length returns an int and Strings are limited to ~2 ** 31 characters even in 64-bit Java. Huh, annoying. In Python, the length of a string (in characters) is stored in a Py_ssize_t (if I recall correctly),

[issue23294] A typo in the tutorial

2015-01-21 Thread aruseni
New submission from aruseni: https://docs.python.org/3/tutorial/controlflow.html In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. -- messages: 234449 nosy: aruseni priority: normal severity: normal status: open title: A typo in the

Re: How to wow someone new to Python

2015-01-21 Thread Paul Rubin
Alan Bawden a...@scooby-doo.csail.mit.edu writes: The language has changed. When I was a novice Lisp hacker, we were comfortable saying that Lisp was untyped. But nowadays we always say that Lisp is dynamically typed. I could write an essay about why... I'd be interested in seeing that.

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb8a093db8b1 by Victor Stinner in branch '3.4': Issue #23095, asyncio: Rewrite _WaitHandleFuture.cancel() https://hg.python.org/cpython/rev/fb8a093db8b1 -- nosy: +python-dev ___ Python tracker

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Mario Figueiredo
In article 873873ae91@jester.gateway.sonic.net, no.email@nospam.invalid says... Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby... http://www.youtube.com/watch?v=YX3iRjKj7C0

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset d3804307cce4 by Victor Stinner in branch '3.4': Issue #23095, asyncio: IocpProactor.close() must not cancel pending https://hg.python.org/cpython/rev/d3804307cce4 -- ___ Python tracker

[issue23293] [Windows] asyncio: race condition related to IocpProactor.connect_pipe()

2015-01-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: [Windows] asyncio: race condition related in IocpProactor.connect_pipe() - [Windows] asyncio: race condition related to IocpProactor.connect_pipe() ___ Python tracker

Re: How to wow someone new to Python

2015-01-21 Thread Irmen de Jong
On 21-1-2015 20:06, Chris Angelico wrote: On Thu, Jan 22, 2015 at 5:20 AM, Irmen de Jong irmen.nos...@xs4all.nl wrote: On 21-1-2015 18:59, Steve Hayes wrote: 3. When I started to look at it, I found that strings could be any length and were not limited to swomething arbitrary, like 256

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Paul Rubin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby... http://www.youtube.com/watch?v=YX3iRjKj7C0 That's an hour-long video; could someone who's watched it give a brief summary? Meanwhile,

Re: What killed Smalltalk could kill Python

2015-01-21 Thread John Ladasky
On Wednesday, January 21, 2015 at 11:18:54 AM UTC-8, Grant Edwards wrote: On 2015-01-21, Steven D'Aprano st...@pearwood.info wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. But does he answer the more important question and can we use it

Re: Trees

2015-01-21 Thread Paul Rubin
Rustom Mody rustompm...@gmail.com writes: Thats not bfs. That's inorder traversal Oops, you're right. How's this: bfs x = go [x] where go [] = [] go (L x:ts) = x:go ts go (B x lst rst:ts) = x : go (ts ++ [lst, rst]) *Main bfs t [6,2,8,1,4,7,9,3,5] --

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: It took me several months to understand this issue. For the beginning of the story, see: https://code.google.com/p/tulip/issues/detail?id=196 But I think that *this* issue can be closed: UnregisterWaitEx() really do what we need in asyncio. I don't like the

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 10:19 AM, Anthony Papillion anth...@cajuntechie.org wrote: To be fair, PHP has come a long way in the last few years and, I hear, there's movements within the community to make it better. Namespaces were a bit deal as were a few other things. Personally, while I am

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 10:37 AM, Tim Daneliuk tun...@tundraware.com wrote: I find these kinds of discussions sort of silly. Once there is a critical mass of installed base, no language EVER dies. Not sure about that. Back in the 1990s, I wrote most of my code in REXX, either command-line or

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Mario Figueiredo
In article mailman.17933.1421884677.18130.python-l...@python.org, ros...@gmail.com says... Bad idea. Better to pick a language that makes it easy to get things right, and then work on the fun side with third-party libraries, than to tempt people in with hey look how easy it is to do X and

[issue23293] [Windows] asyncio: race condition related in IocpProactor.connect_pipe()

2015-01-21 Thread STINNER Victor
New submission from STINNER Victor: Currently, IocpProactor.connect_pipe() is implemented with QueueUserWorkItem() which starts a thread that cannot be interrupted. Because of that, this function requires special cases in _register() and close() methods of IocpProactor. While fixing the

Re: Trees

2015-01-21 Thread Ian Kelly
On Tue, Jan 20, 2015 at 6:23 PM, Rustom Mody rustompm...@gmail.com wrote: The Haskell is bullseye¹ in capturing the essense of a tree because conceptually a tree of type t is recursive in the sense that it can contain 2 subtrees -- (B x lst rst) -- or its a base case -- L x. How do you create

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Grant Edwards
On 2015-01-21, Chris Angelico ros...@gmail.com wrote: On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-01-21, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Anthony Papillion
On 01/21/2015 04:35 PM, Chris Angelico wrote: On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-01-21, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby.

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Tim Daneliuk
On 01/21/2015 10:34 AM, Steven D'Aprano wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. (No cheering, that sort of attitude is one of the things that killed Smalltalk.) Although Martin discusses Ruby, the lessons could also apply to Python.

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: The _UNPACK opcodes are new in this changelist. Yup, but they're used in the other unpacking syntax too: (*(1, 2, 3), *(4, 5, 6)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 6:18 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-01-21, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. But does he answer the more important question

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: Congrats with the fix, and thanks for your perseverance! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23095 ___

Check for running DHCP daemon?

2015-01-21 Thread Jason Bailey
So I've got this python 3 script that needs to know if there is a running DHCP daemon (ISC DHCP server) on the local system. Is there a clean way to do this that (1) doesn't require me to do syscalls to local utilities (like ps, top, etc), and (2) doesn't require any custom modules (stock

Re: Check for running DHCP daemon?

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 10:06 AM, Jason Bailey jbai...@emerytelcom.com wrote: So I've got this python 3 script that needs to know if there is a running DHCP daemon (ISC DHCP server) on the local system. Is there a clean way to do this that (1) doesn't require me to do syscalls to local

[issue23295] [Windows] asyncio: add UDP support to ProactorEventLoop

2015-01-21 Thread STINNER Victor
New submission from STINNER Victor: ProactorEventLoop lacks UDP support: create_datagram_endpoint() is not supported. New functions should be added to the _overlapped modul. Example: add maybe WSARecvFrom()? -- components: Windows, asyncio messages: 234456 nosy: gvanrossum, haypo,

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Michael Torrie
On 01/21/2015 04:37 PM, Tim Daneliuk wrote: On 01/21/2015 10:34 AM, Steven D'Aprano wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. (No cheering, that sort of attitude is one of the things that killed Smalltalk.) Although Martin discusses

[issue22885] Arbitrary code execution vulnerability due to unchecked eval() call in dumbdbm module

2015-01-21 Thread Claudiu Popa
Claudiu Popa added the comment: Thanks for the tip, Guido. The new patch uses exception chaining. If this needs backporting, most probably the first patch can be used. -- Added file: http://bugs.python.org/file37813/issue22885_1.patch ___ Python

[issue23294] A typo in the tutorial

2015-01-21 Thread aruseni
Changes by aruseni aruseni.mag...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23294 ___

[issue23095] [Windows] asyncio: race condition when cancelling a _WaitHandleFuture

2015-01-21 Thread STINNER Victor
STINNER Victor added the comment: IocpProactor.close() must not cancel pending _WaitCancelFuture futures FYI I found this bug when running the trollius test suite. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23095

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 10:46 AM, Paul Rubin no.email@nospam.invalid wrote: Meanwhile, there's this: http://prog21.dadgum.com/203.html Retiring Python as a Teaching Language tl;dr: he's switched to recommending Javascript as a first language instead of Python, since JS makes it easier to

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Very nice! So what's left besides errors? * Fixing the grammar, ast, and compilation for the list, dict, and set comprehension element unpackings Now the primary problem is giving good errors; I don't know how to make them look like they came from the

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Marko Rauhamaa
Grant Edwards invalid@invalid.invalid: [At the time, a couple of us could stumble around with HTML enough to generate web pages that looked fresh out of 1995, but that was about it. The web pages in our older devices looked rather retro and had pretty limited functionality.] I miss that

Re: What killed Smalltalk could kill Python

2015-01-21 Thread sohcahtoa82
On Wednesday, January 21, 2015 at 4:10:08 PM UTC-8, Mario Figueiredo wrote: In article mailman.17933.1421884677.18130.python-l...@python.org, ros...@gmail.com says... Bad idea. Better to pick a language that makes it easy to get things right, and then work on the fun side with

[issue23297] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread R. David Murray
R. David Murray added the comment: bytes does support startswith: b'abc'.startswith(b'a') True -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23297 ___

Re: Python is DOOMED! Again!

2015-01-21 Thread Nicholas Cole
I don't think that Python is doomed. I *do* think that type-hinting is useful, and Python has borrowed a syntax that is similar to that used in other languages, so that it is a familiar one to many developers. It is a stretch to call it intuitive though, either to write or to read. Personally, I

[issue14910] argparse: disable abbreviation

2015-01-21 Thread Andy Zobro
Andy Zobro added the comment: This breaks custom actions. e.g.: class dict_action(argparse.Action): def __init__(self, *a, **k): argparse.Action.__init__(self, *a, **k) TypeError: __init__() got an unexpected keyword argument 'allow_abbrev' -- nosy: +xobes

Re: Python is DOOMED! Again!

2015-01-21 Thread Ethan Furman
On 01/21/2015 08:30 PM, Steven D'Aprano wrote: So what is this unspeakable, nightmarish, cryptic abomination going to look like? Here's an example from PEP 484: def greeting(name: str) - str: return 'Hello ' + name I don't know about you, but I think anyone who cannot read that

Re: Python is DOOMED! Again!

2015-01-21 Thread Mark Lawrence
On 22/01/2015 05:56, Chris Angelico wrote: On Thu, Jan 22, 2015 at 4:50 PM, Nicholas Cole nicholas.c...@gmail.com wrote: I would have preferred Python to mimic: Define function add taking price1, the price2, print_error equals true. Price1 is a float. Price2 is a float. The function returns a

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Mark Lawrence
On 22/01/2015 02:11, Rick Johnson wrote: On Wednesday, January 21, 2015 at 10:34:40 AM UTC-6, Steven D'Aprano wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. (No cheering, that sort of attitude is one of the things that killed Smalltalk.)

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Ethan Furman
On 01/21/2015 05:36 PM, Chris Angelico wrote: On Thu, Jan 22, 2015 at 11:09 AM, Mario Figueiredo mar...@gmail.com wrote: I want to become a programmer so I can make games is, on the vast majority of cases, the quote of someone who will never become a programmer. Why should teachers reward that

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Also maybe not in this changelist, but we should consider replacing STORE_MAP and BUILD_MAP with a single opcode BUILD_MAP(n) that produces a dict out of the top n items on the stack just like BUILD_LIST(n) does. What do you think? --

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Paul Rubin
Chris Angelico ros...@gmail.com writes: Either you pick up a super-restrictive hey look, you can build a game with just point and click system, which isn't teaching programming at all, or you end up getting bogged down in the massive details of what it takes to write code. Code Hero ran into

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Emil Oppeln-Bronikowski
On Thu, Jan 22, 2015 at 10:55:27AM +1100, Chris Angelico wrote: Where's REXX today? Still (somehow) alive in neo-Amiga platforms like AmigaOS4.x, MorphOS and AROS. I know that's as good as dead but there are still people writing AREXX glue code. -- vag·a·bond adjective \ˈva-gə-ˌbänd\ a : 

[issue17776] IDLE Internationalization

2015-01-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I answered my Q1 in msg187219: test.test_gettest is currently passing, with no skips, on 2.7 and 3.4 on Win 7. patch.diff: I would rather add the 4 lines of the proposed idle_i18n.py to an existing module, perhaps Bindings.py itself, since that is the first

Re: Trees

2015-01-21 Thread Rustom Mody
On Thursday, January 22, 2015 at 3:57:50 AM UTC+5:30, Paul Rubin wrote: Rustom Mody writes: Thats not bfs. That's inorder traversal Oops, you're right. How's this: bfs x = go [x] where go [] = [] go (L x:ts) = x:go ts go (B x lst rst:ts) = x : go (ts ++ [lst, rst]) *Main bfs

Re: Trees

2015-01-21 Thread Rustom Mody
On Thursday, January 22, 2015 at 4:25:03 AM UTC+5:30, Ian wrote: On Tue, Jan 20, 2015 at 6:23 PM, Rustom Mody wrote: The Haskell is bullseye¹ in capturing the essense of a tree because conceptually a tree of type t is recursive in the sense that it can contain 2 subtrees -- (B x lst rst) --

Re: Python is DOOMED! Again!

2015-01-21 Thread Paul Rubin
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: def median_grouped(data:Iterable[Real], interval:Real=1)-Real: ... Wow, that's really nice. I had heard something about Python type hints but hadn't seen them before. So how does Python's proposed type-hints compared to that used by

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm
New submission from dongwm: Sometimes I need to use argparse like this: parser = argparse.ArgumentParser(prog='PROG') group = parser.add_mutually_dependence_group() group.add_argument('--foo') group.add_argument('--bar') parser.parse_args(['--foo', 'f', '--bar', 'b']) Namespace(bar='b',

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Terry Reedy
On 1/21/2015 7:16 PM, Mario Figueiredo wrote: In article 873873ae91@jester.gateway.sonic.net, no.email@nospam.invalid says... Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby...

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm
Changes by dongwm ciici...@gmail.com: Added file: http://bugs.python.org/file37816/argparse_test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23298 ___

Re: Python is DOOMED! Again!

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 4:50 PM, Nicholas Cole nicholas.c...@gmail.com wrote: I would have preferred Python to mimic: Define function add taking price1, the price2, print_error equals true. Price1 is a float. Price2 is a float. The function returns a float. But now this is sounding a little

Re: Python is DOOMED! Again!

2015-01-21 Thread Paul Rubin
Paul Rubin no.email@nospam.invalid writes: -spec median_grouped(iterable(real())) - real(). Oops: -spec median_grouped(iterable(real()), real()) - real(). -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is DOOMED! Again!

2015-01-21 Thread Mark Lawrence
On 22/01/2015 05:35, Paul Rubin wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: def median_grouped(data:Iterable[Real], interval:Real=1)-Real: ... Wow, that's really nice. I had heard something about Python type hints but hadn't seen them before. Currently flying here

[issue14910] argparse: disable abbreviation

2015-01-21 Thread Andy Zobro
Andy Zobro added the comment: Ignore previous comment, I wish I could delete it. I simply provided the allow_abbrev to the wrong function and spent zero time investigating the error. -- ___ Python tracker rep...@bugs.python.org

Re: Python is DOOMED! Again!

2015-01-21 Thread Rick Johnson
On Wednesday, January 21, 2015 at 10:31:12 PM UTC-6, Steven D'Aprano wrote: Occasionally you find people spreading Fear, Uncertainty, Doubt about Python. Python is now over 20 years old and one of the most popular languages in the world no matter how you measure popularity: What's next, are

[issue23296] ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string

2015-01-21 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: - duplicate status: open - closed superseder: - ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string ___ Python tracker

Re: How to wow someone new to Python

2015-01-21 Thread Steven D'Aprano
Alan Bawden wrote: Alan Bawden a...@scooby-doo.csail.mit.edu writes: ... Score one for untyped languages. Drat. I should have writted dynamically typed languages. The language has changed. When I was a novice Lisp hacker, we were comfortable saying that Lisp was untyped. But nowadays

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm
Changes by dongwm ciici...@gmail.com: Added file: http://bugs.python.org/file37815/argparse_doc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23298 ___

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 11:09 AM, Mario Figueiredo mar...@gmail.com wrote: I want to become a programmer so I can make games is, on the vast majority of cases, the quote of someone who will never become a programmer. Why should teachers reward that kind of thought? How about I want to become a

[issue23294] A typo in the tutorial

2015-01-21 Thread Eric V. Smith
Eric V. Smith added the comment: What's the typo? I'm not seeing it. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23294 ___

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 12:38 PM, Paul Rubin no.email@nospam.invalid wrote: Mario Figueiredo mar...@gmail.com writes: I want to become a programmer so I can make games is, on the vast majority of cases, the quote of someone who will never become a programmer. Why should teachers reward that

Re: Check for running DHCP daemon?

2015-01-21 Thread Dan Stromberg
On Wed, Jan 21, 2015 at 3:06 PM, Jason Bailey jbai...@emerytelcom.com wrote: So I've got this python 3 script that needs to know if there is a running DHCP daemon (ISC DHCP server) on the local system. Is there a clean way to do this that (1) doesn't require me to do syscalls to local utilities

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Joshua Landau
Joshua Landau added the comment: According to the standard, int can be only 16 bits long so that only leaves 255/255. However, if the offset is on top of the dictionary count, this is easily enough to clear the limits for the maximum function size (worst case is a merge of 255 dicts with an

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Chris Angelico
On Thu, Jan 22, 2015 at 1:59 PM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: To my mind, what killed REXX is that most operating systems just don't support its key feature well: ADDRESS targets! When the only target turns ADDRESS into the equivalent of os.system() (or some

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: You're right. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2292 ___ ___ Python-bugs-list mailing list

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Steven D'Aprano
Mario Figueiredo wrote: In article mailman.17933.1421884677.18130.python-l...@python.org, ros...@gmail.com says... Bad idea. Better to pick a language that makes it easy to get things right, and then work on the fun side with third-party libraries, than to tempt people in with hey look how

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Paul Rubin
Mario Figueiredo mar...@gmail.com writes: I want to become a programmer so I can make games is, on the vast majority of cases, the quote of someone who will never become a programmer. Why should teachers reward that kind of thought? I don't see what the problem is. Kids are interested in

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: I am a huge fan of giving good errors. Looks good to me. Will we need to make sure that the call helper function we worked on produces additional BUILD_MAP_UNPACK opcodes every 256 dictionaries just in case? -- ___

[issue2292] Missing *-unpacking generalizations

2015-01-21 Thread Neil Girdhar
Neil Girdhar added the comment: Another option to consider is to just use a bit on the BUILD_MAP_UNPACK and then have a stack marking opcode at the function call (not sure what to call it, but say FUNCTION_CALL_MARK) The advantage would be you don't store or calculate relative stack

  1   2   >