Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Arie van Wingerden
>and even then, familiar to who? High school algebra students will at >first be baffled by "x = x + 1", an equation which is clearly >unsatisfiable. Some languages are "better" in that specific case in my opinion (mind te double quotes :-) - Ada and Pascal use := instead of = which is simpler

[issue24097] Use after free in PyObject_GetState

2015-11-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset eed36e19f8b8 by Serhiy Storchaka in branch '3.4': Issue #24097: Fixed crash in object.__reduce__() if slot name is freed inside https://hg.python.org/cpython/rev/eed36e19f8b8 New changeset 99839a1c9c6d by Serhiy Storchaka in branch '3.5': Issue

[issue6953] readline documenation needs work

2015-11-25 Thread Hideaki Takahashi
Changes by Hideaki Takahashi : -- nosy: +hideaki_t ___ Python tracker ___ ___

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread BartC
On 25/11/2015 15:13, Ned Batchelder wrote: On Wednesday, November 25, 2015 at 8:20:59 AM UTC-5, BartC wrote: Accept that some things /are/ a source of confusion. When, in writing documentation, I find something hard to explain something, then I try and make it simpler in the program. But not

[issue20923] ConfigParser should nested [] in section names.

2015-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Victor, I reopened this a a doc issue to add the sentence that would have cut short the discussion. Please leave it. -- resolution: fixed -> status: closed -> open ___ Python tracker

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 07:13:41 -0800, Ned Batchelder writes: >That's because it's a programming language, and very very little about >programming languages is obvious. The best we can hope for is "familiar," >and even then, familiar to who? High school algebra students will at >first

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 2:13 AM, Ned Batchelder wrote: > I agree with you: there are things about Python that surprise people. > That's because it's a programming language, and very very little about > programming languages is obvious. The best we can hope for is

[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Brian Kearns
Brian Kearns added the comment: Bug fixes are to the test suite itself, and the name cleanup, minor. Best classified as enhancement, apply where applicable. -- ___ Python tracker

[issue6953] readline documentation needs work

2015-11-25 Thread Mark Lawrence
Changes by Mark Lawrence : -- title: readline documenation needs work -> readline documentation needs work ___ Python tracker ___

[issue20923] ConfigParser should nested [] in section names.

2015-11-25 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- assignee: docs@python -> terry.reedy ___ Python tracker ___

[issue24097] Use after free in PyObject_GetState

2015-11-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Re: What is a function parameter =[] for?

2015-11-25 Thread Marko Rauhamaa
Jussi Piitulainen : > Marko Rauhamaa writes: >> As far as the words "variable" and "binding" go, they are present in >> lambda calculus (1929 and on): > > So it's more than ten years earlier than I thought. Old enough, > anyway. Strictly speaking, that a Wikipedia

[issue20923] Explain ConfigParser 'valid section name' and .SECTCRE

2015-11-25 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: ConfigParser should nested [] in section names. -> Explain ConfigParser 'valid section name' and .SECTCRE ___ Python tracker

Re: Futex hang when running event loop on a separated thread

2015-11-25 Thread Zachary Ware
On Wed, Nov 25, 2015 at 8:10 AM, Marc Aymerich wrote: > problem solved ! > Just found out that threads should be started by fuse.init() in order > to run when fuse is backgrounded. Glad you found it; I would not have, not being a pyfuse user :) -- Zach --

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Grobu
Hi It seems that links on that Wikipedia page follow the structure : You could extract a list of link titles with something like : re.findall( r'\]+title="(.+?)"', html ) HTH, -Grobu- On 25/11/15 21:55, MRAB wrote: On 2015-11-25 20:42, ryguy7272 wrote: Hello experts. I'm looking at

