[issue29062] hashlib documentation link error

2016-12-30 Thread INADA Naoki
INADA Naoki added the comment: May I commit merge-hashlib-blake2.patch to 3.6 branch? -- ___ Python tracker ___

[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm leaving this for Andra Bogildea to work through and comment on. Testing is likely to be awkward at best. It would involve white box implementation specific steps like accessing the name managed variables and rotating through the doubly linked list

[issue29102] Add an id field to PyInterpreterState.

2016-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I'm also fine with using int_fast64_t for the subinterpreter count. The only thing I'm really advocating for strongly on that front is that I think it makes sense to sacrifice the sign bit in the ID field as an error indicator that provides a more

[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file46099/od_proxy2a.diff ___ Python tracker ___

[issue28518] execute("begin immediate") throwing OperationalError

2016-12-30 Thread Ma Lin
Ma Lin added the comment: I have no idea about how to fix it, but I would like to suggest that add back this test which was removed in commit 284676cf2ac8 : file: /Lib/sqlite3/test/transactions.py def CheckVacuum(self): self.cur.execute("create table test(i)") self.cur.execute("insert

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2016-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Originally this issue was raised on StackOverflow: http://stackoverflow.com/questions/41388606/python-3-6-vs-3-5-typeerror-message-on-string-concatenation -- ___ Python tracker

[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2016-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your patches Anthony. Could you please create a unittest for the first issue? The second issue is well known. Since the behavior is documented, I think it can be changed only in Python 3.7. The patch needs the "versionchanged" directives in

Re: Cleaning up conditionals

2016-12-30 Thread Jussi Piitulainen
"Deborah Swanson" writes: > Michael Torrie wrote: >> On 12/30/2016 05:26 PM, Deborah Swanson wrote: >> > I'm still wondering if these 4 lines can be collapsed to one or two >> > lines. >> >> If the logic is clearly expressed in the if blocks that you >> have, I

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2016-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Different cases accept different types. Not always we can say that only one specific type is accepted. "list +" accepts only lists, "list +=" is a syntax sugar for list.extend and accepts any iterables. "bytes +" and "bytearray +=" accept any objects that

[issue29059] Windows: Python not using ANSI compatible console

2016-12-30 Thread Glenn Linderman
Glenn Linderman added the comment: Re: curses... maybe that becomes a DOCS issue, to mention the available packages. But it would be easier, no doubt to port curses to a known existing escape sequence control set, than to use a bunch arcane, foreign-to-the-Unix-porter-that-wants-curses

[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Makes sense. Any chance to create tests? -- nosy: +serhiy.storchaka ___ Python tracker ___

Re: Problem with running python 3.6.0 on a 32 bit windows 7 ultimate operating system.

2016-12-30 Thread Ian Kelly
On Fri, Dec 30, 2016 at 10:53 PM, Sagar Utlas wrote: > I am new to python, I've been using C++ as as a student till last 3 years. > To expand my knowledge, I installed Python 3.6.0 and when tried to open it, > a pop up window appeared saying- "The program can't start

[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low Added file: http://bugs.python.org/file46098/od_proxy2.diff ___ Python tracker

[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger
New submission from Raymond Hettinger: The root.prev and first.prev assignments should use weak references rather than hard references. Spotted by Andra Bogildea. -- components: Library (Lib) files: od_proxy.diff keywords: patch messages: 284367 nosy: rhettinger priority: normal

Re: learning and experimenting python.

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 02:24 pm, einstein1...@gmail.com wrote: > Ethan, > If you think I am wasting time, don't read my posts. > Why wasting your time in reading my post. > > Are you having the answer of my question? > Till now no one is able to give answer, everybody just assuming something > and

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 19:23:17 -0700, Michael Torrie wrote: > On 12/30/2016 07:05 PM, Wildman via Python-list wrote: >> On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: >> >>> On 30/12/16 23:34, einstein1...@gmail.com wrote: You are also confusing me. But there mustbe some reason.

Problem with running python 3.6.0 on a 32 bit windows 7 ultimate operating system.

2016-12-30 Thread Sagar Utlas
I am new to python, I've been using C++ as as a student till last 3 years. To expand my knowledge, I installed Python 3.6.0 and when tried to open it, a pop up window appeared saying- "The program can't start because api-ms-win-crt-runtime-|1-1-0.dll is missing from your computer. try reinstalling

[issue29102] Add an id field to PyInterpreterState.

2016-12-30 Thread Steve Dower
Steve Dower added the comment: I fully expect subinterpreters to have a serious role in long running applications like web servers or other agents (e.g. cluster nodes), so I'd rather just bite the bullet and take 64-bits now so that we can completely neglect reuse issues. Otherwise we'll find

[issue29059] Windows: Python not using ANSI compatible console

2016-12-30 Thread Steve Dower
Steve Dower added the comment: I suspect curses could be updated to fully support Windows, even without the VT100 mode (all the functionality has existed for years, just through a different interface). It really just needs someone to take on the project, and there are already better options

[issue29076] Py 3.6 Mac installer doesn't update "python3" shell command

2016-12-30 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: Python 3.6 installer doesn't update "python3" shell command -> Py 3.6 Mac installer doesn't update "python3" shell command ___ Python tracker

[issue29075] Remove Windows Vista support

2016-12-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: How certain are you that Vista support will actually end? Other things: assuming reasonable certainty, could the 3.6 installer say "This is the last version that will run on Vista!"? -- nosy: +terry.reedy ___

Re: learning and experimenting python.

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 10:26 am, einstein1...@gmail.com wrote: > That's not the answer. > If you don't have answer, please don't answer like this, because that will > confuse others also. What's not the answer? What's the question? -- Steve “Cheer up,” they said, “things could be worse.” So I

[issue29059] Windows: Python not using ANSI compatible console

2016-12-30 Thread Glenn Linderman
Glenn Linderman added the comment: Nice idea, but not by default. An easy way to switch back and forth, and to be sure the original mode is restored on process exit would be a win. Most windows users want a real GUI, not curses, but compatibility with VT escape codes for cross-platform

[issue29118] Randit

2016-12-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Also, wherever you post, copy and paste the traceback instead of adding a link to an image. -- ___ Python tracker ___

[issue29118] Randit

2016-12-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: This issue has nothing to do with IDLE. There is also no bug here. Python's random module has a randint function that works fine. Either you or the book have misspelled 'randint' as 'randit' or the book is using its own random module and not the stdlib

Re: List comprehension

2016-12-30 Thread Terry Reedy
On 12/30/2016 2:37 PM, Jason Friedman wrote: Now, this puzzles me: [x,y for a in data] File "", line 1 [x,y for a in data] ^ SyntaxError: invalid syntax I believe that python begins to parse this as [x, (y for a in data)], a list of 2 items, except that the required () are

Re: List comprehension

2016-12-30 Thread Jason Friedman
> data = ( >> ... (1,2), >> ... (3,4), >> ... ) >> > [x,y for a in data] >> File "", line 1 >> [x,y for a in data] >>^ >> SyntaxError: invalid syntax >> >> I expected: >> [(1, 2), (3, 4)] > > > Why would you expect that? I would expect the global variables x and y, or >

Re: learning and experimenting python.

2016-12-30 Thread Ian Kelly
On Fri, Dec 30, 2016 at 6:05 PM, wrote: > But in his website, he recommended that post your questions here, he will > answer it. > But still as you told me I will send him an personal e-mail. This is a good place for asking questions about Python, but you should know

[issue24932] Use proper command line parsing in _testembed

2016-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: Steve's patch LGTM, and I now agree our needs are simple enough that we can rely on subprocess+unittest for the result reporting. I'd just missed Steve's simple solution of using the return code to indicate success or failure, as well as Eric's approach in

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
Michael Torrie wrote: > On 12/30/2016 05:26 PM, Deborah Swanson wrote: > > I'm still wondering if these 4 lines can be collapsed to one or two > > lines. > > If the logic is clearly expressed in the if blocks that you > have, I don't see why collapsing an if block into one or two > lines would

[issue24932] Use proper command line parsing in _testembed

2016-12-30 Thread Nick Coghlan
Changes by Nick Coghlan : -- title: Migrate _testembed to a C unit testing library -> Use proper command line parsing in _testembed ___ Python tracker

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 2016-12-31 00:48, Deborah Swanson wrote: > >> On 30/12/16 23:00, Deborah Swanson wrote: > >> > Oops, indentation was messed up when I copied it into the email. > >> > Should be this: > >> > > >> > if len(l1[st]) == 0: > >> > if len(l2[st]) > 0: > >> >

[issue29102] Add an id field to PyInterpreterState.

2016-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: The concern I have with using an unsigned value as the interpreter ID is that it's applying the "NULL means an error" idiom or the "false means an error" idiom to a non-pointer and non-boolean return type, whereas the common conventions for integer return

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 30Dec2016 15:17, Deborah Swanson wrote: > >>Ever consider using conjunctions? > >> > >>if len(l1[st]) and not len(l2[st]): > >>#0 is considered a false -- no need to test for "==0" > >>#non-0 is considered true -- no need to test for

Re: Re: Cleaning up conditionals

2016-12-30 Thread MRAB
On 2016-12-31 01:59, Cameron Simpson wrote: On 30Dec2016 15:17, Deborah Swanson wrote: Ever consider using conjunctions? if len(l1[st]) and not len(l2[st]): #0 is considered a false -- no need to test for "==0" #non-0

Re: learning and experimenting python.

2016-12-30 Thread Chris Angelico
On Sat, Dec 31, 2016 at 12:46 PM, eryk sun wrote: > In modern Windows, cmd and PowerShell change the console title instead > of the prompt. The title starts with "Administrator: " if the user is > an administrator (i.e. the BUILTIN\Administrators group is present and > enabled

[issue29118] Randit

2016-12-30 Thread Spacemage 33
New submission from Spacemage 33: I have a book with i can learn phyton but in the first Little game there is "from random import randit" and the book is for Phyton3 now it do not work im realy said about this please fix that -- assignee: terry.reedy components: IDLE files:

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Thanks everyone. My all posted messages will be deleted within 1 hour. I got my answer, its time to good bye. If new questions arise then I will put it by creating new topic. Good Bye all. Once again thanks David Froger for your answer. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Sorry everyone it's not LAN, its David Rogers. Please accept my apology. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Thanks once again. Its only you who gave me the satisfied answer. Now it's my task to identify the reason why ABC used >>> ? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Ethan, If you think I am wasting time, don't read my posts. Why wasting your time in reading my post. Are you having the answer of my question? Till now no one is able to give answer, everybody just assuming something and answering. No answer is perfect that satisfy why it uses >>>. Except lan's

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread Decorater
Decorater added the comment: In that case why does pypi.python.org not let me change that bug track url option or set it anymore? -- ___ Python tracker

Re: Cleaning up conditionals

2016-12-30 Thread Cameron Simpson
On 30Dec2016 15:17, Deborah Swanson wrote: Ever consider using conjunctions? if len(l1[st]) and not len(l2[st]): #0 is considered a false -- no need to test for "==0" #non-0 is considered true -- no need to test for

Re: Cleaning up conditionals

2016-12-30 Thread MRAB
On 2016-12-31 00:48, Deborah Swanson wrote: On 30/12/16 23:00, Deborah Swanson wrote: > Oops, indentation was messed up when I copied it into the email. > Should be this: > >if len(l1[st]) == 0: > if len(l2[st]) > 0: > l1[st] = l2[st] >

Re: Cleaning up conditionals

2016-12-30 Thread Michael Torrie
On 12/30/2016 05:26 PM, Deborah Swanson wrote: > I'm still wondering if these 4 lines can be collapsed to one or two > lines. If the logic is clearly expressed in the if blocks that you have, I don't see why collapsing an if block into one or two lines would even be desirable. Making a clever

Re: learning and experimenting python.

2016-12-30 Thread Ethan Furman
On 12/30/2016 06:05 PM, Wildman via Python-list wrote: On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: Do not feed the troll. Please explain how what I said is trolling. Perhaps it was a little snide but I tend to get that way when trying to explain the obvious. I suspect Erik was

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 07:05 PM, Wildman via Python-list wrote: > On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: > >> On 30/12/16 23:34, einstein1...@gmail.com wrote: >>> You are also confusing me. >>> But there mustbe some reason. >>> What happens if your student questions you like this.? >>> And may

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 04:26 PM, einstein1...@gmail.com wrote: > That's not the answer. > If you don't have answer, please don't answer like this, because that will > confuse others also. I don't believe anyone will be confused. Clearly there's no answer that you understand, or one that would satisfy

Re: learning and experimenting python.

2016-12-30 Thread Michael Torrie
On 12/30/2016 06:46 PM, eryk sun wrote: > On Fri, Dec 30, 2016 at 7:49 PM, Michael Torrie wrote: >> >> Is there a special reason bourne shell uses $ and #? > > To me, "$" is for the [$]tandard shell prompt, and "#" noticeably > distinguishes root shells. Yes of course. You

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 23:39:43 +, Erik wrote: > On 30/12/16 23:34, einstein1...@gmail.com wrote: >> You are also confusing me. >> But there mustbe some reason. >> What happens if your student questions you like this.? >> And may be those who questions like this will surely be the developer of

Re: learning and experimenting python.

2016-12-30 Thread Wildman via Python-list
On Fri, 30 Dec 2016 15:34:16 -0800, einstein1410 wrote: > You are also confusing me. > But there mustbe some reason. > What happens if your student questions you like this.? I am not a teacher. > And may be those who questions like this will surely be the developer of its > successor

Re: learning and experimenting python.

2016-12-30 Thread eryk sun
On Fri, Dec 30, 2016 at 7:49 PM, Michael Torrie wrote: > > Is there a special reason bourne shell uses $ and #? To me, "$" is for the [$]tandard shell prompt, and "#" noticeably distinguishes root shells. > Coming from an old DOS background (>) I found that rather jarring at

[issue29105] code or doc improvement for logging.handlers.RotatingFileHandler

2016-12-30 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +vinay.sajip ___ Python tracker ___ ___

Re: Simulating int arithmetic with wrap-around

2016-12-30 Thread Serhiy Storchaka
On 31.12.16 02:30, Steve D'Aprano wrote: Are you saying that the best way of doing this is this? (1) convert signed Python ints to unsigned; (2) perform operation and bitmask; (3) convert unsigned back to signed. Here's an example. I want to multiply 7*3 using a signed 4-bit int, getting 5

[issue29098] document minimum sqlite version

2016-12-30 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 31/12/16 00:26, Deborah Swanson wrote: > > As Mr. Bieber points out, what I had above greatly benefits > from the > > use of conjunctions. It now reads: > > > > if not len(l1[st]) and len(l2[st]): > > IMHO, "if not len(l)" is a _terrible_ way of spelling "if > len(l) == 0" > (mentally, I

Re: learning and experimenting python.

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 05:51 am, BartC wrote: > In usenet posts >>> gets confused for quoted material 3 levels deep > (which on my newsreader is shown as coloured vertical bars on the left). Indeed, which is why my Python startup file contains this: # Change the main prompt. Consider using '≻≻≻

RE: Re: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 30/12/16 23:00, Deborah Swanson wrote: > > Oops, indentation was messed up when I copied it into the email. > > Should be this: > > > > if len(l1[st]) == 0: > > if len(l2[st]) > 0: > > l1[st] = l2[st] > > elif len(l2[st]) == 0: > >

Re: Cleaning up conditionals

2016-12-30 Thread Erik
On 31/12/16 00:26, Deborah Swanson wrote: As Mr. Bieber points out, what I had above greatly benefits from the use of conjunctions. It now reads: if not len(l1[st]) and len(l2[st]): IMHO, "if not len(l)" is a _terrible_ way of spelling "if len(l) == 0" (mentally, I have to read that as "if

Re: List comprehension

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 06:37 am, Jason Friedman wrote: > $ python > Python 3.6.0 (default, Dec 26 2016, 18:23:08) > [GCC 4.8.4] on linux > Type "help", "copyright", "credits" or "license" for more information. data = ( > ... (1,2), > ... (3,4), > ... ) [a for a in data] > [(1, 2), (3, 4)]

Re: Simulating int arithmetic with wrap-around

2016-12-30 Thread Steve D'Aprano
On Sat, 31 Dec 2016 02:14 am, Serhiy Storchaka wrote: > On 30.12.16 16:47, Steve D'Aprano wrote: >> Again, assume both operands are in range for an N-bit signed integer. >> What's a good way to efficiently, or at least not too inefficiently, do >> the calculations in Python? > > def

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On 31 December 2016 at 10:00, Deborah Swanson > wrote: > > > > Oops, indentation was messed up when I copied it into the email. > > The indentation of your latest message looks completely > broken now, you can see it here: >

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
But in his website, he recommended that post your questions here, he will answer it. But still as you told me I will send him an personal e-mail. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
And if this is unimportant, as you thought, then you must not be the part of this group. This group is to share knowledge, nott for deciding what is trivia and what's not. If you think it's it, simply leave it, any else will answer. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Im not feeding the troll. If you don't have answer to this, then there would be no question that you are the python developer. And if this is troll, leave it. But respect every question, they are the gift of God. And if there is no question, there will be no answer. And may the question is the

Re: learning and experimenting python.

2016-12-30 Thread Ian Kelly
On Dec 30, 2016 4:42 PM, wrote: Yes, I am not confusing you all, rather I thought that this is the best place to solve any doubts, soy only question for you is Why python uses >>> instead of >, or any other special characters? Do you know about this, if yes then please

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
No I have a question not answer, but if I got the answer then I will tell you. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: Adding Georg, who is listed as an expert for the traceback module (https://docs.python.org/devguide/experts.html). -- nosy: +georg.brandl ___ Python tracker

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Then again the question is same for ABC. Why >>>? -- https://mail.python.org/mailman/listinfo/python-list

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: For your convenience, here is a possible patch fixing these issues. It modifies the format_exception_only function in the traceback module to follow the behavior of the interpreter a little more closely for SyntaxError's. Feel free to use, in whole, in part,

Re: learning and experimenting python.

2016-12-30 Thread Erik
On 30/12/16 23:34, einstein1...@gmail.com wrote: You are also confusing me. But there mustbe some reason. What happens if your student questions you like this.? And may be those who questions like this will surely be the developer of its successor language. Because out of thousands, only one

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
Yes, I am not confusing you all, rather I thought that this is the best place to solve any doubts, soy only question for you is Why python uses >>> instead of >, or any other special characters? Do you know about this, if yes then please answer it. I will be so much thankful of you. --

[issue28612] str.translate needs a mapping example

2016-12-30 Thread Christopher Barker
Christopher Barker added the comment: This all came out of a thread on python-ideas, starting here: https://mail.python.org/pipermail/python-ideas/2016-October/043284.html the thread kind of petered out, but it seems there was a kinda-sorta consensus that we didn't need any new string methods,

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
You are also confusing me. But there mustbe some reason. What happens if your student questions you like this.? And may be those who questions like this will surely be the developer of its successor language. Because out of thousands, only one may asks this, whom you all will consider fool, but

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
I am not getting you. Please simplify it. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning and experimenting python.

2016-12-30 Thread einstein1410
That's not the answer. If you don't have answer, please don't answer like this, because that will confuse others also. -- https://mail.python.org/mailman/listinfo/python-list

[issue29102] Add an id field to PyInterpreterState.

2016-12-30 Thread Eric Snow
Eric Snow added the comment: Here's the updated patch. -- Added file: http://bugs.python.org/file46094/interpreter-id-2.diff ___ Python tracker ___

Re: Cleaning up conditionals

2016-12-30 Thread Erik
On 30/12/16 23:00, Deborah Swanson wrote: Oops, indentation was messed up when I copied it into the email. Should be this: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st] elif len(l2[st]) == 0: if

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
> On Fri, 30 Dec 2016 13:20:15 -0800, "Deborah Swanson" > declaimed the following: > > >I've already learned one neat trick to collapse a conditional: > > > > a = expression1 if condition else expression2 > > > >Here I have a real mess, in my opinion: > > > >

Re: Cleaning up conditionals

2016-12-30 Thread David
On 31 December 2016 at 10:00, Deborah Swanson wrote: > > Oops, indentation was messed up when I copied it into the email. The indentation of your latest message looks completely broken now, you can see it here:

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I did some more research: setuptools didn't have this keyword either. It was added to PyPI at some point and then probably got picked up by some package authors as new "optional" keyword argument for setup():

RE: Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
BartC wrote: > Sent: Friday, December 30, 2016 2:11 PM > > On 30/12/2016 21:20, Deborah Swanson wrote: > > I've already learned one neat trick to collapse a conditional: > > > > a = expression1 if condition else expression2 > > > > Here I have a real mess, in my opinion: > > > > if

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread Berker Peksag
Berker Peksag added the comment: Again, this is not a distutils bug and it has already been reported to the setuptools maintainers: https://github.com/pypa/setuptools/issues/29 Quoting from the original report: > Currently setuptools.dist.Distribution passes the unfiltered collection > of

[issue29102] Add an id field to PyInterpreterState.

2016-12-30 Thread Eric Snow
Eric Snow added the comment: > What do you think about resetting the counter back to 1 in Py_Initialize? Sounds good to me. When I was working on the patch I had the idea in the back of my mind that not resetting the counter would better support interpreter separation efforts in the future.

Re: List comprehension

2016-12-30 Thread Joel Goldstick
On Fri, Dec 30, 2016 at 2:58 PM, Joaquin Alzola wrote: > > >>Now, this puzzles me: > > [x,y for a in data] >> File "", line 1 >>[x,y for a in data] > > ^ >>SyntaxError: invalid syntax > >>I expected: >>[(1, 2), (3, 4)] > > You can try [(x,z) for x,z

Re: Cleaning up conditionals

2016-12-30 Thread BartC
On 30/12/2016 21:20, Deborah Swanson wrote: I've already learned one neat trick to collapse a conditional: a = expression1 if condition else expression2 Here I have a real mess, in my opinion: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st]

Cleaning up conditionals

2016-12-30 Thread Deborah Swanson
I've already learned one neat trick to collapse a conditional: a = expression1 if condition else expression2 Here I have a real mess, in my opinion: if len(l1[st]) == 0: if len(l2[st]) > 0: l1[st] = l2[st] elif len(l2[st]) == 0: if

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread Decorater
Decorater added the comment: Except for the setup function, yeah. https://github.com/pypa/setuptools/blob/master/setuptools/__init__.py#L112 -- ___ Python tracker

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2016-12-30 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Should that message be the one predominantly used for sequences, i.e: TypeError: can only concatenate class1 (not "class2") to class1 or should another one be used like "Unsupported operand type(s) for op: 'class1' and 'class2'? The first is

[issue29117] dir() should include dunder attributes of the unbound method

2016-12-30 Thread Antony Lee
New submission from Antony Lee: ``` Python 3.5.2 (default, Nov 7 2016, 11:31:36) [GCC 6.2.1 20160830] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class C: ... def f(self): pass ... >>> C.f.attr = 42 >>> print(dir(C.f)) ['__annotations__',

RE: List comprehension

2016-12-30 Thread Joaquin Alzola
>Now, this puzzles me: [x,y for a in data] > File "", line 1 >[x,y for a in data] > ^ >SyntaxError: invalid syntax >I expected: >[(1, 2), (3, 4)] You can try [(x,z) for x,z in data]. In your situation a takes the values (1,2) or (3,4) in the one that I put x and z take

Re: learning and experimenting python.

2016-12-30 Thread David Froger
Quoting einstein1...@gmail.com (2016-12-30 18:50:19) > Hello everyone, > I am the new comer and learner of python. > I have a doubt that when I type python and press enter it shows a prompt like > >>> > But why it is >>> ? > Is there any special reason? > Why it is not setted as @,& or any other

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread R. David Murray
R. David Murray added the comment: Except that setuptools monkey patches distutiles all over the place. So no, it isn't the same at all. -- nosy: +r.david.murray ___ Python tracker

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread Decorater
Decorater added the comment: So basically what from setuptools import setup is really doing is the same as doing from distutils.core import setup -- ___ Python tracker

Re: List comprehension

2016-12-30 Thread Joel Goldstick
On Fri, Dec 30, 2016 at 2:37 PM, Jason Friedman wrote: > $ python > Python 3.6.0 (default, Dec 26 2016, 18:23:08) > [GCC 4.8.4] on linux > Type "help", "copyright", "credits" or "license" for more information. data = ( > ... (1,2), > ... (3,4), > ... ) [a for a in

Re: learning and experimenting python.

2016-12-30 Thread Chris Angelico
On Sat, Dec 31, 2016 at 6:49 AM, Michael Torrie wrote: > Is there a special reason bourne shell uses $ and #? Coming from an old > DOS background (>) I found that rather jarring at first. There's no > particular reason for any of those shell prompts. You say "%" is for >

[issue29115] distutils.core.setup does not let people set 'bugtrack_url'.

2016-12-30 Thread Decorater
Decorater added the comment: The problem with setuptools on that is that they export their setup like so which uses the distutils setup by doing: setup = distutils.core.setup. That is how they are doing it. -- ___ Python tracker

[issue28612] str.translate needs a mapping example

2016-12-30 Thread Gaurav Tatke
Gaurav Tatke added the comment: Should a user be suggested to use str.translate() for the use case where user only wants to keep certain characters and strip off everything else? -- ___ Python tracker

[issue28612] str.translate needs a mapping example

2016-12-30 Thread Gaurav Tatke
Gaurav Tatke added the comment: Hi, Pardon my ignorance, I am new to this but have below queries/thoughts - 1. Why would we say that adding new keys during lookup phase is an unpleasant side-effect? From what I understood by docs, one of the main reasons to use defaultdicts is to be able to

[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2016-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Old error message is misleading. It implied that there are objects that can be converted to str implicitly. This was true in Python 2, but is false in Python 3. New error message conforms with TypeError messages produced by PyArg_Parse*(). It is the same

  1   2   >