[issue25695] test___all__ and test_support alter execution environment

2015-11-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb72d6d7703c by Martin Panter in branch 'default': Issue #25695: Defer creation of TESTDIRN until the test case is run https://hg.python.org/cpython/rev/fb72d6d7703c -- nosy: +python-dev ___ Python

[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo ___ Python tracker ___ ___

[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-11-24 Thread Steve Dower
Steve Dower added the comment: Launcher detection still isn't quite right - another patch coming. -- ___ Python tracker ___

[issue25727] os.startfile implementation for other OS'es besides Windows

2015-11-24 Thread Elizabeth Myers
Elizabeth Myers added the comment: I'm not going to reopen that can of worms. Sorry to waste your time. -- ___ Python tracker ___

[issue25668] Deadlock in logging caused by a possible race condition with "format"

2015-11-24 Thread Vinay Sajip
Vinay Sajip added the comment: handle() and emit() are high level methods of a handler, and format() is at a lower level. Not all emit() methods will call format(). For example, socket-based and queue-based handlers don't. So it is not in general possible to separate format() out - you will

[issue25725] Memory leak on unpickling bogus data

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You patch is just the first version of my patch. :-) But tests are crashed with it. -- ___ Python tracker ___

[issue25728] email parser ignores inner multipart boundary when outer message duplicates it

2015-11-24 Thread R. David Murray
R. David Murray added the comment: Who is to say that the outer message is defective and not the inner one? How can a parser decide which part belongs to which message? It isn't an AI. The whole message is defective, so all bets are off :) The library can't successfully parse such a

[issue25728] email parser ignores inner multipart boundary when outer message duplicates it

2015-11-24 Thread Forest
Forest added the comment: RFC 2046 says that the outer message is defective, since it uses a boundary delimiter that is quite obviously present inside one of the encapsulated parts: https://tools.ietf.org/html/rfc2046#section-5.1 "The boundary delimiter MUST NOT appear inside any of the

[issue25728] email parser ignores inner multipart boundary when outer message duplicates it

2015-11-24 Thread Forest
Forest added the comment: > The library can't successfully parse such a message It could successfully parse such a message, if it matched against inner message boundaries before outer message boundaries. (One implementation would be to keep a list of all ancestor boundaries and traverse the

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

2015-11-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm wary of making such extensive changes throughout the codebase for an optional processor-specific feature of limited benefit and unproven worth. With each new macro and trick (Py_VARIABLE_SIZE and Py_INIT_BOUNDS), we make it harder for people to

[issue10796] Improve doc for readline.set_completer_delims()

2015-11-24 Thread Martin Panter
Martin Panter added the comment: I propose to address this with the general documentation bug, Issue 6953 -- dependencies: +readline documenation needs work nosy: +martin.panter title: readline completion flaw -> Improve doc for readline.set_completer_delims()

[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-24 Thread Zephor Wu
Zephor Wu added the comment: sorry, i forgot this: logging.basicConfig(format='%(name)s %(message)s') the error raised at the processing of the format while the name is 'utf-8' encoded and the message is an unicode -- ___ Python tracker

[issue6953] readline documenation needs work

2015-11-24 Thread Martin Panter
Martin Panter added the comment: This patch addresses the following points: 1: Moved add_history() into new “History file” section with related functions. 2: Documented that remove_ and replace_history_item() are zero-based. 3: Documented that get_history_item() is one-based. 4: Listed the

[issue6953] readline documenation needs work

2015-11-24 Thread Martin Panter
Changes by Martin Panter : -- stage: -> patch review versions: +Python 3.6 ___ Python tracker ___

[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-24 Thread Zephor Wu
Zephor Wu added the comment: here is the case, sorry again for just typing it before and not testing it myself :) # coding=utf-8 import logging logging.basicConfig(format='%(name)s %(message)s') logger = logging.getLogger(u'测试') logger.error(u'测试') btw, i'm using python2.7.10, mac osx

[issue25705] Fix regex_compile benchmark crash

2015-11-24 Thread Zachary Ware
Zachary Ware added the comment: Fixed in f7283190e896. I had actually already fixed this in my sandbox repo for speed.python.org; I just went ahead and pushed it (and a couple other very minor changes) to the main benchmark repo. Thanks for the report and patch! -- nosy: +zach.ware

[issue25719] Deprecate spitfire benchmark

2015-11-24 Thread Zachary Ware
Zachary Ware added the comment: +1 Unless anybody else objects in the next couple days, I'll commit this. -- nosy: +zach.ware stage: -> commit review versions: -Python 2.7 ___ Python tracker

[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16fec577fd8b by Martin Panter in branch '3.4': Issue #25576: Remove application/x-www-form-urlencoded charset advice https://hg.python.org/cpython/rev/16fec577fd8b New changeset 95ae5262d27c by Martin Panter in branch '3.5': Issue #25576: Merge

[issue25508] LogRecord attributes are not tuple, when logging only dict

2015-11-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset a365fb0dd5e1 by Vinay Sajip in branch '2.7': Issue #25508: Clarify documentation on LogRecord args attribute. https://hg.python.org/cpython/rev/a365fb0dd5e1 New changeset 01998efb605a by Vinay Sajip in branch '3.4': Issue #25508: Clarify

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

2015-11-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Discussion continues because my close message was, I now realize, incomplete and therefore unsatisfying. Ditto for the doc. So I complete my close message here and reopen issue to augment the doc. The discussion has so far has glossed over the key question:

[issue25726] sys.setprofile / sys.getprofile asymetry

2015-11-24 Thread Stefan Seefeld
New submission from Stefan Seefeld: I'm using the `cProfile` module to profile my code. I tried to temporarily disable the profiler by using: prof = sys.getprofile() sys.setprofile(None) ... sys.setprofile(prof) resulting in an error. The reason is that with `cProfile`,

[issue16198] IDLE - tabbing in a string always brings up file completion window

2015-11-24 Thread Tom F
Tom F added the comment: I've found this to be annoying as well especially in docstrings, hopefully this will help in the meantime. If you SHIFT + Tab it will at least resolve the problem of bringing up files and remains as the usual tab function. It makes me wonder if it is a bug at all

[issue25725] Memory leak on unpickling bogus data

2015-11-24 Thread STINNER Victor
STINNER Victor added the comment: I reviewed load_counted_tuple_leak.patch. Forget my patch, Serhiy's patch is better. -- ___ Python tracker ___

[issue25695] test___all__ and test_support alter execution environment

2015-11-24 Thread Martin Panter
Martin Panter added the comment: This should be fixed now. Thanks for the report Arfrever and the analysis Ghost. I still get these warnings, but they are discussed in Issue 18383: Warning -- warnings.filters was modified by test___all__ Warning -- warnings.filters was modified by

[issue25576] Remove “Content-Type: application/x-www-form-urlencoded; charset” advice

2015-11-24 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue25728] email parser ignores inner multipart boundary when outer message duplicates it

2015-11-24 Thread Forest
New submission from Forest: When a multipart message erroneously defines a boundary string that conflicts with an inner message's boundary string, the parser ignores the (correct) inner message's boundary, and treats all matching boundary lines as if they belong to the (defective) outer

[issue25728] email parser ignores inner multipart boundary when outer message duplicates it

2015-11-24 Thread Forest
Forest added the comment: I thought at first that this might be deliberate behavior in order to comply with RFC 2046 section 5.1.2. https://tools.ietf.org/html/rfc2046#section-5.1.2 After carefully re-reading that section, I see that it is just making sure an outer message's boundary will

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

2015-11-24 Thread Steven D'Aprano
On Wed, 25 Nov 2015 06:00 am, Random832 wrote: > On 2015-11-24, Chris Angelico wrote: >> Probably the grammar. In other words, it's part of the language's very >> definition. > > Then the definition is wrong. I think "literal" is a word whose meaning is > generally agreed on,

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

2015-11-24 Thread Steven D'Aprano
On Wed, 25 Nov 2015 08:25 am, Antoon Pardon wrote: > The point is that a > tuple can just be loaded as a constant without needing something extra. How would one load this tuple as a constant? (myfile.read(), "%.5f" % sin(x or y)) The point is that *in general*, tuple so-called "literals"

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

2015-11-24 Thread Steven D'Aprano
On Wed, 25 Nov 2015 01:18 am, Ned Batchelder wrote: > In English, "value" means something like, what is this equal to? > There isn't another good word to use in place of "value" here. There are many different meanings for the English noun "value" (Websters 1913 dictionary includes ten), but I

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

2015-11-24 Thread Laura Creighton
In a message of Wed, 25 Nov 2015 11:39:54 +1100, "Steven D'Aprano" writes: >I'm not sure what value [ha, see what I did there?!] there is in inventing >two new words for things that we already have standard terms for. Done correctly, you can get clarity. >"Referent" is just a funny way of saying

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

2015-11-24 Thread Chris Angelico
On Wed, Nov 25, 2015 at 11:36 AM, Steven D'Aprano wrote: > If, and only if, the tuple > contains nothing but immutable constants e.g. > > (1, 2.0, None, "spam") > > then a sufficiently smart compiler may be able to treat that specific tuple > as a constant/literal. But that's

ANN: released psutil 3.3.0 with OpenBSD support

2015-11-24 Thread Giampaolo Rodola'
Full story here: http://grodola.blogspot.com/2015/11/openbsd-support-for-psutil.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

A name refers to an object, an object has a value, equality compares values (was: What is a function parameter =[] for?)

2015-11-24 Thread Ben Finney
Laura Creighton writes: > If I had a time machine, I would go back to early days of Python and > ban the use of the term 'assignment' and 'value' both. I would insist > that the term 'binding' be used instead, though if you want to use the > verb refer, to be synonymous with

Reading files from .ar / .deb archives

2015-11-24 Thread Кисик Мурысик
Hello! I'm new to Python, so I decided to learn it and write simple apt alternative (apt is somewhat broken for me). But I can't decide - can I read just one file (/DEBIAN/control) from archive without unpacking it, or do I need to unpack? And what module I can use to handle .ar files? (I read

list slice and generators

2015-11-24 Thread Pavlos Parissis
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 doing in place replace of list elements using 2 generators. # metrics = ['', '0', '10']

Istalling python

2015-11-24 Thread ARONA KANAGARATHNA via Python-list
I tried to install this software python 3.4.3 to my pc which run windows Xp 32. i could installed but it doesnot run.it gives this message "python35-32/python.exe isnot a valid win32 app.Please help me to get solved this problem Thanks Aruna --

if else python

2015-11-24 Thread Scott Montreuil
Hi, I have an if statement which seems to run both commands and I cannot figure out why. (just learning so I may be missing something obvious) Any ideas? while True: global latit,longt,jlatit,jlongt,mlongt,mlatit response = urllib.urlopen(url) data =

Re: Istalling python

2015-11-24 Thread Chris Angelico
On Wed, Nov 25, 2015 at 3:22 PM, ARONA KANAGARATHNA via Python-list wrote: > I tried to install this software python 3.4.3 to my pc which run windows Xp > 32. i could installed but it doesnot run.it gives this message > "python35-32/python.exe isnot a valid win32

Re: A name refers to an object, an object has a value, equality compares values

2015-11-24 Thread Marko Rauhamaa
Ben Finney : > Indeed, in the past I used the term “value” as synonymous (in Python > context) with the term “object”. I have become convinced through this > discussion that I should no longer use the terms that way. > > [...] > > The concepts are distinct, so I

Re: Reading files from .ar / .deb archives

2015-11-24 Thread Ben Finney
Кисик Мурысик writes: > Hello! > I'm new to Python, so I decided to learn it Congratulations! Python is a fine language to learn, and this is the place to discuss general Python topics. You may also want to join the ‘tutor’ forum

[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-24 Thread Martin Panter
Martin Panter added the comment: This patch restores the previous behaviour of tolerating fstat() failures other than EBADF. Hans, if you are able to apply it to your compiled version of Python, it might prove that my fstat() theory is correct. -- keywords: +patch Added file:

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

2015-11-24 Thread Chris Angelico
On Wed, Nov 25, 2015 at 6:00 AM, Random832 wrote: > On 2015-11-24, Chris Angelico wrote: >> Probably the grammar. In other words, it's part of the language's very >> definition. > > Then the definition is wrong. I think "literal" is a word whose meaning

[issue25725] Memory leak on unpickling bogus data

2015-11-24 Thread STINNER Victor
STINNER Victor added the comment: Oh... I didn't notice that you wrote a patch :-) I started to write a similar patch: see attached pickle.patch. -- Added file: http://bugs.python.org/file41156/pickle.patch ___ Python tracker

[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-24 Thread Vinay Sajip
Vinay Sajip added the comment: I cannot reproduce, see below. Which exact version of Python are you using, and on what platform, and with what locale? $ more logtest9.py # coding=utf-8 import logging logger = logging.getLogger(u'测试') logger.error(u'测试') $ python2.7 logtest9.py No handlers

[issue25727] os.startfile implementation for other OS'es besides Windows

2015-11-24 Thread Elizabeth Myers
New submission from Elizabeth Myers: os.startfile can be implemented on other OS'es besides Windows relatively easily (although the operation parameter should probably be limited to Windows; it can be implemented elsewhere, but is probably not worth the trouble). On Unix-like operating

[issue25727] os.startfile implementation for other OS'es besides Windows

2015-11-24 Thread R. David Murray
R. David Murray added the comment: Duplicate of Issue 3177, which has quite a bit of discussion and some patch proposals. You might want to add yourself as nosy to that issue and see what you think of the proposals (I did not read through it to see what the status is...there hasn't been any

[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-24 Thread Hans Lawrenz
Hans Lawrenz added the comment: Emanuel, sorry, I missed the request for sys.version earlier. The tempfile.py I attached earlier is from the python 3.5 pulled from a ppa. I wouldn't be surprised if it has some patches applied by debian/ubuntu. To be clear though the problem also presents

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-24 Thread Martin Panter
Martin Panter added the comment: I agree it might be safer not to document that PyObject_SetAttr etc can delete (move that change to the tp_setattro etc method slot). I’ll also review the other functions you mentioned when I get a chance. -- ___

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

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 8:41 PM, Zachary Ware wrote: > On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote: >> still it appears to work only if the main thread is in the foreground >> (as of calling Thread() with deamon=True), I don't get why

Re: Bi-directional sub-process communication

2015-11-24 Thread Ian Kelly
On Mon, Nov 23, 2015 at 10:25 PM, Cameron Simpson wrote: > Then #3. I would have a common function/method for submitting a request to > go to the subprocess, and have that method return an Event on which to wait. > Then caller then just waits for the Event and collects the data.

Re: import logging raise NotImplementedError

2015-11-24 Thread Chris Angelico
On Wed, Nov 25, 2015 at 7:27 AM, wrote: > The problem happens with Python3 because "logging" is in the default > installation. In Python2 it is not installed. I installed it with >sudo python2 -m pip install logging -U > > This works without problems. Importing in Python2

[issue25725] Memory leak on unpickling bogus data

2015-11-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: New tests added in issue23914 exposed memory leak on unpickling TUPLE1..TUPLE3 opcodes with insufficient stack. Proposed patch fixes the leak. -- assignee: serhiy.storchaka components: Library (Lib) keywords: patch messages: 255289 nosy:

[issue25725] Memory leak on unpickling bogus data

2015-11-24 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

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

2015-11-24 Thread Antoon Pardon
Op 24-11-15 om 20:15 schreef Ian Kelly: >> But no matter what you want to call it. The dis module shows that >> -42 is treated in exactly the same way as 42, which is treated >> exactly the same way as () or as (5, 8, 13) which is treated >> differently from [] or [5, 8, 13]. > > This is an

import logging raise NotImplementedError

2015-11-24 Thread c.buhtz
I using 'logging' for some month. But today I have strange problem. When importing it it fails. Python 3.4.3 (default, Oct 14 2015, 20:33:09) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import logging Traceback (most recent call last): File

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

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 9:17 PM, Marc Aymerich wrote: > On Tue, Nov 24, 2015 at 8:41 PM, Zachary Ware > wrote: >> On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote: >>> still it appears to work only if the main thread

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

2015-11-24 Thread BartC
On 24/11/2015 20:54, Antoon Pardon wrote: Op 24-11-15 om 20:15 schreef Ian Kelly: But no matter what you want to call it. The dis module shows that -42 is treated in exactly the same way as 42, which is treated exactly the same way as () or as (5, 8, 13) which is treated differently from [] or

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

2015-11-24 Thread Antoon Pardon
Op 24-11-15 om 22:14 schreef BartC: > On 24/11/2015 20:54, Antoon Pardon wrote: >> Op 24-11-15 om 20:15 schreef Ian Kelly: >> But no matter what you want to call it. The dis module shows that -42 is treated in exactly the same way as 42, which is treated exactly the same way as ()

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

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 1:54 PM, Antoon Pardon wrote: > Op 24-11-15 om 20:15 schreef Ian Kelly: > >>> But no matter what you want to call it. The dis module shows that >>> -42 is treated in exactly the same way as 42, which is treated >>> exactly the same way as ()

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

2015-11-24 Thread Zachary Ware
On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote: > still it appears to work only if the main thread is in the foreground > (as of calling Thread() with deamon=True), I don't get why it behaves > differently :( maybe it is waiting for other stuff, but no idea how to >

[issue25725] Memory leak on unpickling bogus data

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ ./python -m test.regrtest -R 3:3 -m test_bad_stack test_pickle [1/1] test_pickle beginning 6 repetitions 123456 .. test_pickle leaked [20, 20, 20] references, sum=60 test_pickle leaked [12, 14, 14] memory blocks, sum=40 1 test failed: test_pickle

Re: Bi-directional sub-process communication

2015-11-24 Thread Cameron Simpson
On 24Nov2015 06:33, israel wrote: On 11/23/2015 20:29, Cameron Simpson wrote: On 24Nov2015 16:25, Cameron Simpson wrote: Completely untested example code: class ReturnEvent: def __init__(self): self.event = Event() With, of course: def

[issue25723] ConfigParser should never write broken configurations

2015-11-24 Thread STINNER Victor
STINNER Victor added the comment: Terry: "Since anything else without ']' is valid (...)" A Python script can be used to generate a configuration read by another application. This application can more more strict on the configuration format than Python, so I would prefer to deny '\n', '[' and

ANN: released psutil 3.3.0 with OpenBSD support

2015-11-24 Thread Giampaolo Rodola'
Full story here: http://grodola.blogspot.com/2015/11/openbsd-support-for-psutil.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

fades v4

2015-11-24 Thread Facundo Batista
Hello all, We're glad to announce the release of fades 4. fades is a system that automatically handles the virtualenvs in the cases normally found when writing scripts and simple programs, and even helps to administer big projects. It will automagically create a new virtualenv (or reuse a

readline and TAB-completion?

2015-11-24 Thread Ulli Horlacher
I need an input function with GNU readline support. So far I have: import readline readline.parse_and_bind("tab: complete") file = raw_input('File to send: ') Cursor keys are working, but TAB-completion works only in the current directory. Example: File to send: [TAB][TAB]

[issue25729] update pure python datetime.timedelta creation

2015-11-24 Thread Brian Kearns
Changes by Brian Kearns : Removed file: http://bugs.python.org/file41158/timedelta.patch ___ Python tracker ___

[issue25729] update pure python datetime.timedelta creation

2015-11-24 Thread Brian Kearns
Changes by Brian Kearns : Added file: http://bugs.python.org/file41159/timedelta.patch ___ Python tracker ___

[issue25664] Unexpected UnicodeDecodeError in logging module

2015-11-24 Thread STINNER Victor
STINNER Victor added the comment: $ cat x.py # coding=utf-8 import logging logging.basicConfig(format='%(name)s %(message)s') logger = logging.getLogger(u'测试') logger.error(u'测试') $ python2.7 x.py Traceback (most recent call last): File "/usr/lib64/python2.7/logging/__init__.py", line 859,

[issue25729] update pure python datetime.timedelta creation

2015-11-24 Thread Brian Kearns
New submission from Brian Kearns: Brings timedelta creation up to par with the (simpler) C equivalent. Gives a nice speed boost on the pure-py version (not worth much on CPython but useful on other implementations like PyPy). Included in a few other small bug fixes/cleanups, should be

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

2015-11-24 Thread Steven D'Aprano
On Tue, 24 Nov 2015 11:38 pm, Antoon Pardon wrote: > Op 19-11-15 om 13:45 schreef Steven D'Aprano: [...] >> I don't mean that it isn't sometimes useful. Of course it is sometimes >> useful, there's no doubt about that. But why would you expect the >> language to default to the *slow*,

[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-11-24 Thread Steve Dower
Steve Dower added the comment: Fix attached: * moves the UI update to the correct time (*after* we've detected the path) * fixes a launcher detection issue I noticed * removes a duplicated function -- keywords: +patch Added file: http://bugs.python.org/file41152/25715_1.patch

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

2015-11-24 Thread Oscar Benjamin
On 24 November 2015 at 15:27, Ned Batchelder wrote: > On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote: >> Op 24-11-15 om 15:18 schreef Ned Batchelder: >> >> > 2) In Python, "value" means, what object does a name refer to, or what >> > object did an

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

2015-11-24 Thread Antoon Pardon
Op 24-11-15 om 17:56 schreef Ian Kelly: > >> So on what grounds would you argue that () is not a literal. > > This enumerates exactly what literals are in Python: > > https://docs.python.org/3/reference/lexical_analysis.html#literals > > I think it's a rather pedantic point, though. How are

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

2015-11-24 Thread Ned Batchelder
On Tuesday, November 24, 2015 at 12:25:54 PM UTC-5, Oscar Benjamin wrote: > On 24 November 2015 at 15:27, Ned Batchelder wrote: > > On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote: > >> Op 24-11-15 om 15:18 schreef Ned Batchelder: > >> > >> > 2) In

[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-24 Thread Hans Lawrenz
Hans Lawrenz added the comment: Serhiy and Emanuel, I'll paste below the surrounding code and attach the exact tempfile.py. It is the version distributed with the 3.5.0 release. If you take a look at the github repo I linked in the first comment you can also try it out for yourself if you've

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

2015-11-24 Thread Terry Reedy
On 11/24/2015 9:34 AM, Antoon Pardon wrote: I agree that the tutorial should talk about default argument objects (which have values) instead of conflating 'object' with 'value'. Op 20-11-15 om 13:12 schreef Ned Batchelder: I'm not sure what your goal is at this point. Are you: 1)

Re: Finding scores from a list

2015-11-24 Thread John Gordon
In <277843f7-c898-4378-85ea-841b09a28...@googlegroups.com> Cai Gengyang writes: > results = [ > {"id": 1, "name": "ensheng", "score": 10}, > {"id": 2, "name": "gengyang", "score": 12}, > {"id": 3, "name": "jordan", "score": 5}, > ] Okay, this is a list. > I want to

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

2015-11-24 Thread Zachary Ware
On Tue, Nov 24, 2015 at 9:46 AM, Marc Aymerich wrote: > if __name__ == '__main__': > loop_container = {} > handler = threading.Thread(target=run_loop, args=(loop_container, )) > handler.start() > try: > time.sleep(1) > finally: >

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

2015-11-24 Thread Marko Rauhamaa
Ned Batchelder : > Oscar, thanks for the thoughtful comments. I agree that using "object" > for the result of an expression, and for the referent of a name, would > go some ways to clarifying things. > > Perhaps the Python world uses "value" less to mean "object" than I am

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

2015-11-24 Thread Antoon Pardon
Op 24-11-15 om 18:46 schreef Terry Reedy: > On 11/24/2015 9:34 AM, Antoon Pardon wrote: > > I agree that the tutorial should talk about default argument objects (which > have values) instead of conflating 'object' with 'value'. > >> Op 20-11-15 om 13:12 schreef Ned Batchelder: > >>> I'm not

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

2015-11-24 Thread Steven D'Aprano
On Wed, 25 Nov 2015 05:13 am, Marko Rauhamaa wrote: > Personally, I don't like the "official" Python usage: > > Objects whose value can change are said to be mutable > > I would prefer this wording: > > Objects whose inner state can change are said to be mutable I see your point, but "inner

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

2015-11-24 Thread Marc Aymerich
On Tue, Nov 24, 2015 at 7:11 PM, Zachary Ware wrote: > On Tue, Nov 24, 2015 at 9:46 AM, Marc Aymerich wrote: >> if __name__ == '__main__': >> loop_container = {} >> handler = threading.Thread(target=run_loop, args=(loop_container, )) >>

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

2015-11-24 Thread Antoon Pardon
Op 24-11-15 om 18:53 schreef Ian Kelly: > On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon > wrote: >> Op 24-11-15 om 17:56 schreef Ian Kelly: >> >>> So on what grounds would you argue that () is not a literal. >>> >>> This enumerates exactly what literals are in

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

2015-11-24 Thread Ned Batchelder
On Tuesday, November 24, 2015 at 1:45:34 PM UTC-5, Antoon Pardon wrote: > Whether you want to call it literals or something else, the fact > remains that (3, 5, 8) is treated like -42 by the CPython interpreter > and [3, 5, 8] is not. Maybe I've lost the original point in all this minutia about

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

2015-11-24 Thread Steven D'Aprano
On Tue, 24 Nov 2015 11:57 pm, Marko Rauhamaa wrote: > Antoon Pardon : > >> You then switching to talking about objects, just gives the impression >> that object is a synonym for value. > > It isn't? No it isn't. The definition of "object" -- well, I say "the"

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

2015-11-24 Thread Chris Angelico
On Wed, Nov 25, 2015 at 3:28 AM, Random832 wrote: > On 2015-11-24, Chris Angelico wrote: >> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon >> wrote: Start thinking of it as a constructor call rather than a literal, and

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

2015-11-24 Thread Sebastian Bank
Sebastian Bank added the comment: Terry: I am not so sure about that interpretation. Do we agree that the INI-files are the data/message? ConfigParser refuses to accept dirty INI-Files (with ']' in section names) but will produce this kind of files. I we see the arguments given to ConfigParser

Re: tuples in conditional assignment (Ben Finney)

2015-11-24 Thread George Trojan
Ben Finney writes: Ben Finney Date: 11/24/2015 04:49 AM To: python-list@python.org George Trojan writes: The following code has bitten me recently: t=(0,1) x,y=t if t else 8, 9 print(x, y) (0, 1) 9 You can simplify this by taking

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

2015-11-24 Thread Marc Aymerich
threading supports the 'daemon' option[1], when set to True and the program is in *foreground* then the event-loop thread dies when SIGTERM-ed, however, if the program is in the *background* it doesn't work! still deadlocked :'''( while I'm not finding a definitive solution I'll be doing a

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

2015-11-24 Thread Antoon Pardon
Op 24-11-15 om 16:48 schreef Chris Angelico: > On Wed, Nov 25, 2015 at 2:46 AM, Antoon Pardon > wrote: >> What is your point? I say that [] looks like a literal. Because it >> sure resembles () which is a literal. >> >> That [] in fact isn't a literal doesn't

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

2015-11-24 Thread Ian Kelly
On Tue, Nov 24, 2015 at 9:41 AM, Antoon Pardon wrote: > Op 24-11-15 om 16:48 schreef Chris Angelico: >> () is not a literal either. > > The byte code sure suggests it is. > > Take the following code: > > import dis > > def f(): > i = 42 > t = () > l = [] > >

Re: Returning a result from 3 items in a list

2015-11-24 Thread Ned Batchelder
On Tuesday, November 24, 2015 at 9:29:30 AM UTC-5, Mark Lawrence wrote: > On 24/11/2015 14:07, Denis McMahon wrote: > > On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote: > > > >> Here's a dictionary with 3 values : > >> > >> results = { > >>"gengyang": 14, > >>"ensheng": 13,

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

2015-11-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Sebastian: you have it backwards. A paraphrase of Postel's recommendation (calling it a Law is wrong) is 'accept dirty data, emit clean data'. This is the current behavior. See https://en.wikipedia.org/wiki/Robustness_principle. This article also explains

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

2015-11-24 Thread SpaceOne
SpaceOne added the comment: Sorry about that! I created http://bugs.python.org/issue25723. -- ___ Python tracker ___

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

2015-11-24 Thread Random832
On 2015-11-24, Chris Angelico wrote: > On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon > wrote: >>> Start thinking of it as a constructor call rather than a literal, and >>> you'll get past most of the confusion. >> >> That doesn't change the fact it

[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: __reduce__() and __setstate__() methods of itertools.accumulate() look correct. The problem is not in itertools.accumulate(), but in the copy module. It uses the same __reduce__ protocol as pickle, but in different way. In the pickle module (in both Python

[issue25718] itertools.accumulate __reduce__/__setstate__ bug

2015-11-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file41151/copy_state_is_false.patch ___ Python tracker

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

2015-11-24 Thread Mark Lawrence
Mark Lawrence added the comment: Why the debate on an issue that was closed over 18 months ago? -- nosy: +BreamoreBoy ___ Python tracker ___

  1   2   3   >