Re: What is a function parameter =[] for?

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 2:05 PM, Antoon Pardon wrote: > Op 25-11-15 om 21:39 schreef Ian Kelly: >> On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon >> wrote: >>> I don't know what you are talking about. The first thing I have argued >>>

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 10:37 AM, ryguy7272 wrote: > Wow! Awesome! I bookmarked that link! > Thanks for everything!!! Also bookmark this link: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags And read it before you do any

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Random832
On 2015-11-25, Ben Finney wrote: > That is, the ‘2’ in ‘cartesian_point = (2, 3)’ means something different > than in ‘cartesian_point = (3, 2)’. > > Whereas the ‘2’ in ‘test_scores = [2, 3]’ means exactly the same as in > ‘test_scores = [3, 2]’. > > If each position

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread BartC
On 25/11/2015 22:16, Marko Rauhamaa wrote: BartC : I'm interested in language design because that's what I've done on and off for over 30 years. And I'm discussing some design decisions in Python. That *is* a fun ambition, useful or not. (At the moment, it's mostly fun.

[issue25638] Verify the etree_parse and etree_iterparse benchmarks are working appropriately

2015-11-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated to tip. -- Added file: http://bugs.python.org/file41167/etree_iterparse_2.patch ___ Python tracker ___

Re: What is a function parameter =[] for?

2015-11-25 Thread Steven D'Aprano
On Wed, 25 Nov 2015 08:56 pm, Antoon Pardon wrote: > Since (x, y, z) is not a fixed value, it is not a literal. Right. And therefore, (x, y, z) syntax is not syntax for a literal. Hence why the Python docs call it a tuple display instead of a tuple literal -- no matter what x, y, z are. Even if

[issue19687] Fixes for elementtree integer overflow

2015-11-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset e5eac1d692ad by Serhiy Storchaka in branch '3.4': Issue #19687: Fixed possible integer overflows in ElementTree. https://hg.python.org/cpython/rev/e5eac1d692ad New changeset 745fd5550bc0 by Serhiy Storchaka in branch '2.7': Issue #19687: Fixed

[issue19687] Fixes for elementtree integer overflow

2015-11-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Possible integer overflows in 3.5 was already fixed by issue23450. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7 ___ Python tracker

[issue25677] Syntax error caret confused by indentation

2015-11-25 Thread R. David Murray
R. David Murray added the comment: Two options on portability, I think: either use splitlines() on the decoded result, or add a 'universal_newlines' keyword argument to assert_python_failure and friends that would get passed to Popen. I'd favor the latter, as other users of script_helpers

[issue25730] invisible sidebar content with code snippets

2015-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Hiroaki, please include a bit of text explanation. What 'default.css' are you referring to? If it is a Sphinx file and not in the CPython repository /Doc, then this should be closed here and reopened on the separate Sphinx tracker. In any case, this is not

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Emile van Sebille
On 11/25/2015 4:25 AM, Antoon Pardon wrote: I think there are reasons to find the above behaviour bizarre. I personnaly don't find it bizarre, but that is because I'm familiar with what is going on. Which I suspect is necessary. >but if someone expects the compilor to take a snapshot of L

[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Brian Kearns
Brian Kearns added the comment: Updated again -- Added file: http://bugs.python.org/file41165/timedelta3.patch ___ Python tracker ___

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Grobu
On 26/11/15 00:06, Chris Angelico wrote: On Thu, Nov 26, 2015 at 9:48 AM, ryguy7272 wrote: Thanks!! Is that regex? Can you explain exactly what it is doing? Also, it seems to pick up a lot more than just the list I wanted, but that's ok, I can see why it does that.

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 10:44 AM, Grobu wrote: > On 26/11/15 00:06, Chris Angelico wrote: >> >> On Thu, Nov 26, 2015 at 9:48 AM, ryguy7272 wrote: >>> >>> Thanks!! Is that regex? Can you explain exactly what it is doing? >>> Also, it seems to

Re: What is a function parameter =[] for?

2015-11-25 Thread Steven D'Aprano
On Thu, 26 Nov 2015 05:27 am, Antoon Pardon wrote: > Op 25-11-15 om 18:40 schreef Steven D'Aprano: >> On Wed, 25 Nov 2015 08:56 pm, Antoon Pardon wrote: >> >>> Since (x, y, z) is not a fixed value, it is not a literal. >> >> Right. And therefore, (x, y, z) syntax is not syntax for a literal.

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Steven D'Aprano
On Thu, 26 Nov 2015 09:41 am, BartC wrote: > Maybe you're too familiar with it. But the idea of executing the > function and other definitions in a file, instead of they just being > there, is novel. It really, truly isn't. Your viewpoint is clouded by too much immersion in crippled languages.

Re: Help needed with compiling python

2015-11-25 Thread Zachary Ware
On Wed, Nov 25, 2015 at 3:52 PM, Cecil Westerhof wrote: > My system python was all-ready damaged: that is why I wanted to build > myself. Then you should try to repair the system Python install via the system package manager. It's not worth the hassle to try to replace it; it

Re: Help needed with compiling python

2015-11-25 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof writes: > >My system python was all-ready damaged: that is why I wanted to build >myself. Your Suse system probably wants to use python for something. If your system python is damaged, you badly need to fix that, using the system

[issue21224] BaseHTTPRequestHandler, update the protocol version to http 1.1 by default?

2015-11-25 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I read the issue very quickly. I don't understand why the default is not changed. -- ___ Python tracker ___

[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-11-25 Thread Steve Dower
Steve Dower added the comment: Man, dealing with the launcher is hard. But I've got it about as good as I can: * when installing 3.5.1 over 3.5.0, user has the option to update/not update the launcher (no option to uninstall at that time) * after installing 3.5.1, launcher can be added via

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 9:48 AM, ryguy7272 wrote: > Thanks!! Is that regex? Can you explain exactly what it is doing? > Also, it seems to pick up a lot more than just the list I wanted, but that's > ok, I can see why it does that. > > Can you just please explain what it's

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Grobu
On 25/11/15 23:48, ryguy7272 wrote: re.findall( r'\]+title="(.+?)"', html ) [ ... ] Thanks!! Is that regex? Can you explain exactly what it is doing? Also, it seems to pick up a lot more than just the list I wanted, but that's ok, I can see why it does that. Can you just please

[issue25696] "make -j9 install" fails because bininstall target requires the libainstall target

2015-11-25 Thread Martin Panter
Martin Panter added the comment: $(LIBPC) is a single directory name, so I suggest dropping the “for” loop. Patch 2 should avoid the practical race condition. But there is technically still a race with “libainstall” and “bininstall” both testing and creating the same directory. Maybe we

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Marko Rauhamaa
Grobu : > Sorry, I wasn't aware of regex being on the dark side :-) No, regular expressions are great for many purposes. Parsing context-free syntax isn't one of them. See: https://en.wikipedia.org/wiki/Chomsky_hierarchy#The_hierarchy> Most modern programming

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread ryguy7272
On Wednesday, November 25, 2015 at 5:30:14 PM UTC-5, Grobu wrote: > Hi > > It seems that links on that Wikipedia page follow the structure : > > > You could extract a list of link titles with something like : > re.findall( r'\]+title="(.+?)"', html ) > > HTH, > > -Grobu- > > > On

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread ryguy7272
On Wednesday, November 25, 2015 at 6:34:00 PM UTC-5, Grobu wrote: > On 25/11/15 23:48, ryguy7272 wrote: > >> re.findall( r'\]+title="(.+?)"', html ) > [ ... ] > > Thanks!! Is that regex? Can you explain exactly what it is doing? > > Also, it seems to pick up a lot more than just the list I

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 10:53 AM, Marko Rauhamaa wrote: > Regular expressions can handle any regular language just fine. They are > commonly used to define the lexical tokens of a language. Not sure about _defining_ them, but they're certainly often used to _recognize_ them, eg

[issue22100] Use $HOSTPYTHON when determining candidate interpreter for $PYTHON_FOR_BUILD.

2015-11-25 Thread Martin Panter
Martin Panter added the comment: What is $HOSTPYTHON? It does not appear to be used or mentioned anywhere. You mention it as if it is commonly known, but if you are proposing a new configuration variable, perhaps you should document it. The Gnu version of “which” seems to work fine with

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Steven D'Aprano
On Thu, 26 Nov 2015 01:34 am, BartC wrote: > On 25/11/2015 13:53, Marko Rauhamaa wrote: >> BartC : >> >>> Using tuples in the same way that other languages implement records is >>> going to be difficult if you can't change the values of the fields! >> >> Guido could decide

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Grobu
Chris, Marko, thank you both for your links and explanations! -- https://mail.python.org/mailman/listinfo/python-list

Re: What is a function parameter =[] for?

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden wrote: > (Note that nothing in the documentation I can find actually _guarantees_ > that a Python implementation will only have one unique empty tuple, but > I wouldn't be suprised if the following is nonetheless true in all >

[issue25622] Enable ctypes.test.test_values.Win_ValuesTestCase for non-Windows

2015-11-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6a8fbb97c8d8 by Martin Panter in branch 'default': Issue #25622: Rename to PythonValuesTestCase and enable for non-Windows https://hg.python.org/cpython/rev/6a8fbb97c8d8 -- nosy: +python-dev ___ Python

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread BartC
On 26/11/2015 00:31, Steven D'Aprano wrote: On Thu, 26 Nov 2015 09:41 am, BartC wrote: Maybe you're too familiar with it. But the idea of executing the function and other definitions in a file, instead of they just being there, is novel. It really, truly isn't. Your viewpoint is clouded by

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Steven D'Aprano
On Thu, 26 Nov 2015 12:20 am, BartC wrote: > On 25/11/2015 10:52, Steven D'Aprano wrote: >> On Wed, 25 Nov 2015 07:14 pm, Antoon Pardon wrote: > >>> What exactly is your point? >> >> That there is a simple analogy between the distinction between code >> inside/outside a for-loop, and code

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread TP
On Wed, Nov 25, 2015 at 12:42 PM, ryguy7272 wrote: > Hello experts. I'm looking at this url: > https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names Wildly offtopic but interesting, easy way to grab/analyze Wikipedia data using F# instead of Python

[issue25677] Syntax error caret confused by indentation

2015-11-25 Thread Martin Panter
Martin Panter added the comment: Another way to get universal newlines I have used in other cases is to use TextIOWrapper. It might be easier if you really need that multi-line RE search: text = TextIOWrapper(BytesIO(stderr), "ascii").read() -- nosy: +martin.panter

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 5:52 PM, Random832 wrote: > On 2015-11-25, Ben Finney wrote: >> That is, the ‘2’ in ‘cartesian_point = (2, 3)’ means something different >> than in ‘cartesian_point = (3, 2)’. >> >> Whereas the ‘2’ in ‘test_scores = [2,

[issue14044] IncompleteRead error with urllib2 or urllib.request -- fine with urllib, wget, or curl

2015-11-25 Thread Martin Panter
Martin Panter added the comment: Closing this as being a bug in the web server, rather than Python. If someone wants to add a way to force a HTTP 1.0 response, or a way to get all valid data before raising the exception, I suggest opening a new report. -- resolution: -> third party

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Ned Batchelder
On Wednesday, November 25, 2015 at 8:23:36 PM UTC-5, BartC wrote: > On 26/11/2015 00:31, Steven D'Aprano wrote: > > On Thu, 26 Nov 2015 09:41 am, BartC wrote: > > > >> Maybe you're too familiar with it. But the idea of executing the > >> function and other definitions in a file, instead of they

[issue21224] BaseHTTPRequestHandler, update the protocol version to http 1.1 by default?

2015-11-25 Thread Martin Panter
Martin Panter added the comment: Changing it could break existing code written for the HTTP 1.0 behaviour. The main effect mentioned at is that in HTTP 1.0 mode, a server may send a

Re: What is a function parameter =[] for?

2015-11-25 Thread Alan Bawden
Steven D'Aprano writes: > In fact, it's easy to find cases even now where the compiler is > insufficiently smart to recognise all the possible optimizations available. > There's no tuple simpler than the empty tuple, but Python 3.3 at least > fails to optimize that case: > >

Re: What is a function parameter =[] for?

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico wrote: > On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden wrote: >> (Note that nothing in the documentation I can find actually _guarantees_ >> that a Python implementation will only have one unique empty tuple,

Re: What is a function parameter =[] for?

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 1:46 PM, Ian Kelly wrote: > On Wed, Nov 25, 2015 at 7:25 PM, Chris Angelico wrote: >> On Thu, Nov 26, 2015 at 1:08 PM, Alan Bawden wrote: >>> (Note that nothing in the documentation I can find actually

[issue25677] Syntax error caret confused by indentation

2015-11-25 Thread Michael Layzell
Michael Layzell added the comment: Sorry for the delay, I finally got around to adding a test. I'm mildly concerned about the portability of the check, but it seems to work locally. If people have suggestions about how to make the check more portable, let me know! -- Added file:

[issue25735] math.factorial doc should mention integer return type

2015-11-25 Thread John Yeung
New submission from John Yeung: The math module docs state Except when explicitly noted otherwise, all return values are floats. But math.factorial isn't what I would call explicit about returning int: math.factorial(x) Return x factorial. Raises ValueError if x is not integral or is

Re: list slice and generators

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 10:44 AM, Ian Kelly wrote: > On Wed, Nov 25, 2015 at 3:07 AM, Peter Otten <__pete...@web.de> wrote: >>> elif name in METRICS_AVG: >> # writing a function that calculates the average without >> # materialising the list left as

[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Brian Kearns
Brian Kearns added the comment: Updated patch per review -- Added file: http://bugs.python.org/file41164/timedelta2.patch ___ Python tracker ___

Re: What is a function parameter =[] for?

2015-11-25 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Jussi Piitulainen writes: > >> You know, people have developed further ways to talk about these >> things precisely because substitution semantics is inadequate for >> what they wanted to talk about. > > "Assignment" is what everybody uses and understands. You can tell

Multiplication [was Re: Late-binding of function defaults]

2015-11-25 Thread Steven D'Aprano
On Thu, 26 Nov 2015 02:59 am, Laura Creighton wrote: > The great sticking point for the children I am teaching is > '*' means multiplication. You can really see that some people > have to make extensive mental modifications in order to handle > the concept that mathematical truths are expressed

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread BartC
On 25/11/2015 18:03, Ian Kelly wrote: On Wed, Nov 25, 2015 at 10:18 AM, BartC wrote: We have no way of evaluating their power or simplicity, since they are not available to us. I'll see if I can rustle up a comparison so that Python users can see what they're missing!

[issue20923] Explain ConfigParser 'valid section name' and .SECTCRE

2015-11-25 Thread R. David Murray
R. David Murray added the comment: Yes, the doc issue is separate from the other bug, since that one will apply only to 3.6, and the doc changes apply to all maintenance releases. -- ___ Python tracker

[issue25723] ConfigParser should never write broken configurations

2015-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Newline (\n) and possibly \x00, if it necessarily causes an actual problem, are the only characters that we might reject by default. Rejecting anything else is unwarrented editorializing about what people 'should' use. As you said, people who want something

[issue25723] ConfigParser should never write broken configurations

2015-11-25 Thread SpaceOne
SpaceOne added the comment: Isn't is an actual problem in the field? We had a vulnerability in our code due to this as we only sanitized the config values and didn't recognized that add_section() does no validation of input. -- ___ Python tracker

Re: What is a function parameter =[] for?

2015-11-25 Thread Antoon Pardon
Op 25-11-15 om 18:40 schreef Steven D'Aprano: > On Wed, 25 Nov 2015 08:56 pm, Antoon Pardon wrote: > >> Since (x, y, z) is not a fixed value, it is not a literal. > > Right. And therefore, (x, y, z) syntax is not syntax for a literal. Hence > why the Python docs call it a tuple display instead

[issue25729] update pure python datetime.timedelta creation

2015-11-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks you are missed Victor's and my comments. -- ___ Python tracker ___

[issue25730] invisible sidebar content with code snippets

2015-11-25 Thread hiroaki itoh
hiroaki itoh added the comment: Ah, sorry I'd mistaked. I don't know if this is Sphinx issue, but CPython repo has Doc/tools/static, Doc/tools/templates, so I still think, this can be fixed by customizing these, for example overriding style at layout.html. --

Re: list slice and generators

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 3:07 AM, Peter Otten <__pete...@web.de> wrote: > to get down to one intermediate list. Avoiding the last one is a bit tricky: > > metrics = (converter(x.metric(name)) for x in self._server_per_proc) > metrics = (x for x in metrics if x is not None) > try: > # if there

Re: list slice and generators

2015-11-25 Thread Peter Otten
Ian Kelly wrote: >>assert metrics > > metrics is always going to be an itertools.chain object at this > assert, so how could the assertion ever fail? Should an assertion ever fail? >From your reaction I conclude that it was puzzling and a comment like # always true in a boolean context

Re: Multiplication [was Re: Late-binding of function defaults]

2015-11-25 Thread Laura Creighton
In a message of Thu, 26 Nov 2015 05:09:13 +1100, "Steven D'Aprano" writes: >On Thu, 26 Nov 2015 02:59 am, Laura Creighton wrote: > >> The great sticking point for the children I am teaching is >> '*' means multiplication. You can really see that some people >> have to make extensive mental

Re: list slice and generators

2015-11-25 Thread Peter Otten
Ian Kelly wrote: > On Wed, Nov 25, 2015 at 10:44 AM, Ian Kelly wrote: >> On Wed, Nov 25, 2015 at 3:07 AM, Peter Otten <__pete...@web.de> wrote: elif name in METRICS_AVG: >>> # writing a function that calculates the average without >>> #

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Emile van Sebille
On 11/25/2015 5:20 AM, BartC wrote: it seems to be more lucrative to write thicker user manuals, and provide longer training courses, than to make software simpler. If that were true, certainly by now the sufficiently thick manual would provide crystal clear explanations. :)

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Ben Finney
Chris Angelico writes: > This is a distinction I generally make. Putting it another way: a list > has the same meaning regardless of how many items are on it (for > instance, a shopping list is still a shopping list whether it has five > or fifty items on it), where a tuple is

[issue25723] ConfigParser should never write broken configurations

2015-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Can you explain how passing \n createda vulnerability (to who, doing what) that flagging \n would prevent? Your opening example (nicely presented, by the way) shows that passing \n allows one to do with one call what would otherwise take (in the case of the

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Mark Lawrence
On 25/11/2015 17:18, BartC wrote: On 25/11/2015 15:13, Ned Batchelder wrote: On Wednesday, November 25, 2015 at 8:20:59 AM UTC-5, BartC wrote: Accept that some things /are/ a source of confusion. When, in writing documentation, I find something hard to explain something, then I try and make it

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Marko Rauhamaa
Ben Finney : > Perhaps it would be easier if you point out that ‘x’ doesn't mean > multiply either, and they've *already* been substituting that symbol > instead of the correct ‘×’ for multiply. In my childhood, we always used '·' for the multiplication sign until

[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-11-25 Thread Stefan Krah
Stefan Krah added the comment: > Py_ssize_t ob_array[1] Py_VARIABLE_SIZE; /* Looks weird and confusing */ Yes, I dislike that, too. The question is why gcc has supported the "struct hack" for more than 20 years but needs an annotation just for MPX. Is the annotation also needed for the C99

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread BartC
On 25/11/2015 20:50, Mark Lawrence wrote: On 25/11/2015 17:18, BartC wrote: Can you please let us know what you're taking, what it costs and where we can get it, as we would also like to live in cloud cuckoo land, provided that The Price Is Right™. And I would really like to know what your

Re: Help needed with compiling python

2015-11-25 Thread Cecil Westerhof
On Wednesday 25 Nov 2015 21:49 CET, Zachary Ware wrote: > On Wed, Nov 25, 2015 at 2:23 PM, Cecil Westerhof wrote: >> I wanted to install python myself. I started with 2.7.10. If that >> works I also will install 3.5.0. >> >> I did: >> ./configure --prefix=/usr >> make >> make

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread ryguy7272
On Wednesday, November 25, 2015 at 3:42:21 PM UTC-5, ryguy7272 wrote: > Hello experts. I'm looking at this url: > https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names > > I'm trying to figure out how to list all 'a title' elements. For instance, I > see the following: > Accident >

Re: What is a function parameter =[] for?

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 8:05 AM, Antoon Pardon wrote: > Op 25-11-15 om 21:39 schreef Ian Kelly: >> On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon >> wrote: >>> I don't know what you are talking about. The first thing I have argued >>>

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread Chris Angelico
On Thu, Nov 26, 2015 at 9:04 AM, ryguy7272 wrote: > Ok, I guess that makes sense. So, I just tried the script below, and got > nothing... > > import requests > from bs4 import BeautifulSoup > > r = >

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Marko Rauhamaa
BartC : > I'm interested in language design because that's what I've done on and > off for over 30 years. And I'm discussing some design decisions in > Python. That *is* a fun ambition, useful or not. However, while I'm very choosy and critical when it comes to my programming

[issue25730] invisible sidebar content with code snippets

2015-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Can you create either a specific patch or perhaps more important a test that fails now but should pass with a proper patch? -- stage: needs patch -> test needed ___ Python tracker

[issue25730] invisible sidebar content with code snippets

2015-11-25 Thread R. David Murray
R. David Murray added the comment: Since it is a visual issue and we have no infrastructure for that kind of web view testing, I don't think a test is possible. -- nosy: +r.david.murray ___ Python tracker

[issue25251] Unknown MS Compiler version 1900

2015-11-25 Thread Ateik Al-Zehla
Ateik Al-Zehla added the comment: forget to tell you that even i deleted the cache, but nothing happened. it use the old code. -- ___ Python tracker ___

Re: What is a function parameter =[] for?

2015-11-25 Thread Antoon Pardon
Op 25-11-15 om 21:39 schreef Ian Kelly: > On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon > wrote: >> I don't know what you are talking about. The first thing I have argued >> is that () is a literal. Then I have expaned that to that something >> like (3, 5, 8) is a

Re: Help needed with compiling python

2015-11-25 Thread Zachary Ware
On Wed, Nov 25, 2015 at 2:23 PM, Cecil Westerhof wrote: > I wanted to install python myself. I started with 2.7.10. If that > works I also will install 3.5.0. > > I did: > ./configure --prefix=/usr > make > make altinstall > > I have: > /usr/bin/python2.7 > > But

Re: Screen scraper to get all 'a title' elements

2015-11-25 Thread MRAB
On 2015-11-25 20:42, ryguy7272 wrote: Hello experts. I'm looking at this url: https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names I'm trying to figure out how to list all 'a title' elements. For instance, I see the following: Accident Ala-Lemu Alert Apocalypse Peaks So, I tried

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Ben Finney
Laura Creighton writes: > The great sticking point for the children I am teaching is '*' means > multiplication. […] that one can swap out a particular convention 'x > means multiply' and swap in another one '* means multiply' while > leaving the underlying truth unchanged.

Re: What is a function parameter =[] for?

2015-11-25 Thread Ian Kelly
On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon wrote: > I don't know what you are talking about. The first thing I have argued > is that () is a literal. Then I have expaned that to that something > like (3, 5, 8) is a literal. I never argued that tuple expressions

Re: list slice and generators

2015-11-25 Thread Pavlos Parissis
On 25/11/2015 11:07 πμ, Peter Otten wrote: > Pavlos Parissis wrote: > >> Hi, >> >> Do you see any possible dangerous hidden bug in the below code(using >> python2.7 and python3.4)? >> >> My goal is to avoid go through the metrics list twice. But, I don't >> know if there will be a problem with

[issue25723] ConfigParser should never write broken configurations

2015-11-25 Thread R. David Murray
R. David Murray added the comment: The issue would be if the section name came from user input. Then an attacker could craft a section name that would result in inserting arbitrary names and values into the config file. -- nosy: +r.david.murray

[issue21224] BaseHTTPRequestHandler, update the protocol version to http 1.1 by default?

2015-11-25 Thread Martin Panter
Martin Panter added the comment: Victor, that chunked support for server requests is optional, and not actually required (my quote was wrong; see my message after the one you quoted). The client already does HTTP 1.1 by default: >>> http.client.HTTPConnection._http_vsn_str 'HTTP/1.1' It is

Help needed with compiling python

2015-11-25 Thread Cecil Westerhof
I wanted to install python myself. I started with 2.7.10. If that works I also will install 3.5.0. I did: ./configure --prefix=/usr make make altinstall I have: /usr/bin/python2.7 But when I execute this, I get: Could not find platform dependent libraries Consider

[issue25251] Unknown MS Compiler version 1900

2015-11-25 Thread Ateik Al-Zehla
Ateik Al-Zehla added the comment: thanks Matt for your replay. But I copied the lines to cygwinccompiler.py and it didn't work. and it pretend as there is no change happened to the file. To see if the execution goes through the code I changed message if raise ValueError to "God Help Me %s "

  1   2   >