[issue13322] buffered read() and write() does not raise BlockingIOError

2016-10-16 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: -petri.lehtinen ___ Python tracker ___ ___

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-16 Thread Martin Panter
Martin Panter added the comment: So is your “automatic closing” due to your program, or a bug in Python? You will have to give more information if you want anyone else to look at this. When I run the code you posted (with various modules imported) all I get is NameError: name 'yellow_page' is

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-16 Thread Georgey
Georgey added the comment: Yes that is definitely a closed socket. But it is strange that in a single thread server without select module, the socket is never closed until I explicitly use close() method. except: print(sock) #<- here it looks normal time.sleep(3)

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: @Berker: the warning under "-bb" is a separate issue related to the handling of wildcard imports (_handle_fromlist searches for '*' and then pops it from a copy of the input list, replacing it with __all__ if that's defined) @Ben: As a general principle, we

[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread Berker Peksag
Berker Peksag added the comment: Thanks! I removed the import statement and simplified the last sentence a bit. -- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.4

[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4f8f7403881f by Berker Peksag in branch '3.5': Issue #28455: Clarify example of overriding the convert_arg_line_to_args method https://hg.python.org/cpython/rev/4f8f7403881f New changeset 0b29adb5c804 by Berker Peksag in branch '3.6': Issue #28455:

Re: Build desktop application using django

2016-10-16 Thread Mario R. Osorio
On Sunday, October 16, 2016 at 1:42:23 PM UTC-4, Ayush Saluja wrote: > Hello I want to build a desktop application which retrieves data from server > and stores data on server. I have basic experience of python and I dont know > how to build that thing. I agree with Martin's suspicion on you

[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hello, I updated the documentation with an example of how to override ArgumentParser class. Hope this is a clearer than before. Please review. Thanks :) -- keywords: +patch nosy: +Mariatta Added file:

[issue28452] Remove _asyncio._init_module function

2016-10-16 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file45122/asyncio-speedup-refactoring2.patch ___ Python tracker ___

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Matthew Barnett
Matthew Barnett added the comment: I'd prefer an explicit suppression to changing a long-standing behaviour. -- ___ Python tracker ___

Re: Term frequency using scikit-learn's CountVectorizer

2016-10-16 Thread MRAB
On 2016-10-17 02:04, Abdul Abdul wrote: I have the following code snippet where I'm trying to list the term frequencies, where first_text and second_text are .tex documents: from sklearn.feature_extraction.text import CountVectorizer training_documents = (first_text, second_text) vectorizer =

Term frequency using scikit-learn's CountVectorizer

2016-10-16 Thread Abdul Abdul
Hello, I have the following code snippet where I'm trying to list the term frequencies, where first_textand second_text are .tex documents: from sklearn.feature_extraction.text import CountVectorizer training_documents = (first_text, second_text) vectorizer = CountVectorizer()

Term frequency using scikit-learn's CountVectorizer

2016-10-16 Thread Abdul Abdul
I have the following code snippet where I'm trying to list the term frequencies, where first_text and second_text are .tex documents: from sklearn.feature_extraction.text import CountVectorizer training_documents = (first_text, second_text) vectorizer = CountVectorizer()

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Ned Deily
Ned Deily added the comment: How do others feel about Serhiy's proposal for eventually changing the semantics of groupdict() to mean only return matched groups? If that seems reasonable, then there is the separate question of how to make the transition. Adding a somewhat unpredictable

[issue28457] Make public the current private known hash functions in the C-API

2016-10-16 Thread Raymond Hettinger
New submission from Raymond Hettinger: The known-hash variants for dict getitem/setitem/delitem have proven useful to us for writing fast C code. They may be useful to others as well. There does not seem to be any other way of getting to this functionality. -- components:

[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread Ned Deily
Ned Deily added the comment: This is a duplicate of Issue28087. -- ___ Python tracker ___ ___

[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread Ned Deily
Changes by Ned Deily : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> macOS 12 poll syscall returns prematurely ___ Python tracker

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Ben Finney
Ben Finney added the comment: On 16-Oct-2016, Roundup Robot wrote: > New changeset 7dd0910e8fbf by Berker Peksag in branch '2.7': > Issue #21720: Improve exception message when the type of fromlist is unicode > https://hg.python.org/cpython/rev/7dd0910e8fbf This is an improvement, but it still

[issue28293] Don't completely dump the regex cache when full

2016-10-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> serhiy.storchaka ___ Python tracker ___

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the reviews! I pushed the patch for 2.7. Nick, what do you think about the case Serhiy mentioned in msg278515? Should we fix it or is issue21720_python3.diff good to go? -- ___ Python tracker

py.test/tox InvocationError

2016-10-16 Thread D.M. Procida
When I run: py.test --cov=akestra_utilities --cov=akestra_image_plugin --cov=chaining --cov=contacts_and_people --cov=housekeeping --cov=links --cov=news_and_events --cov=vacancies_and_studentships --cov=video --cov-report=term-missing example tests it works quite happily. When I run tox -e

[issue28454] Spurious arguments to PyErr_Format in unicodeobject.c

2016-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset cbe313cd1b55 by Benjamin Peterson in branch '3.5': remove extra PyErr_Format arguments (closes #28454) https://hg.python.org/cpython/rev/cbe313cd1b55 New changeset 738579b25d02 by Benjamin Peterson in branch '3.6': merge 3.5 (#28454)

[issue23532] add example of 'first match wins' to regex "|" documentation?

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions type: behavior -> enhancement versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue26656] Documentation for re.compile is a bit outdated

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett type: behavior -> enhancement versions: +Python 3.6, Python 3.7 ___ Python tracker

[issue26436] Add the regex-dna benchmark

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker ___

[issue28293] Don't completely dump the regex cache when full

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker ___

[issue21720] "TypeError: Item in ``from list'' not a string" message

2016-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7dd0910e8fbf by Berker Peksag in branch '2.7': Issue #21720: Improve exception message when the type of fromlist is unicode https://hg.python.org/cpython/rev/7dd0910e8fbf -- nosy: +python-dev ___ Python

[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread STINNER Victor
STINNER Victor added the comment: Try to modify pyconfig.h to define HAVE_BROKEN_POLL. It should work around the bug. configure.ac contains a test for HAVE_BROKEN_POLL. We need another test for poll() being broken differently. Note: asyncio doesn't seem to be affect because it probably uses

[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread STINNER Victor
STINNER Victor added the comment: See https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/ C function poll() seems to be broken on Sierra. -- nosy: +haypo, lukasz.langa, ned.deily, ronaldoussoren ___ Python tracker

[issue28456] Test failures under macOS 10.12 Sierra

2016-10-16 Thread Raymond Hettinger
New submission from Raymond Hettinger: On a fresh checkout, I'm getting two test failures: $ ./configure && make $ ./python.exe -m test.regrtest -v test_asyncore [snip] == FAIL: test_handle_expt

[issue28432] Fix doc of PyUnicode_EncodeLocale

2016-10-16 Thread Berker Peksag
Berker Peksag added the comment: Thanks. -- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior ___ Python tracker

[issue28432] Fix doc of PyUnicode_EncodeLocale

2016-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset a4889719e3c2 by Berker Peksag in branch '3.5': Issue #28432: Fix first parameter name in PyUnicode_EncodeLocale documentation https://hg.python.org/cpython/rev/a4889719e3c2 New changeset 1fc08c283f8f by Berker Peksag in branch '3.6': Issue #28432:

Re: Writing library documentation?

2016-10-16 Thread Irmen de Jong
On 16-10-2016 19:41, tshep...@rcsreg.com wrote: > Is there a standard or best way to write documentation for > a particular python library? I'd mostly target HTML, I guess. > > Thanks! > > > Tobiah > I guess most people use Sphinx for this task http://www.sphinx-doc.org/ You can use various

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes groupdict() without argument emitting FutureWarning if the result includes unmatched groups. Maybe warning message and the documentation could be better. Ned, I ask your permission for including this change in 3.6. Yes, it can break

Re: How make the judge with for loop?

2016-10-16 Thread alister
On Sat, 15 Oct 2016 22:23:29 -0700, 380162267qq wrote: > c="abcdefghijk" > len=len(c) > n is a int sb=[[] for i in range(n)] > > while (i < len) { > for (int j = 0; j < n && i < len; j++) > sb[j].append(c[i++]); > for (int j = n-2; j >= 1 && i < len; j--) // >

Re: Help me!, I would like to find split where the split sums are close to each other?

2016-10-16 Thread Michael Torrie
On 10/16/2016 05:25 AM, k.adema...@gmail.com wrote: > Help me!, I would like to find split where the split sums are close > to each other? > > I have a list is > > test = [10,20,30,40,50,60,70,80,90,100] > > ​and I would like to find split where the split sums are close to > each other by

Re: Build desktop application using django

2016-10-16 Thread Michael Torrie
On 10/16/2016 11:38 AM, ayuchitsalu...@gmail.com wrote: > Hello I want to build a desktop application which retrieves data from > server and stores data on server. I have basic experience of python > and I dont know how to build that thing. Crystal balls are always risky things to turn to when

[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Needed new tests for changed behavior. Test re.sub() with incorrect groups and the string that doesn't match the pattern (e.g. empty string). Added other comments on Rietveld. -- ___ Python tracker

[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread R. David Murray
R. David Murray added the comment: The documentation assumes you know how python class methods work, but I agree that the wording is not entirely obvious even then and could be improved. In particular it should make clear that the example shows how to define the function for subclassing or

Re: How to pick out the same titles.

2016-10-16 Thread duncan smith
On 16/10/16 16:16, Seymore4Head wrote: > How to pick out the same titles. > > I have a long text file that has movie titles in it and I would like > to find dupes. > > The thing is that sometimes I have one called "The Killing Fields" and > it also could be listed as "Killing Fields" Sometimes

Writing library documentation?

2016-10-16 Thread tshepard
Is there a standard or best way to write documentation for a particular python library? I'd mostly target HTML, I guess. Thanks! Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Build desktop application using django

2016-10-16 Thread ayuchitsaluja8
Hello I want to build a desktop application which retrieves data from server and stores data on server. I have basic experience of python and I dont know how to build that thing. -- https://mail.python.org/mailman/listinfo/python-list

[issue27896] Allow passing sphinx options to Doc/Makefile

2016-10-16 Thread STINNER Victor
STINNER Victor added the comment: I pushed your patch to the default branch (Python 3.7). Thanks Julien. -- nosy: +haypo resolution: -> fixed status: open -> closed type: -> enhancement versions: +Python 3.7 -Python 3.6 ___ Python tracker

[issue28449] tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to open compressed tars?

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch fixes the issue. Existing test was passed by accident -- compressed tarfiles were too short for false detecting. -- keywords: +patch nosy: +serhiy.storchaka stage: -> patch review Added file:

[issue27896] Allow passing sphinx options to Doc/Makefile

2016-10-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3884a7e3df1c by Victor Stinner in branch 'default': Issue #27896: Allow passing sphinx options to Doc/Makefile https://hg.python.org/cpython/rev/3884a7e3df1c -- nosy: +python-dev ___ Python tracker

[issue28439] Remove redundant checks in PyUnicode_EncodeLocale and PyUnicode_DecodeLocaleAndSize

2016-10-16 Thread Xiang Zhang
Changes by Xiang Zhang : -- title: Remove redundant checks in PyUnicode_EncodeLocale -> Remove redundant checks in PyUnicode_EncodeLocale and PyUnicode_DecodeLocaleAndSize Added file: http://bugs.python.org/file45118/issue28349.patch

[issue28439] Remove redundant checks in PyUnicode_EncodeLocale

2016-10-16 Thread Xiang Zhang
Changes by Xiang Zhang : Removed file: http://bugs.python.org/file45089/PyUnicode_EncodeLocale.patch ___ Python tracker ___

Re: How to pick out the same titles.

2016-10-16 Thread Alain Ketterlin
Seymore4Head writes: [...] > I have a long text file that has movie titles in it and I would like > to find dupes. > > The thing is that sometimes I have one called "The Killing Fields" and > it also could be listed as "Killing Fields" Sometimes the title will >

Re: Help me!, I would like to find split where the split sums are close to each other?

2016-10-16 Thread breamoreboy
On Sunday, October 16, 2016 at 12:27:00 PM UTC+1, k.ade...@gmail.com wrote: > Help me!, I would like to find split where the split sums are close to each > other? > > I have a list is > > test = [10,20,30,40,50,60,70,80,90,100] > > ​and I would like to find split where the split sums are close

[issue28455] argparse: convert_arg_line_to_args does not actually expect self argument

2016-10-16 Thread siccegge
New submission from siccegge: Hi! Both the 3.4 version and the current version of python documentation wrt the argparse module imply convert_arg_line_to_args replacements needs to accept two arguments while it acutally only works with one. (Not completely sure about details but documentation

[issue27659] Check for the existence of crypt()

2016-10-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: Android does not have crypt, but the crypt module is cross-built nevertheless after this warning has been issued: warning: implicit declaration of function 'crypt' is invalid in C99 [-Wimplicit-function-declaration] And at runtime, importing the crypt

[issue28115] Use argparse for the zipfile module

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes zipfile using argparse and adds tests for zipfile CLI. Originally it is based on tarfile code and tests (but reworked, especially tests). Basically the interface is not changed, but added support of long options, and exit code in case

How to pick out the same titles.

2016-10-16 Thread Seymore4Head
How to pick out the same titles. I have a long text file that has movie titles in it and I would like to find dupes. The thing is that sometimes I have one called "The Killing Fields" and it also could be listed as "Killing Fields" Sometimes the title will have the date a year off. What I

Announcement: Code generation from state diagrams

2016-10-16 Thread peter . o . mueller
>From (UML) state diagrams to Python code made easy. State machines are without any doubt a very good way to model behavior. The new code generator from Sinelabore translates hierarchical state machines efficiently into different languages now including Python. The generator accepts diagrams

[issue28451] pydoc.safeimport() raises ErrorDuringImport() if __builtin__.__import__ is monkey patched

2016-10-16 Thread R. David Murray
R. David Murray added the comment: Can you provide a test case that shows when this condition might occur? We'd want a test in any case if we accept the patch. -- nosy: +r.david.murray ___ Python tracker

Re: pyserial: wait for execute

2016-10-16 Thread Grant Edwards
On 2016-10-16, Michael Okuntsov wrote: > is there a way, other than time.sleep(), to be sure that the command > sent through a serial port has been fully executed? If the remote device doesn't send a response telling you it's done executing the command, then there is

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file45116/doc_fnmatch_translate.patch ___ Python tracker

[issue28449] tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to open compressed tars?

2016-10-16 Thread Roland Bogosi
Roland Bogosi added the comment: For anyone finding this bug through Google before it is fixed, a workaround could be to monkeypatch the OPEN_METH dict with an OrderedDict: tarfile.TarFile.OPEN_METH = OrderedDict() tarfile.TarFile.OPEN_METH['gz'] = 'gzopen'

Help me!, I would like to find split where the split sums are close to each other?

2016-10-16 Thread k . ademarus
Help me!, I would like to find split where the split sums are close to each other? I have a list is test = [10,20,30,40,50,60,70,80,90,100] ​and I would like to find split where the split sums are close to each other by number of splits = 3 that ​all possible combinations and select the split

[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-16 Thread Alex Grönholm
Alex Grönholm added the comment: HTTP/2 (h2) is kind of a biggie :) -- ___ Python tracker ___ ___

[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-16 Thread Cory Benfield
Cory Benfield added the comment: Yeah, probably! There aren't many protocols with defined ALPN identifiers, but we should still probably explain how this works. Do you want me to write them? -- ___ Python tracker

[issue28290] BETA report: Python-3.6 build messages to stderr: AIX and "not GCC"

2016-10-16 Thread Christian Heimes
Christian Heimes added the comment: I'm cautious about messing with crypto code. The problem should be fixed upstream. Please talk the blake2 issue to https://github.com/BLAKE2/BLAKE2. -- ___ Python tracker

[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-16 Thread Christian Heimes
Christian Heimes added the comment: Cory, does it make sense to document some examples? -- assignee: christian.heimes -> components: +Documentation nosy: +Lukasa type: -> enhancement ___ Python tracker

[issue27627] clang fails to build ctypes on Android armv7

2016-10-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: As this problem occurs with the bundled libffi, closing this issue as won't fix for the same reasons as those listed in msg278759. -- resolution: -> wont fix stage: needs patch -> resolved status: open -> closed

[issue26072] pdb fails to access variables closed over

2016-10-16 Thread Chun-Yu Tseng
Chun-Yu Tseng added the comment: Surrender. After digging into the implementation of how CPython handles closures, I am sure that it is impossible to solve this problem now correctly. What I can do is create a patch to let Pdb print enough information when the problem occurs. It would look

[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-10-16 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- status: open -> closed ___ Python tracker ___ ___

[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-10-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks Chi Hsuan Yen for your contributions with this issue. -- ___ Python tracker ___

[issue26942] android: test_ctypes crashes on armv7 and aarch64

2016-10-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: At least for non-Darwin POSIX builds: * Building _ctypes with the bundled copy of libffi is deprecated in 3.6 and the default is to use a system copy of libffi, issue 27976. * The bundled libffi is removed in 3.7, issue 27979. As this crash happens with the

[issue28454] Spurious arguments to PyErr_Format in unicodeobject.c

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- nosy: +serhiy.storchaka stage: patch review -> commit review ___ Python tracker ___

[issue28454] Spurious arguments to PyErr_Format in unicodeobject.c

2016-10-16 Thread Xiang Zhang
New submission from Xiang Zhang: In unicodeobject.c, there are some spurious arguments to PyErr_Format as the patch shows. -- components: Interpreter Core files: spurious_argument.patch keywords: patch messages: 278757 nosy: ncoghlan, xiang.zhang priority: normal severity: normal

Re: How make the judge with for loop?

2016-10-16 Thread Peter Otten
38016226...@gmail.com wrote: > c="abcdefghijk" > len=len(c) > n is a int > sb=[[] for i in range(n)] > > while (i < len) { > for (int j = 0; j < n && i < len; j++) > sb[j].append(c[i++]); > for (int j = n-2; j >= 1 && i < len; j--) // >

[issue14991] Option for regex groupdict() to show only matching names

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe start emitting FutureWarning when groupdict() is called without an argument? groupdict(None) returns the same result but without a warning. After 1 or 2 releases the behavior can be changed: groupdict() will return only matched groups. --

[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-16 Thread SilentGhost
SilentGhost added the comment: Here is the updated patch with fixes to the test suite. -- versions: +Python 3.7 Added file: http://bugs.python.org/file45113/25953_2.diff ___ Python tracker

[issue16007] Improved Error message for failing re expressions

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since 3.5 (issue22578) the re.error exception has attributes that contain a pattern and the position of the error. Error message contains the position of the error. A pattern is not included in the error message for purpose: it can be too long. Usually the

[issue23692] Undocumented feature prevents re module from finding certain matches

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 -Python 3.4 ___ Python tracker

[issue22949] fnmatch.translate doesn't add ^ at the beginning

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Since issue22493 fnmatch.translate() uses scoped modifiers: r'(?s:%s)\Z' % res. Here is a patch that updates the documentation for fnmatch.translate(). -- stage: needs patch -> patch review versions: +Python 3.6, Python 3.7 -Python 3.4

[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka stage: -> patch review ___ Python tracker

Re: How make the judge with for loop?

2016-10-16 Thread Steven D'Aprano
On Sunday 16 October 2016 16:23, 38016226...@gmail.com wrote: > c="abcdefghijk" > len=len(c) > n is a int > sb=[[] for i in range(n)] > > while (i < len) { > for (int j = 0; j < n && i < len; j++) > sb[j].append(c[i++]); > for (int j = n-2; j >= 1 && i < len; j--)

[issue25550] RecursionError in re with '(' * 500

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Closed as not a bug. Unlike to issue401612 this is not an infinite recursion. Raising RecursionError depends on the context (it is more likely in deeply nested call) and there is a common workaround -- just increase maximum recursion depth using

[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks for the reports. The next step is having the patch reviewed by one of the Python build machinery experts. Nosying Martin, Zachary and Matthias. -- nosy: +doko, martin.panter, zach.ware ___ Python tracker

[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Regular Expressions nosy: +ezio.melotti ___ Python tracker ___

[issue24896] It is undocumented that re.UNICODE affects re.IGNORECASE

2016-10-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: +Python 3.7 ___ Python tracker ___

[issue27471] sre_constants.error: bad escape \d

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All behaves as purposed. But the documentation is not accurate, and even misleading. It should be enhanced (issue28450). -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue28450] Misleading/inaccurate documentation about unknown escape sequences in regular expressions

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Lele. Agreed, the documentation looks misleading. Do you want to provide more clear wording? -- nosy: +Rosuav, mrabarnett, nedbat, serhiy.storchaka stage: -> needs patch title: Misleading/inaccurate documentation about

[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: The "used directly as the metaclass" is a reference to https://docs.python.org/3/reference/datamodel.html#creating-the-class-object further down, and specifically the "metaclass(name, bases, namespace, **kwds)" call. It's not saying Python has a way to bypass

[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: Oops, couple of typos: "... only triggers metaclass resolution at that point ..." "... if either the metaclass being instantiated is a subclass of all the metaclasses of all of the bases ..." But the only way to bypass the "most derived metaclass" rule is for

[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Neil Girdhar
Neil Girdhar added the comment: Okay, I understand what you're saying, but I it says in the documentation that "if an explicit metaclass is given and it is not an instance of type(), then it is used directly as the metaclass". My recent updated "metaclass_callable" is not an instance of

[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: Because they're checking for different things: - types.prepare_class is only checking "How do I call __prepare__?". It only triggers type resolution at that point if the metaclass hint is an instance of type, otherwise it skips that process entirely and queries

[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Neil Girdhar
Neil Girdhar added the comment: Thanks for taking the time to explain, but it's still not working for me: from types import new_class class MyMetaclass(type): pass class OtherMetaclass(type): pass def metaclass_callable(name, bases, namespace): return new_class(name, bases,

[issue28437] Documentation for handling of non-type metaclass hints is unclear

2016-10-16 Thread Nick Coghlan
Nick Coghlan added the comment: Why should it trip the PEP 3115 namespace preparation exception? We only check for __prepare__ (and hence need to do an early most-derived metaclass resolution) on instances of "type", not on arbitrary callables used as a metaclass hint The checks are

[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Oren. I'll make a detailed review in next few days. -- stage: needs patch -> patch review versions: +Python 3.7 -Python 3.6 ___ Python tracker