[issue14364] Argparse incorrectly handles '--' as argument to option

2016-03-27 Thread paul j3
paul j3 added the comment: I made a mistake of trying to add to or refine a closed patch. Maybe I need to move the dbldash.patch over here for more formal consideration. -- ___ Python tracker

[issue26039] More flexibility in zipfile write interface

2016-03-27 Thread Марк Коренберг
Марк Коренберг added the comment: https://github.com/SpiderOak/ZipStream tries to implement streaming in one more kind. Also libarchive have experimental support of streaming write to zip archives in newest version. So problem is actual. -- ___

[issue18722] Remove uses of the register keyword

2016-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree that comments like /* Help allocation */ are confused and misleading. -- ___ Python tracker ___

[issue19959] argparse.FileType does not expand tilde "~"

2016-03-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___ ___

[issue19959] argparse.FileType does not expand tilde "~"

2016-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm with Martin. -- nosy: +serhiy.storchaka status: pending -> open ___ Python tracker ___

[issue18722] Remove uses of the register keyword

2016-03-27 Thread Martin Panter
Martin Panter added the comment: I did a review of some of the changes in . In particular, there are a couple of comments /* Help register allocation */ which were mangled to /* Help allocation */. But it is not clear if the leftover variable

[issue9694] argparse required arguments displayed under "optional arguments"

2016-03-27 Thread Martin Panter
Martin Panter added the comment: I am willing to drop most of the code and comment changes if that moves us closer to consensus. Paul: would you accept changing the heading “optional arguments” to “options” in 3.6? I thought we were close to consensus to use “options”, but maybe that is my

[issue26653] bisect raises a TypeError when hi is None

2016-03-27 Thread Xiang Zhang
Xiang Zhang added the comment: The C version bisect_right can only accept number as hi, which conflicts with the python version using None as the default value. -- nosy: +xiang.zhang ___ Python tracker

Re: Useless expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Chris Angelico
On Mon, Mar 28, 2016 at 1:59 PM, Tim Chase wrote: > On 2016-03-28 12:38, Chris Angelico wrote: >> I would still look askance at code that adds two things and drops >> the result, though. The compiler can't discard it, but if a linter >> complains, I'd support that.

[issue26653] bisect raises a TypeError when hi is None

2016-03-27 Thread Mike Lenzen
New submission from Mike Lenzen: >>> bisect.bisect([1, 2, 3], 1, hi=None) TypeError: 'NoneType' object cannot be interpreted as an integer I'm assuming this is an error in the C implementation because the Python source has: if hi is None: hi = len(a) -- components:

[issue26652] Cannot install Python 2.7.11 on Windows Server 2008 R2

2016-03-27 Thread Hung-Hsuan Chen
New submission from Hung-Hsuan Chen: I tried installing Python2.7.11 on a Virtual machine running Windows Server 2008 R2. However, I cannot complete the installation. I tried reboot the machine and re-install for a couple of times but got no luck. Here I attach the log file of "msiexec /i

Re: Useless expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Tim Chase
On 2016-03-28 12:38, Chris Angelico wrote: > I would still look askance at code that adds two things and drops > the result, though. The compiler can't discard it, but if a linter > complains, I'd support that. A DSL that requires you to do this is, > imo, poorly designed. Is it only the "*add*

[issue23804] SSLSocket.recv(0) receives up to 1024 bytes

2016-03-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7a3c5f7dda86 by Martin Panter in branch '3.5': Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes https://hg.python.org/cpython/rev/7a3c5f7dda86 New changeset 72c457f9533a by Martin Panter in branch 'default': Issue #23804: Merge SSL zero

[issue15859] Fail update installation: 'utf-8' codec can't decode byte 0x90 in position 0: invalid start byte

2016-03-27 Thread q20611...@163.com
q20611...@163.com added the comment: this issue occureed when i run gns3-1.4.5 in python3.5.1 help me ! my system is linux 3.6.11 release version is red flag inwise 8.0 -- components: -Windows nosy: +shanzhengcheng -BreamoreBoy, christian.heimes, ideasman42, pitrou, python-dev

[issue26543] imaplib noop Debug

2016-03-27 Thread Demur Rumed
Demur Rumed added the comment: Fixes syntax & line length issues in previous patch -- Added file: http://bugs.python.org/file42312/imaplib2.patch ___ Python tracker

[issue19959] argparse.FileType does not expand tilde "~"

