[issue28253] the reply's additional "Re:"

2016-09-22 Thread lijp
New submission from lijp: hi I`m a python newer. when I use python3.4.3 to learn about package calendar,I found a problem, Could you help me to confirm it which is is a bug. Below is my env: -- os: win7 x86 python version:3.4.3 --

[issue28252] Tuples used before introduction to tuple in tutorial

2016-09-22 Thread Eswar Yaganti
New submission from Eswar Yaganti: In the python tutorial, the tuples were used in an example before the introduction to tuples in section 5.1.4 -- assignee: docs@python components: Documentation messages: 277243 nosy: Eswar Yaganti, docs@python priority: normal severity: normal

Re: Why does the insert after list function fail?

2016-09-22 Thread Jussi Piitulainen
38016226...@gmail.com writes: > A=["1","2","3"] > print(list(map(float,A)).insert(0,1)) > > I want to insert 1 at the head of the list but this gives me a surprise Is it the same surprise that you get from print([1,2,3].insert(0,1))? Or the more advanced surprise from print(A.insert(0,1))? --

Automated refactoring tools (was: How to import all things defined the files in a module directory in __init__.py?)

2016-09-22 Thread Ben Finney
Peng Yu writes: > Is there such a good automated tool for python refactoring? This sounds like a job for — Bicycle Repair Man! Watch him extract jumbled code into well ordered classes. Gasp, as he renames all occurrences of a method. Thank You Bicycle Repair

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-22 Thread Peng Yu
On Thu, Sep 22, 2016 at 8:35 PM, Ben Finney wrote: > Peng Yu writes: > >> On Wed, Sep 21, 2016 at 11:14 PM, Ben Finney >> wrote: >> > [Importing ‘*’ from a module] will also make the names in the code >> > impossible

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-22 Thread Ben Finney
Peng Yu writes: > On Wed, Sep 21, 2016 at 11:14 PM, Ben Finney > wrote: > > [Importing ‘*’ from a module] will also make the names in the code > > impossible to automatically match against where they came from. > > Explicit is better than

Re: strings and ints consistency - isinstance

2016-09-22 Thread Steve D'Aprano
On Thu, 22 Sep 2016 11:40 pm, Sayth Renshaw wrote: > True it failed, just actually happy to get it to fail or pass successfully > on int input. But it doesn't. It raises ValueError no matter what you enter. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure

[issue28251] Help manuals do not appear in Windows search

2016-09-22 Thread Steve Dower
Steve Dower added the comment: Fixed both the installation link and the bad javascript in the chm files. I also changed the changelog link to an internal link for the latest version and external for older versions (otherwise we were going to the web version which has JS that the HTML Help

[issue28251] Help manuals do not appear in Windows search

2016-09-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 45ba976b7064 by Steve Dower in branch '3.5': Issue #28251: Improvements to help manuals on Windows. https://hg.python.org/cpython/rev/45ba976b7064 New changeset e703c3a390f7 by Steve Dower in branch '3.6': Issue #28251: Improvements to help manuals

[issue28251] Help manuals do not appear in Windows search

2016-09-22 Thread Steve Dower
New submission from Steve Dower: On Windows 10, you can't search in the start menu for the HTML Help manuals. This annoys me so much I'm going to figure out a way fix it :) -- assignee: steve.dower components: Windows messages: 277240 nosy: paul.moore, steve.dower, tim.golden,

[issue27213] Rework CALL_FUNCTION* opcodes

2016-09-22 Thread STINNER Victor
STINNER Victor added the comment: > I think that's all with this issue. Thanks Demur and Serhiy for your great work! -- ___ Python tracker ___

[issue28243] Performance regression in functools.partial()

2016-09-22 Thread STINNER Victor
STINNER Victor added the comment: > Python 3.5: Median +- std dev: 423 ns +- 9 ns > Python 3.7: Median +- std dev: 427 ns +- 13 ns 0.9% slower on a microbenchmark is not really what I would call significant :-) But there is an underlying issue: when PGO+LTO is not used, Python 3.7 (and

[issue28243] Performance regression in functools.partial()

2016-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With using all optimizations enabled the difference is much smaller if not disappeared. Python 3.5: Median +- std dev: 423 ns +- 9 ns Python 3.7: Median +- std dev: 427 ns +- 13 ns -- ___ Python tracker

Re: strings and ints consistency - isinstance

2016-09-22 Thread Larry Hudson via Python-list
On 09/22/2016 06:40 AM, Sayth Renshaw wrote: [snip...] True it failed, just actually happy to get it to fail or pass successfully on int input. Just felt it was a clearer and more consistent approach to verifying input, then most of the varied and rather inconsistent approaches I have seen

Re: Why does the insert after list function fail?

2016-09-22 Thread Wildman via Python-list
On Thu, 22 Sep 2016 12:29:12 -0700, 380162267qq wrote: > A=["1","2","3"] > print(list(map(float,A)).insert(0,1)) > > I want to insert 1 at the head of the list but this gives me a surprise I am not certain about what you are doing so I might be way off here. The following will insert 1 at the

[issue28250] typing.NamedTuple instances are not picklable Two

2016-09-22 Thread Kurt Dally
New submission from Kurt Dally: Creating a namedtuple and an instance of the namedtuple in a function then returning the instance to the global namespace made the instance unpickleable, as in Issue25665. -- components: Library (Lib) messages: 277236 nosy: Kurt priority: normal

Re: Why does the insert after list function fail?

2016-09-22 Thread John Gordon
In <39ec91a8-eeae-489f-9237-9d9a481a8...@googlegroups.com> 38016226...@gmail.com writes: > A=["1","2","3"] > print(list(map(float,A)).insert(0,1)) > I want to insert 1 at the head of the list but this gives me a surprise insert() does not return anything; it modifies the existing list

Why does the insert after list function fail?

2016-09-22 Thread 380162267qq
A=["1","2","3"] print(list(map(float,A)).insert(0,1)) I want to insert 1 at the head of the list but this gives me a surprise -- https://mail.python.org/mailman/listinfo/python-list

Re: Another å, ä, ö question

2016-09-22 Thread Martin Schöön
Den 2016-09-22 skrev Peter Otten <__pete...@web.de>: > Martin Schöön wrote: >> >> I am not sure I answer your questions since I am not quite sure I >> understand it but here goes: The complete file is UTF-8 encoded as >> that is how Geany is set up to create new files (I just checked). > > When

Re: I am newbie who can explain this code to me?

2016-09-22 Thread 380162267qq
在 2016年9月20日星期二 UTC-4下午3:11:27,Terry Reedy写道: > On 9/20/2016 9:12 AM, Peter Otten wrote: > > >> 在 2016年9月20日星期二 UTC-4上午8:17:13,BartC写道: > >>> On 20/09/2016 13:12, 38016226...@gmail.com wrote: > >>> d = {} > >>> keys = range(256) > >>> vals = map(chr, keys) > >>>

Re: automated comparison tool

2016-09-22 Thread Andrew Clark
On Wednesday, September 21, 2016 at 8:26:37 PM UTC-5, Steve D'Aprano wrote: > On Thu, 22 Sep 2016 01:55 am, Andrew Clark wrote: > > > I reinstalled paramiko and now i'm getting a slighty different error but > > still says no cryptography. > > [...] > > > ImportError: No module named

[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-09-22 Thread Christian Heimes
Christian Heimes added the comment: Larry, the issue has nothing to do with the TLS/SSL library or implementation. It's about cipher suite selection. All (!) SSL libraries are affected because they had 3DES enabled as legacy fallback. Fun fact: OpenSSL latest security fix has addressed the

[issue28248] Upgrade installers to OpenSSL 1.0.2i

2016-09-22 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +benjamin.peterson, larry priority: normal -> release blocker stage: -> needs patch type: -> security ___ Python tracker

[issue28248] Upgrade installers to OpenSSL 1.0.2i

2016-09-22 Thread Christian Heimes
Christian Heimes added the comment: 1.0.2i passes all tests of 2.7, 3.5-7 on Linux -- assignee: christian.heimes -> components: +Macintosh, Windows ___ Python tracker

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-09-22 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue22848] Subparser help does not respect SUPPRESS argument

2016-09-22 Thread Drake Bridgewater
Changes by Drake Bridgewater : -- nosy: +Drake Bridgewater ___ Python tracker ___

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-09-22 Thread Cherniavsky Beni
Changes by Cherniavsky Beni : -- nosy: +cben ___ Python tracker ___ ___ Python-bugs-list

RE: Any ReST aware editors?

2016-09-22 Thread Gerald Britton
> > I have editors which will use syntax highlighting on .rst files, but I'm > hoping for something a bit smarter. What I'd like is an editor with a > split window, one side showing the rst > that I can edit, the other side showing the formatted text updated as I > type. (Or at least, updated

[issue27213] Rework CALL_FUNCTION* opcodes

2016-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that's all with this issue. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue28086] test.test_getargs2.TupleSubclass test failure

2016-09-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5324906ae307 by Serhiy Storchaka in branch '3.6': Issue #28086: Single var-positional argument of tuple subtype was passed https://hg.python.org/cpython/rev/5324906ae307 New changeset 858afd17e3ee by Serhiy Storchaka in branch 'default': Issue

[issue28086] test.test_getargs2.TupleSubclass test failure

2016-09-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Hidding Character as you type

2016-09-22 Thread MRAB
On 2016-09-22 17:16, Andrew Clark wrote: I'm looking for a way to either completely hide character as you type in command line or add * to each character as you for simple password obscurity. I've tried getpass.getpass() however the characters still show up on the screen as you type it.

Re: Hidding Character as you type

2016-09-22 Thread Chris Angelico
On Fri, Sep 23, 2016 at 2:16 AM, Andrew Clark wrote: > I'm looking for a way to either completely hide character as you type in > command line or add * to each character as you for simple password > obscurity. I've tried getpass.getpass() however the characters still

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-22 Thread Chris Angelico
On Fri, Sep 23, 2016 at 1:50 AM, Peng Yu wrote: > > This will make refactoring easy. If everything is explicit, when one > do refactoring, at two places need to be changed which can be a > burden. So you want it to be easy to move stuff around between files in a package?

Hidding Character as you type

2016-09-22 Thread Andrew Clark
I'm looking for a way to either completely hide character as you type in command line or add * to each character as you for simple password obscurity. I've tried getpass.getpass() however the characters still show up on the screen as you type it. Can anyone help? I'm using python 2.7 on

Re: h(re) for help, import re - on NameError

2016-09-22 Thread Chris Angelico
On Thu, Sep 22, 2016 at 8:10 PM, Veek M wrote: > Is there a way to use .pythonrc.py to provide a help function that > autoloads whatever module name is passed like so: > \>>> h(re) > > I tried inheriting site._Helper and overriding __init__ and __call__ but > that didn't

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Eryk Sun
Eryk Sun added the comment: Specifically, while CreateProcess does execute batch scripts via the %ComSpec% interpreter, the only extension it infers is ".exe". To run a ".cmd" or ".bat" file, you have to use the full name with the extension. -- nosy: +eryksun

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread eryk sun
On Thu, Sep 22, 2016 at 3:21 PM, Random832 wrote: > On Thu, Sep 22, 2016, at 09:45, eryk sun wrote: > >> Yes, FileIO.readall continues making read() system calls until it sees >> an empty read. But if we know we're reading from a terminal, we should >> be able to assume

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-22 Thread Peng Yu
On Wed, Sep 21, 2016 at 11:14 PM, Ben Finney wrote: > Peng Yu writes: > >> I want to import all the thing (or the ones available in the >> respective __all__) defined in each of the file by putting the >> following lines in __init__.py >> >> from

Re: Any ReST aware editors?

2016-09-22 Thread Manolo Martínez
On 09/23/16 at 01:20am, Chris Angelico wrote: > If I were doing this, I'd simply have a script that watches the .rst > file and rebuilds a corresponding output file, which can then be shown > in another window, completely separate to the editor. [when-changed]://github.com/joh/when-changed) is a

Re: Obtain the raw line of text read by CSVDictReader when reporting errors?

2016-09-22 Thread Chris Angelico
On Thu, Sep 22, 2016 at 8:36 PM, Malcolm Greene wrote: > Oscar/MRAB, > >> You could put something between the file and the reader ... > > Thank you both for your suggestions ... brilliant! You guys helped me > solve my problem and gave me an excellent strategy for future

Re: Another å, ä, ö question

2016-09-22 Thread Chris Angelico
On Thu, Sep 22, 2016 at 10:27 PM, Peter Otten <__pete...@web.de> wrote: > When the encoding used for the file and the encoding used by the terminal > differ the output of non-ascii characters gets messed up. Example script: > > # -*- coding: iso-8859-15 -*- > > print "first unicode:" > print

[issue28249] doctest.DocTestFinder reports incorrect line numbers with exclude_empty=False

2016-09-22 Thread Clément
New submission from Clément: Line numbers reported by the doctest module are wrong when a function does not include a docstring. With the attached example file, running python -c "import doctest, example; print(doctest.DocTestFinder(exclude_empty=False).find(example))" produces [,

Re: Data Types

2016-09-22 Thread Chris Angelico
On Thu, Sep 22, 2016 at 10:33 PM, BartC wrote: >>> print (10<20)=> True >>> print (type(10<20)) => >> >> >> 10<20 shouldn't be thought of as some alternative value which is a bool, >> any >> more than we should think of 1+1 as being a different value to 2. > > >

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Random832
On Thu, Sep 22, 2016, at 09:45, eryk sun wrote: > On Thu, Sep 22, 2016 at 12:40 PM, Gregory Ewing > wrote: > > eryk sun wrote: > >> > >> Actually in a Unix terminal the cursor can also be at > >> the end of a line, but a bug in Python requires pressing Ctrl+D twice >

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Paul Moore
Paul Moore added the comment: (1) It starts an extra process (unless you're running the application from cmd.exe) and (2) in some cases, the system won't recognise a cmd file as an executable. For a simple example, t.cmd: @echo Hello from t example.py: from subprocess import run run(["t")]

Re: Any ReST aware editors?

2016-09-22 Thread Chris Angelico
On Thu, Sep 22, 2016 at 9:13 PM, Steve D'Aprano wrote: > What I'd like is an editor with a split window, one side showing the rst > that I can edit, the other side showing the formatted text updated as I > type. (Or at least, updated every thirty seconds or so.) > If

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why not just change the extension to cmd and add the following line at the start? @python -x "%0" %* -- nosy: +serhiy.storchaka ___ Python tracker

[issue28086] test.test_getargs2.TupleSubclass test failure

2016-09-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The simplest way is just change PyTuple_Check to > PyTuple_CheckExact in ceval.c. +1 -- nosy: +rhettinger ___ Python tracker

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Veek M
eryk sun wrote: > On Thu, Sep 22, 2016 at 12:40 PM, Gregory Ewing > wrote: >> eryk sun wrote: >>> >>> Actually in a Unix terminal the cursor can also be at >>> the end of a line, but a bug in Python requires pressing Ctrl+D >>> twice in that case. >> >> I wouldn't

[issue28248] Upgrade installers to OpenSSL 1.0.2i

2016-09-22 Thread Alex Gaynor
New submission from Alex Gaynor: https://www.openssl.org/news/secadv/20160922.txt -- assignee: christian.heimes components: Library (Lib), SSL keywords: security_issue messages: 277226 nosy: alex, christian.heimes, dstufft, janssen, ned.deily, paul.moore, ronaldoussoren, steve.dower

[issue27374] Cygwin: Makefile does not install DLL import library

2016-09-22 Thread Erik Bray
Erik Bray added the comment: Masayuki--concerning your above comments, I think this is similar to, if not the same as #13756 -- ___ Python tracker ___

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Paul Moore
New submission from Paul Moore: The zipapp module allows users to bundle their application as a single file "executable". On Windows, the file is given a ".pyz" extension which is associated with the Python launcher. However, this approach is not always equivalent to a native executable (see

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread eryk sun
On Thu, Sep 22, 2016 at 12:40 PM, Gregory Ewing wrote: > eryk sun wrote: >> >> Actually in a Unix terminal the cursor can also be at >> the end of a line, but a bug in Python requires pressing Ctrl+D twice >> in that case. > > I wouldn't call that a bug, rather it's a

Re: strings and ints consistency - isinstance

2016-09-22 Thread Sayth Renshaw
> > This ends being the code I can use to get it to work, seems clear and > > pythonic, open to opinion on that :-) > > Neither clear, nor Pythonic. Sadly imo clearer than the many hack attempts on SO. > > > answer = input("\t >> ") > > Since input() returns a string in Python 3, this will

[issue28245] Embeddable Python does not use PYTHONPATH.

2016-09-22 Thread Steve Dower
Steve Dower added the comment: Correct, and if you look ahead to 3.6 then you'll see I've already changed how this works. There is now support for a python._pth file that contains exactly the paths you want in sys.path, as well as suppressing all other sources. -- resolution: -> not

[issue27950] Superfluous messages when running make

2016-09-22 Thread Martin Panter
Changes by Martin Panter : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue27950] Superfluous messages when running make

2016-09-22 Thread Martin Panter
Martin Panter added the comment: The version I committed has the space separating @ # -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27348] traceback (and threading) drops exception message

2016-09-22 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

Re: strings and ints consistency - isinstance

2016-09-22 Thread Gregory Ewing
On Wednesday, September 21, 2016 at 11:41:42 PM UTC-4, Sayth Renshaw wrote: answer = input("\t >> ") if isinstance(int(answer), int) is True: raise ValueError("Ints aren't valid input") You seem to be trying to check that the user hasn't entered an integer. But that's a backwards way of

Re: Any ReST aware editors?

2016-09-22 Thread José Abílio Matos
On Thursday, September 22, 2016 9:13:02 PM WEST Steve D'Aprano wrote: > I have editors which will use syntax highlighting on .rst files, but I'm > hoping for something a bit smarter. > > What I'd like is an editor with a split window, one side showing the rst > that I can edit, the other side

Re: Any ReST aware editors?

2016-09-22 Thread Marko Rauhamaa
Steve D'Aprano : > What I'd like is an editor with a split window, one side showing the > rst that I can edit, the other side showing the formatted text updated > as I type. (Or at least, updated every thirty seconds or so.) > > Anybody know anything like that? Open a

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Gregory Ewing
eryk sun wrote: Actually in a Unix terminal the cursor can also be at the end of a line, but a bug in Python requires pressing Ctrl+D twice in that case. I wouldn't call that a bug, rather it's a consequence of what Ctrl-D does. It doesn't really mean EOF, it means to send whatever the

Re: Data Types

2016-09-22 Thread BartC
On 22/09/2016 02:40, Steve D'Aprano wrote: On Wed, 21 Sep 2016 10:25 pm, BartC wrote: On 21/09/2016 05:03, Cai Gengyang wrote: Are there any other data types that will give you type(A) or type(B) = besides True and False? No types but any variable or expression containing True or False

Re: Another å, ä, ö question

2016-09-22 Thread Peter Otten
Martin Schöön wrote: > Den 2016-09-20 skrev Peter Otten <__pete...@web.de>: >> Martin Schöön wrote: >> >>> Den 2016-09-19 skrev Christian Gollwitzer : Am 19.09.16 um 22:21 schrieb Martin Schöön: > I am studying some of these tutorials: >

Re: Any ReST aware editors?

2016-09-22 Thread Jon Ribbens
On 2016-09-22, Yann Kaiser wrote: > On Thu, Sep 22, 2016, 12:59 Jon Ribbens wrote: >> On 2016-09-22, Steve D'Aprano wrote: >> > I have editors which will use syntax highlighting on .rst files, but I'm >> > hoping for

Re: Any ReST aware editors?

2016-09-22 Thread Yann Kaiser
Does that work with with ReST? On Thu, Sep 22, 2016, 12:59 Jon Ribbens wrote: > On 2016-09-22, Steve D'Aprano wrote: > > I have editors which will use syntax highlighting on .rst files, but I'm > > hoping for something a bit smarter. > > >

Re: Any ReST aware editors?

2016-09-22 Thread Jon Ribbens
On 2016-09-22, Steve D'Aprano wrote: > I have editors which will use syntax highlighting on .rst files, but I'm > hoping for something a bit smarter. > > What I'd like is an editor with a split window, one side showing the rst > that I can edit, the other side showing

Re: Any ReST aware editors?

2016-09-22 Thread jkn
Hi Steve On Thursday, September 22, 2016 at 12:13:16 PM UTC+1, Steve D'Aprano wrote: > I have editors which will use syntax highlighting on .rst files, but I'm > hoping for something a bit smarter. > > What I'd like is an editor with a split window, one side showing the rst > that I can edit,

[issue28243] Performance regression in functools.partial()

2016-09-22 Thread STINNER Victor
STINNER Victor added the comment: "If revert c1a698edfa1b, the performance is returned to the level of 3.5." Oh, so using "fastcall" makes partial_call() slower? That's really something bad :-/ It would be nice if you can confirm using all optimizations enabled (PGO+LTO): ./configure

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-09-22 Thread STINNER Victor
STINNER Victor added the comment: You should try https://github.com/python/performance to get reliable benchmark results ;-) -- ___ Python tracker ___

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread py.user
py.user added the comment: Serhiy Storchaka wrote: > I believe that in particular you can mix Python and > C implementations of Element and lxml.etree elements in one tree. The xml.etree.ElementTree.ElementTree() can accept lxml.etree.Element() as a node, but node in node is impossible. >>>

Any ReST aware editors?

2016-09-22 Thread Steve D'Aprano
I have editors which will use syntax highlighting on .rst files, but I'm hoping for something a bit smarter. What I'd like is an editor with a split window, one side showing the rst that I can edit, the other side showing the formatted text updated as I type. (Or at least, updated every thirty

[issue28205] Add optional suffix to str.join

2016-09-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Looking again at the comments for the other respondents, I think this > should just be closed. It doesn't make sense to disturb a long > standing API or the break the join/split symmetry. For what it's worth, in hindsight I agree. I'm a little embarassed

Re: Data Types

2016-09-22 Thread Steve D'Aprano
On Thu, 22 Sep 2016 01:46 pm, Sayth Renshaw wrote: > What about 0 or 1 they are true and false like no other numbers? what > category do they fall in with regards to booleans? 0 and 1 are ints: py> type(0) py> type(1) just like 2, 3, 4, -1, -999, 1098765432 etc. But just like 1 == 1.0 (a

Re: strings and ints consistency - isinstance

2016-09-22 Thread Steve D'Aprano
On Thu, 22 Sep 2016 01:41 pm, Sayth Renshaw wrote: > This ends being the code I can use to get it to work, seems clear and > pythonic, open to opinion on that :-) Neither clear, nor Pythonic. > answer = input("\t >> ") Since input() returns a string in Python 3, this will always be a string.

[issue27348] traceback (and threading) drops exception message

2016-09-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5859a9e8b214 by Martin Panter in branch '3.5': Issue #27348: Restore “Exception: None” formatting in traceback module https://hg.python.org/cpython/rev/5859a9e8b214 New changeset d1455d14accd by Martin Panter in branch '3.6': Issue #27348: Merge

[issue27950] Superfluous messages when running make

2016-09-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6911917f1f02 by Martin Panter in branch 'default': Issue #27950: Silence long makefile commands and comments https://hg.python.org/cpython/rev/6911917f1f02 -- nosy: +python-dev ___ Python tracker

Re: Obtain the raw line of text read by CSVDictReader when reporting errors?

2016-09-22 Thread Malcolm Greene
Oscar/MRAB, > You could put something between the file and the reader ... Thank you both for your suggestions ... brilliant! You guys helped me solve my problem and gave me an excellent strategy for future scenarios. Malcolm -- https://mail.python.org/mailman/listinfo/python-list

[issue28246] Unable to read simple text file

2016-09-22 Thread Eryk Sun
Eryk Sun added the comment: Codepage 1251 is a single-byte encoding and a superset of ASCII (i.e. ordinals 0-127). UTF-8 is also a superset of ASCII, so there's no problem as long as the encoded text is strictly ASCII. But decoding non-ASCII UTF-8 as codepage 1251 produces nonsense, otherwise

[issue17188] Document 'from None' in raise statement doc.

2016-09-22 Thread Robert Collins
Changes by Robert Collins : -- nosy: +rbcollins ___ Python tracker ___ ___

Re: strings and ints consistency - isinstance

2016-09-22 Thread Ned Batchelder
On Wednesday, September 21, 2016 at 11:41:42 PM UTC-4, Sayth Renshaw wrote: > This ends being the code I can use to get it to work, seems clear and > pythonic, open to opinion on that :-) > > > answer = input("\t >> ") > if isinstance(int(answer), int) is True: > raise ValueError("Ints

[issue28246] Unable to read simple text file

2016-09-22 Thread AndreyTomsk
AndreyTomsk added the comment: Thanks for quick reply. I'm new to python, just used tutorial docs and didn't read carefully enough to notice encoding info. Still, IMHO behaviour not consistent. In three sequential symbols in russian alphabet - З, И, К, it crashes on И, and displays other in

h(re) for help, import re - on NameError

2016-09-22 Thread Veek M
Is there a way to use .pythonrc.py to provide a help function that autoloads whatever module name is passed like so: \>>> h(re) I tried inheriting site._Helper and overriding __init__ and __call__ but that didn't work, also I don't know how to deal/trap/catch the NameError (no quotes on h(re))

[issue28086] test.test_getargs2.TupleSubclass test failure

2016-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The simplest way is just change PyTuple_Check to PyTuple_CheckExact in ceval.c. Maybe this is suboptimal for tuple subclasses (namedtuple?), but I think this is very rare case. -- keywords: +patch stage: needs patch -> patch review versions: +Python

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Veek M
Ben Finney wrote: > Veek M writes: > >> Ben Finney wrote: >> >> > Since you are writing code into a module file, why not just run the >> > module from that file with the non-interactive Python interpreter? >> > >> It's part of a hexchat plugin/addon.. > > Which tells me

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Veek M
eryk sun wrote: > On Thu, Sep 22, 2016 at 5:12 AM, Veek M wrote: >> 2. Blank lines in my code within the editor are perfectly acceptable >> for readability but they act as a block termination on cmd line. > > You can write a simple paste() function. For example: > >

OT-Requirement-Python Developer

2016-09-22 Thread Shimpy Sandhu
Hi folks I am looking for python developer for Ludhiana location. If anyone is interested, please share updated CV at shi...@revinfotech.com Regards Shimpy Sandhu -- https://mail.python.org/mailman/listinfo/python-list

[issue27815] Make SSL suppress_ragged_eofs default more secure

2016-09-22 Thread Martin Panter
Martin Panter added the comment: I have been experimenting with a patch that changes the default to suppress_ragged_eofs=False. One disadvantage of this change is it could make servers less robust. E.g. in the tests, I explicitly enabled suppress_ragged_eofs=True in a server, because

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The built-in ElementTree package is derived from lxml.etree. I suppose that the documentation is inherited from lxml.etree. The built-in ElementTree package supports duck typing. The element object is not always an instance of the Element class. iselement()

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-22 Thread Jack Liu
Changes by Jack Liu : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list

Re: Where is import defined in the source code?

2016-09-22 Thread Lawrence D’Oliveiro
On Thursday, September 22, 2016 at 4:14:16 PM UTC+12, Peng Yu wrote: > > ... I want know where import is defined in the source code. This looks like the code, and this

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Lawrence D’Oliveiro
On Thursday, September 22, 2016 at 5:12:13 PM UTC+12, Veek M wrote: > How do i deal with this - what's the best way to achieve what I'm trying > to do. If you want a scratchpad for trying out Python code, I can recommend Jupyter/IPython . --

[issue28246] Unable to read simple text file

2016-09-22 Thread SilentGhost
SilentGhost added the comment: It would be good to add a FAQ / HowTo entry for this question. -- nosy: +SilentGhost ___ Python tracker ___

Re: strings and ints consistency - isinstance

2016-09-22 Thread Lawrence D’Oliveiro
On Thursday, September 22, 2016 at 3:41:42 PM UTC+12, Sayth Renshaw wrote: > if isinstance(int(answer), int) is True: Not sure what the point of this is... -- https://mail.python.org/mailman/listinfo/python-list

Re: Data Types

2016-09-22 Thread Lawrence D’Oliveiro
On Thursday, September 22, 2016 at 3:47:27 PM UTC+12, Sayth Renshaw wrote: > What about 0 or 1 they are true and false like no other numbers? >>> isinstance(1, bool) False >>> isinstance(True, int) True -- https://mail.python.org/mailman/listinfo/python-list

[issue28235] In xml.etree.ElementTree docs there is no parser argument in fromstring()

2016-09-22 Thread Martin Panter
Martin Panter added the comment: Added review comment -- nosy: +martin.panter ___ Python tracker ___ ___

Re: Pasting code into the cmdline interpreter

2016-09-22 Thread Steven D'Aprano
On Thursday 22 September 2016 17:42, eryk sun wrote: > On Thu, Sep 22, 2016 at 5:12 AM, Veek M wrote: >> 2. Blank lines in my code within the editor are perfectly acceptable for >> readability but they act as a block termination on cmd line. > > You can write a simple

[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread Martin Panter
Martin Panter added the comment: Serhiy, what’s the relevance? In the built-in Element Tree package, it is a class: . -- ___ Python tracker

  1   2   >