[issue17005] Add a topological sort algorithm

2020-08-26 Thread Paddy McCarthy
Paddy McCarthy added the comment: Please ignore my earlier Message-id <1598493715.04.0.06462575371.issue17...@roundup.psfhosted.org>. I missed a dependency in cutting down a larger example. Sorry. -- ___ Python tracker

[issue17005] Add a topological sort algorithm

2020-08-26 Thread Paddy McCarthy
Paddy McCarthy added the comment: I've been playing with Python 3.9.0rc1 and was looking at a particular graph to see when it released tasks for processing. I ran the following code: from functools import reduce from pprint import pprint as pp from collections import defaultdict from graphlib

[issue33235] Better help text for dict.setdefault

2018-04-06 Thread Paddy McCarthy
New submission from Paddy McCarthy <paddy3...@gmail.com>: Hi, I was answering some question and used dict.setdefault as part of the solution and posted the help() on it as part of my answer. The help was this: In [15]: help(mapper.setdefault) Help on built-in function setdefault: setd

[issue24914] Python: Not just OO style but this is not mentioned on python.org or in FAQ

2015-08-23 Thread Paddy McCarthy
Paddy McCarthy added the comment: OK, here's a suggested re-wording: Python is an interpreted, interactive, object-oriented programming language that also supports programming in procedural and functional styles. It incorporates modules, exceptions, dynamic typing, very high level dynamic

[issue24914] Python: Not just OO style but this is not mentioned on python.org or in FAQ

2015-08-22 Thread Paddy McCarthy
New submission from Paddy McCarthy: Just read http://www.ibmsystemsmag.com/ibmi/developer/general/different-world-python/?utm_campaign=ibm-enewsutm_medium=emailutm_source=ibmi-jul22-2015?utm_content=exclusive1-headline It states that they could have had an officially supported version

[issue10395] new os.path function to extract common prefix based on path components

2015-03-20 Thread Paddy McCarthy
Paddy McCarthy added the comment: Can we now: 1. Move os.path.commonprefix to str.commonprefix or string.commonprefix 2. Deprecate the use of os.path.commonprefix 3. Add os.path.commonpath 4. Update the documentation. This seems to have lingered for too long and yet people have been willing

[issue23695] idiom for clustering a data series into n-length groups

2015-03-18 Thread Paddy McCarthy
Paddy McCarthy added the comment: I like R. David Murray's suggestion, but I am also aware of how it works and so cannot judge how it would look to the intermediate Python programmer who knows iterators and zip, but is new to this grouper; (who I think should be the target audience

[issue23695] idiom for clustering a data series into n-length groups

2015-03-17 Thread Paddy McCarthy
Paddy McCarthy added the comment: Hmmm. It seems that the problem isn't to do with the fact that it works, or how to apply it; the problem is with *how* it works. Making it an idiom means that too many will use it without knowing why it works which could lead to later maintenance issues. I

[issue23695] idiom for clustering a data series into n-length groups

2015-03-17 Thread Paddy McCarthy
New submission from Paddy McCarthy: In the zip section of the documentation, e.g. https://docs.python.org/3/library/functions.html#zip There is mention of an idiom for clustering a data series into n-length groups that I seem to only come across when people are explaining how it works on blog

[issue16580] Add examples to int.to_bytres and int.from_bytes

2012-12-09 Thread Paddy McCarthy
Paddy McCarthy added the comment: On 06/12/2012 14:31, Ezio Melotti wrote: Ezio Melotti added the comment: I agree. The examples in the doc seem clear to me, whereas the ones you proposed are not as clear. Do you think there's something that they don't currently cover that should

[issue16580] Add examples to int.to_bytres and int.from_bytes

2012-12-09 Thread Paddy McCarthy
Paddy McCarthy added the comment: On 09/12/2012 10:55, Ezio Melotti wrote: Ezio Melotti added the comment: Usually we add plain Python equivalents when they are simple enough that the code equivalent is as understandable as the prose or more (see for example http://docs.python.org/3

[issue16580] Add examples to int.to_bytres and int.from_bytes

2012-11-29 Thread Paddy McCarthy
New submission from Paddy McCarthy: http://docs.python.org/3.3/library/stdtypes.html?highlight=to_bytes#int.to_bytes and http://docs.python.org/3.3/library/stdtypes.html?highlight=to_bytes#int.to_bytes would benefit from an example showing what they do based on simpler coding. I have

[issue3214] Suggest change to glossary explanation: Duck Typing

2008-07-01 Thread Paddy McCarthy
Paddy McCarthy [EMAIL PROTECTED] added the comment: Hi Georg, A bit of relevant background about me: I've been interested in Duck Typing _specifically_ for a couple of years when I started watching edits to it on Wikipedia. I researched the history of the use of the term and changed

[issue3214] Suggest change to glossary explanation: Duck Typing

2008-06-26 Thread Paddy McCarthy
New submission from Paddy McCarthy [EMAIL PROTECTED]: The official glossary entry here: http://docs.python.org/tut/node18.html#l2h-46 says: duck-typing Pythonic programming style that determines an object's type by inspection of its method or attribute signature rather than by explicit