2016-03-27 Thread Martin Panter
Martin Panter added the comment: I think this change is not appropriate for Unix, because it is redundant and would conflict with normal shell expansion. I’m not familiar with Windows, but I suspect it is not appropriate there either (neither Windows command shells nor argparse do wildcard *

Useless expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Steven D'Aprano
On Mon, 28 Mar 2016 01:43 am, BartC wrote: [... talk about function and procedures ...] > Well, that could be done in Python (not so usefully because you can't > take account of such info until a call is attempted), but that's not > what I'm talking about, which is simply allowing: > >

[issue14364] Argparse incorrectly handles '--' as argument to option

2016-03-27 Thread Martin Panter
Martin Panter added the comment: In Python 3.5, this does not seem fixed. Issue 13922 is marked as resolved and fixed, but Pauls’s patch has not actually been committed. >>> ap = ArgumentParser() >>> ap.add_argument("-t", "--test", type=str, nargs=1) _StoreAction(option_strings=['-t',

Re: Useless expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Chris Angelico
On Mon, Mar 28, 2016 at 12:24 PM, Steven D'Aprano wrote: >> >>f() # Probably OK >>g() # Probably OK >>f()+g() # Probably not OK > > You don't and can't know what's "probably not" okay unless you know what > type of object both f and g return. >

Re: Statements as expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Paul Rubin
Steven D'Aprano writes: > if condition: > print(1) > print(2) > else: > print(3) > print(4) > what value should it return? Justify your choice. It could whatever value that the last call to print() returns. Lisp has worked like that since the 1950's. > What

Useless expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Steven D'Aprano
On Mon, 28 Mar 2016 03:39 am, Terry Reedy wrote: > On 3/27/2016 11:48 AM, Ned Batchelder wrote: >> On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote: > >>> whether fn has an explicit return or not, and not allowing: >>> >>> fn # and other kinds of expression >>> >>> unless

Re: How to make Python interpreter a little more strict?

2016-03-27 Thread Steven D'Aprano
On Mon, 28 Mar 2016 07:49 am, BartC wrote: > On 27/03/2016 21:32, Tim Chase wrote: >> On 2016-03-27 14:28, Steven D'Aprano wrote: > >>> In this case, the two lines "fnc" and "next" simply look up the >>> function names, but without actually calling them. They're not >>> quite "no-ops", since

Useless expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Steven D'Aprano
On Sun, 27 Mar 2016 10:31 pm, BartC wrote: > On 27/03/2016 07:34, Paul Rubin wrote: >> BartC writes: >>> But my suggestion was to have required a keyword in front of >>> such expressions. >> >> Should there be a keyword in front of a line containing "sqrt(x)" ? >> What about

[issue26488] hashlib command line interface

2016-03-27 Thread Martin Panter
Martin Panter added the comment: FWIW I am not really comfortable with argparse.FileType; see Issue 13824. How does this patch perform when warnings are enabled, or if you specify a file, but then cause some other argparse error? -- nosy: +martin.panter

Re: Suggestion: make sequence and map interfaces more similar

2016-03-27 Thread Steven D'Aprano
On Mon, 28 Mar 2016 05:01 am, Marco S. wrote: > Steven D'Aprano wrote: > >> The point you might have missed is that treating lists as if they were >> mappings violates at least one critical property of mappings: that the >> relationship between keys and values are stable. > > > This is true

[issue26039] More flexibility in zipfile write interface

2016-03-27 Thread Martin Panter
Martin Panter added the comment: Mark: I suggest to keep this discussion focussed on writing zip files, although I agree some enhancements to help reading without seeking could be reasonable. -- title: More flexibility in zipfile interface -> More flexibility in zipfile write

Statements as expressions [was Re: Undefined behaviour in C]

2016-03-27 Thread Steven D'Aprano
On Mon, 28 Mar 2016 03:58 am, BartC wrote: >> One of Guido's principles in designing Python was to keep it simple, >> even where that might mean people could make errors with it. This part >> of the language is no different: any expression can be a statement. > > Yeah, but even simpler would be

Re: help with program

2016-03-27 Thread Steven D'Aprano
On Mon, 28 Mar 2016 01:18 am, Bob Gailer wrote: > The problem with putting input at the end of a program is: if the program > raises an exception you won't see it. True. But the solution to that is simple: don't make mistakes when programming :-) If you have a better solution, please speak up.

Re: List of Functions

2016-03-27 Thread Ben Bacarisse
Richard Riehle writes: > Several months ago, I posted a question regarding how to create a list > of functions. > I realize that this seems trivial to many experience Pythonistas. But > it might prove useful for those who are relative newcomers to the > language. In any case,

[issue26647] Wordcode

2016-03-27 Thread Demur Rumed
Demur Rumed added the comment: Also missing from this patch is modification of the bytecode magic number -- ___ Python tracker ___

[issue22558] Missing doc links to source code

2016-03-27 Thread Martin Panter
Changes by Martin Panter : -- title: Missing hint to source code - complete -> Missing doc links to source code ___ Python tracker

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Hongyi Zhao
On Sun, 27 Mar 2016 13:24:05 +, Hongyi Zhao wrote: > # replace env > os.environ.clear() I find another method which can solve this issue, ie., changing the above code into the follows: # ref : http://unix.stackexchange.com/questions/178522/unsetting-

Re: How to make Python interpreter a little more strict?

2016-03-27 Thread Nobody
On Sat, 26 Mar 2016 23:30:30 +, John Pote wrote: > So I have sympathy with the OP, I would expect the compiler to pick this > up Why? The code is valid, the compiler knows how to generate the appropriate bytecode for it. The compiler isn't "lint". Reporting code which is actually invalid

Re: List of Functions

2016-03-27 Thread Erik
Hi Richard, On 27/03/16 20:38, Richard Riehle wrote: I realize that this seems trivial to many experience Pythonistas. But it might prove useful for those who are relative newcomers Thanks for sharing your solution (people finding the original question because it happens to match their own

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread BartC
On 27/03/2016 22:55, Ned Batchelder wrote: On Sunday, March 27, 2016 at 4:19:12 PM UTC-4, BartC wrote: On 27/03/2016 18:19, Ned Batchelder wrote: On Sunday, March 27, 2016 at 12:58:23 PM UTC-4, BartC wrote: There would be a list of expression terms that can also form independent statements.

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread Ned Batchelder
On Sunday, March 27, 2016 at 4:19:12 PM UTC-4, BartC wrote: > On 27/03/2016 18:19, Ned Batchelder wrote: > > On Sunday, March 27, 2016 at 12:58:23 PM UTC-4, BartC wrote: > > >> There would be a list of expression terms that can also form independent > >> statements. Not knowing Python, the list

[issue26130] redundant local copy of a char pointer in classify in Parser\parser.c

2016-03-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset a90f5e2b7160 by Berker Peksag in branch 'default': Issue #26130: Remove redundant variable 's' from Parser/parser.c https://hg.python.org/cpython/rev/a90f5e2b7160 -- nosy: +python-dev ___ Python tracker

[issue26130] redundant local copy of a char pointer in classify in Parser\parser.c

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Oren! -- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5 ___ Python tracker

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-03-27 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +patch ___ Python tracker ___ ___

Re: How to make Python interpreter a little more strict?

2016-03-27 Thread Chris Angelico
On Mon, Mar 28, 2016 at 7:49 AM, BartC wrote: > On 27/03/2016 21:32, Tim Chase wrote: >> >> On 2016-03-27 14:28, Steven D'Aprano wrote: > > >>> In this case, the two lines "fnc" and "next" simply look up the >>> function names, but without actually calling them. They're not >>>

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: Thanks! -- keywords: +3.5regression -patch resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2016-03-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset dcd3b078ab84 by Berker Peksag in branch '3.5': Issue #25195: Fix a regression in mock.MagicMock https://hg.python.org/cpython/rev/dcd3b078ab84 New changeset 880d609b6664 by Berker Peksag in branch 'default': Issue #25195: Fix a regression in

[issue26039] More flexibility in zipfile interface

2016-03-27 Thread Марк Коренберг
Марк Коренберг added the comment: Also, Python have problems with streaming READ of zip archive. I mean ability to read (in some form iterate over) archive when seeking is not available. I mean iteration like one in TAR archives. -- ___ Python

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread Oscar Benjamin
On 27 Mar 2016 23:11, "Ben Bacarisse" wrote: > > Steven D'Aprano writes: > > > On Sun, 27 Mar 2016 05:13 pm, Paul Rubin wrote: > > > >> Steven D'Aprano writes: > >>> For example, would you consider that this isolated C code is >

[issue26644] SSLSocket.recv(-1) triggers SystemError

2016-03-27 Thread Martin Panter
Martin Panter added the comment: The Python 2 fix was slightly different, due to the lack of Argument Clinic. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-27 Thread Martin Panter
Martin Panter added the comment: Sorry I forgot to send my draft. Sent now, but you figured it out :) -- ___ Python tracker ___

Re: How to make Python interpreter a little more strict?

2016-03-27 Thread BartC
On 27/03/2016 21:32, Tim Chase wrote: On 2016-03-27 14:28, Steven D'Aprano wrote: In this case, the two lines "fnc" and "next" simply look up the function names, but without actually calling them. They're not quite "no-ops", since they can fail and raise NameError if the name doesn't exist,

Re: How to make Python interpreter a little more strict?

2016-03-27 Thread Tim Chase
On 2016-03-27 14:28, Steven D'Aprano wrote: > > So intrigued by this question I tried the following > > def fnc( n ): > > print "fnc called with parameter '%d'" % n > > return n > > > > for i in range(0,5): > > if i%2 == 0: > > fnc > > next > > print i > > >

[issue26039] More flexibility in zipfile interface

2016-03-27 Thread Марк Коренберг
Марк Коренберг added the comment: I have the same problem, and make monkey-patch by myself BEFORE seeing this issue (!) Example how I can do that is attached under name "socketpair.py". It will be nice if you take my idea. And after that streaming of zip files would be possible. --

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread BartC
On 27/03/2016 18:19, Ned Batchelder wrote: On Sunday, March 27, 2016 at 12:58:23 PM UTC-4, BartC wrote: There would be a list of expression terms that can also form independent statements. Not knowing Python, the list would comprise function calls (ie. the function call is top node in the AST

[issue26543] imaplib noop Debug

2016-03-27 Thread Demur Rumed
Demur Rumed added the comment: I've attached a patch file of the proposed change which seems correct -- keywords: +patch nosy: +Demur Rumed Added file: http://bugs.python.org/file42310/imaplib.patch ___ Python tracker

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread Ben Bacarisse
Steven D'Aprano writes: > On Sun, 27 Mar 2016 05:13 pm, Paul Rubin wrote: > >> Steven D'Aprano writes: >>> For example, would you consider that this isolated C code is >>> "meaningless"? >>> int i = n + 1; >> >> It's meaningful as long as n is in a

List of Functions

2016-03-27 Thread Richard Riehle
Several months ago, I posted a question regarding how to create a list of functions. I quickly solved the problem on my own, but I am just now getting around to sharing my solution. It was actually quite simple, and also quite useful for the problem I had at hand. Below is an example of one

[issue23758] Improve documenation about num_params in sqlite3 create_function and create_aggregate

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: Thank you Cédric. I also added tests to verify the behavior of num_params=-1. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 ___ Python tracker

[issue23758] Improve documenation about num_params in sqlite3 create_function and create_aggregate

2016-03-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 02efd708c5c0 by Berker Peksag in branch '3.5': Issue #23758: Improve num_params docs of create_{function,aggregate} functions https://hg.python.org/cpython/rev/02efd708c5c0 New changeset 5be12f20d8f2 by Berker Peksag in branch 'default': Issue

Re: Suggestion: make sequence and map interfaces more similar

2016-03-27 Thread Mark Lawrence
On 27/03/2016 19:01, Marco S. via Python-list wrote: Mark Lawrence wrote: I cannot see this happening unless you provide a patch on the bug tracker. However I suspect you can get the same thing by subclassing dict. Why don't you try it and let us know how you get on? The problem with a

Re: Help with python script for NMR

2016-03-27 Thread mohamadmaaz5
On Sunday, March 27, 2016 at 7:40:06 PM UTC+2, Peter Otten wrote: > mohamadma...@gmail.com wrote: > > > On Sunday, March 27, 2016 at 4:50:01 PM UTC+2, Joel Goldstick wrote: > >> On Sun, Mar 27, 2016 at 10:38 AM, wrote: > >> > >> > Hello there, > >> > I found a python

[issue9303] Migrate sqlite3 module to _v2 API to enhance performance

2016-03-27 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue18691] sqlite3.Cursor.execute expects sequence as second argument.

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: I think the name "parameters" causes a confusion here. It basically means def execute(sql, parameters): not def execute(sql, *parameters): So ``con.execute('insert into foo values (?, ?)', (4, 5))`` is the correct usage of the API. Also, this looks

Re: Suggestion: make sequence and map interfaces more similar

2016-03-27 Thread Marco S. via Python-list
Steven D'Aprano wrote: > The point you might have missed is that treating lists as if they were > mappings violates at least one critical property of mappings: that the > relationship between keys and values are stable. This is true for immutable maps, but for mutable ones, you can simply do

[issue26646] Allow built-in module in package

2016-03-27 Thread Brett Cannon
Brett Cannon added the comment: http://bugs.python.org/issue1644818 is also related to this. -- ___ Python tracker ___

[issue9297] SMTP with Sqlite3 file attached problem

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: > Unless someone can reproduce the issue, I recommend that we close this ticket. I couldn't reproduce it either. -- nosy: +berker.peksag status: open -> closed ___ Python tracker

Re: Help with python script for NMR

2016-03-27 Thread Peter Otten
mohamadma...@gmail.com wrote: > On Sunday, March 27, 2016 at 4:50:01 PM UTC+2, Joel Goldstick wrote: >> On Sun, Mar 27, 2016 at 10:38 AM, wrote: >> >> > Hello there, >> > I found a python script in a scientific article that enables a simple >> > calculation on an NMR

[issue15117] Please document top-level sqlite3 module variables

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: *_version_* attributes OP mentioned have already been documented in b8b26feb3e1a. -- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue26647] Wordcode

2016-03-27 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread Ned Batchelder
On Sunday, March 27, 2016 at 12:58:23 PM UTC-4, BartC wrote: > On 27/03/2016 16:48, Ned Batchelder wrote: > > On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote: > >> On 27/03/2016 14:47, Dennis Lee Bieber wrote: > > >> Well, that could be done in Python (not so usefully because you

Re: Help with python script for NMR

2016-03-27 Thread Wildman via Python-list
On Sun, 27 Mar 2016 09:40:57 -0700, mohamadmaaz5 wrote: > On Sunday, March 27, 2016 at 6:27:59 PM UTC+2, Wildman wrote: >> On Sun, 27 Mar 2016 09:15:39 -0700, mohamadmaaz5 wrote: >> >> > On Sunday, March 27, 2016 at 6:07:43 PM UTC+2, Wildman wrote: >> >> On Sun, 27 Mar 2016 08:13:49 -0700,

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread BartC
On 27/03/2016 16:48, Ned Batchelder wrote: On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote: On 27/03/2016 14:47, Dennis Lee Bieber wrote: Well, that could be done in Python (not so usefully because you can't take account of such info until a call is attempted), but that's not

[issue19065] sqlite3 timestamp adapter chokes on timezones

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: > Do you know what would be the correct step to propose a deprecation in the > sqlite3 module of Python proper? I've opened issue 26651 (patch included) to deprecate them. -- nosy: +berker.peksag resolution: -> rejected stage: needs patch -> resolved

[issue26651] Deprecate register_adapter() and register_converter() in sqlite3

2016-03-27 Thread Berker Peksag
New submission from Berker Peksag: In issue 19065: Gerhard says: "I'm -1 because I believe that ultimately, adapters and converters were a mistake to add to pysqlite. That's why I deprecated them in pysqlite 2.8.0." Here is a patch (based on commit from pysqlite project [1]) to deprecate

[issue23551] IDLE to provide menu link to PIP gui.

2016-03-27 Thread Eric Khoo Jiun Hooi
Eric Khoo Jiun Hooi added the comment: @Terry, this is the code segment that I wrote to display the latest as you mention. Do give comment for improvement. -- Added file: http://bugs.python.org/file42308/pip_gui_v3.py ___ Python tracker

Re: Help with python script for NMR

2016-03-27 Thread mohamadmaaz5
On Sunday, March 27, 2016 at 6:27:59 PM UTC+2, Wildman wrote: > On Sun, 27 Mar 2016 09:15:39 -0700, mohamadmaaz5 wrote: > > > On Sunday, March 27, 2016 at 6:07:43 PM UTC+2, Wildman wrote: > >> On Sun, 27 Mar 2016 08:13:49 -0700, mohamadmaaz5 wrote: > >> > >> >> > Hello there, > >> >> > I found a

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread Terry Reedy
On 3/27/2016 11:48 AM, Ned Batchelder wrote: On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote: whether fn has an explicit return or not, and not allowing: fn # and other kinds of expression unless some keyword is used. Python *could* have made it an error to have a

Re: Help with python script for NMR

2016-03-27 Thread Peter Pearson
On Sun, 27 Mar 2016 08:13:49 -0700 (PDT), mohamadma...@gmail.com wrote: > On Sunday, March 27, 2016 at 4:50:01 PM UTC+2, Joel Goldstick wrote: >> On Sun, Mar 27, 2016 at 10:38 AM, wrote: >> >> > Hello there, >> > I found a python script in a scientific article that

Re: Help with python script for NMR

2016-03-27 Thread Wildman via Python-list
On Sun, 27 Mar 2016 09:15:39 -0700, mohamadmaaz5 wrote: > On Sunday, March 27, 2016 at 6:07:43 PM UTC+2, Wildman wrote: >> On Sun, 27 Mar 2016 08:13:49 -0700, mohamadmaaz5 wrote: >> >> >> > Hello there, >> >> > I found a python script >> >> The formatting of the script is all wrong. There are

Re: Help with python script for NMR

2016-03-27 Thread mohamadmaaz5
On Sunday, March 27, 2016 at 6:07:43 PM UTC+2, Wildman wrote: > On Sun, 27 Mar 2016 08:13:49 -0700, mohamadmaaz5 wrote: > > >> > Hello there, > >> > I found a python script > > The formatting of the script is all wrong. There are many > spaces that should not be there and no indentations. It >

Re: Why lambda in loop requires default?

2016-03-27 Thread Terry Reedy
On 3/26/2016 9:46 PM, gvim wrote: Given that Python, like Ruby, is an object-oriented language why doesn't this: def m(): a = [] for i in range(3): a.append(lambda: i) return a def echo_i: return i b = m() for n in range(3): print(b[n]()) # => 2 2 2 ) # => 2 2 2 ...

Re: Help with python script for NMR

2016-03-27 Thread Wildman via Python-list
On Sun, 27 Mar 2016 08:13:49 -0700, mohamadmaaz5 wrote: >> > Hello there, >> > I found a python script The formatting of the script is all wrong. There are many spaces that should not be there and no indentations. It could take a long time to figure it out. It could be just a copy/paste

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread Ned Batchelder
On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote: > On 27/03/2016 14:47, Dennis Lee Bieber wrote: > > On Sun, 27 Mar 2016 12:31:26 +0100, BartC declaimed the > > following: > > > >> On 27/03/2016 07:34, Paul Rubin wrote: > >>> BartC writes: >

Re: help with program

2016-03-27 Thread Terry Reedy
On 3/27/2016 10:18 AM, Bob Gailer wrote: The problem with putting input at the end of a program is: if the program raises an exception you won't see it. What you are saying is that putting input() at the end of a program (or before any exit point) is insufficient for keeping a window alive if

Re: Why lambda in loop requires default?

2016-03-27 Thread Ned Batchelder
On Sunday, March 27, 2016 at 9:55:16 AM UTC-4, g vim wrote: > Given that Python, like Ruby, is an object-oriented language It turns out that "object-oriented" means very little, and lots of languages that are object-oriented will behave differently from each other, even where object behavior is

Re: Why lambda in loop requires default?

2016-03-27 Thread Jussi Piitulainen
gvim writes: > Given that Python, like Ruby, is an object-oriented language why > doesn't this: > > def m(): > a = [] > for i in range(3): a.append(lambda: i) > return a > > b = m() > for n in range(3): print(b[n]()) # => 2 2 2 > > ... work the same as this in Ruby: > > def m > a = []

Re: Help with python script for NMR

2016-03-27 Thread mohamadmaaz5
On Sunday, March 27, 2016 at 4:50:01 PM UTC+2, Joel Goldstick wrote: > On Sun, Mar 27, 2016 at 10:38 AM, wrote: > > > Hello there, > > I found a python script in a scientific article that enables a simple > > calculation on an NMR spectrum. > > I have no experience in

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Chris Angelico
On Mon, Mar 28, 2016 at 12:24 AM, Hongyi Zhao wrote: > # replace env > os.environ.clear() > os.environ.update(line.partition('=')[::2] for line in output.split('\0')) > > Traceback (most recent call last): > File

Re: Help with python script for NMR

2016-03-27 Thread Joel Goldstick
On Sun, Mar 27, 2016 at 10:38 AM, wrote: > Hello there, > I found a python script in a scientific article that enables a simple > calculation on an NMR spectrum. > I have no experience in programming and i would appreciate it if i can > communicate with someone who can

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-27 Thread BartC
On 27/03/2016 14:47, Dennis Lee Bieber wrote: On Sun, 27 Mar 2016 12:31:26 +0100, BartC declaimed the following: On 27/03/2016 07:34, Paul Rubin wrote: BartC writes: But my suggestion was to have required a keyword in front of such expressions. Should

Help with python script for NMR

2016-03-27 Thread mohamadmaaz5
Hello there, I found a python script in a scientific article that enables a simple calculation on an NMR spectrum. I have no experience in programming and i would appreciate it if i can communicate with someone who can write this script and send it to me by mail in py format. It's a short

Re: Why lambda in loop requires default?

2016-03-27 Thread Jussi Piitulainen
gvim writes: > Given that Python, like Ruby, is an object-oriented language why > doesn't this: > > def m(): > a = [] > for i in range(3): a.append(lambda: i) > return a > > b = m() > for n in range(3): print(b[n]()) # => 2 2 2 I'm going to suggest two variations that may or may not

Re: help with program

2016-03-27 Thread Bob Gailer
The problem with putting input at the end of a program is: if the program raises an exception you won't see it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Oscar Benjamin
On 27 Mar 2016 17:01, "Ben Finney" wrote: > > Hongyi Zhao writes: > > > I use the following code the update the os.environ: > > > > import os > > from subprocess import check_output > > > > # POSIX: name shall not contain '=', value doesn't

[issue9303] Migrate sqlite3 module to _v2 API to enhance performance

2016-03-27 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag type: performance -> enhancement ___ Python tracker ___

[issue24887] Sqlite3 has no option to provide open flags

2016-03-27 Thread Berker Peksag
Berker Peksag added the comment: URI filename support has been added in f13bb1e40fbc (Python 3.4+). db = sqlite3.connect('file:path/to/database?mode=ro', uri=True) Here is a patch that adds a new flags parameter to sqlite3.connect(). -- dependencies: -Migrate sqlite3 module to

Re: Announcing the release of Yosai: a security framework for python applications

2016-03-27 Thread Ben Finney
Darin Gordon writes: > I am very glad to announce the first release of Yosai, a security > framework for python applications. > > Details, including link to project: > http://www.daringordon.com/introducing_yosai Rather than just a link, can you please give a couple of

Re: Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Ben Finney
Hongyi Zhao writes: > I use the following code the update the os.environ: > > import os > from subprocess import check_output > > # POSIX: name shall not contain '=', value doesn't contain '\0' > output = check_output("source /home/werner/env-intel-toolchains.sh; >

EuroPython 2016: More than 150 sessions waiting for you

2016-03-27 Thread M.-A. Lemburg
Just in case you didn’t find enough Easter eggs today, we have a whole basket of them waiting for you: the first set of accepted sessions for EuroPython 2016 in Bilbao. *** EuroPython 2016 Session List *** https://ep2016.europython.eu/en/events/sessions/ The

Why lambda in loop requires default?

2016-03-27 Thread gvim
Given that Python, like Ruby, is an object-oriented language why doesn't this: def m(): a = [] for i in range(3): a.append(lambda: i) return a b = m() for n in range(3): print(b[n]()) # => 2 2 2 ... work the same as this in Ruby: def m a = [] (0..2).each {|i| a << ->(){i}} a

Announcing the release of Yosai: a security framework for python applications

2016-03-27 Thread Darin Gordon
Hey Everyone! I am very glad to announce the first release of Yosai, a security framework for python applications. Details, including link to project: http://www.daringordon.com/introducing_yosai Regards Darin -- https://mail.python.org/mailman/listinfo/python-list

[issue23735] Readline not adjusting width after resize with 6.3

2016-03-27 Thread Eric Price
Eric Price added the comment: Hmm, I'm not seeing comments in the review? You're right about the order. When we don't have sigaction, python's signal handler will reinstall itself, so we need to reinstall this one after calling the old handler. -- Added file:

Calling the source command from subprocess.popen to update the os.environ.

2016-03-27 Thread Hongyi Zhao
Hi all, Based on the methods here: http://stackoverflow.com/questions/7040592/calling-the-source-command- from-subprocess-popen/18897007#comment30954741_12708396 I use the following code the update the os.environ: import os from subprocess import check_output # POSIX: name shall not contain

[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2016-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I meant different from current test and from previous patch. But it looks like what you were proposed. -- ___ Python tracker

  1   2   >