[issue32900] Teach pdb to step through asyncio et al.

2018-02-24 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

The help for 'n' says:

(Pdb) help n
n(ext)
Continue execution until the next line in the current function
is reached or it returns.

(And the docs [1] say essentially the same.)

It sounds like if that were true, then you wouldn't have a problem, right? But 
what it's actually doing is continuing until the next line in the current 
function is reached, or it returns, *or it yields*.

It would be super helpful if pdb had a way to step past yields, running at full 
speed until the current frame is resumed. And it's not just 'next' where this 
would be useful, it's useful for 'step' and 'until' as well.

Furthermore, I think we should distinguish between the "user visible" yields in 
generators and async generators, and the "implementation detail" yields to the 
coroutine runner that are async functions do. In both cases you might want 
stepping to follow the yield or not, so it'd be nice to have the option, but 
the *default* for user-visible yields should be to treat the yield like a 
return, and the *default* for implementation-detail yields should be to 
continue until the frame is resumed again.

[1] https://docs.python.org/3.7/library/pdb.html#pdbcommand-next

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - simplify StringTranslatePseudoMapping

2018-02-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

For efficiency I suggest to initialize the mapping with 
dict.fromkeys(range(128), 'x') rather of an empty dict.

It is also possible to use regular expressions:

_trans = re.compile(r'''[^(){}\[]"'\\\n#]+''')
code = _trans.sub('x', code)
code = code.replace('{', '(')
code = code.replace('}', ')')
code = code.replace('[', '(')
code = code.replace(']', '(')
code = code.replace('\nx', '\n')

I didn't check what way is more efficient.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32944] Need Guidance on Solving the Tcl problem

2018-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Download and install 8.5.18 as the link says.  If you have further questions, 
try python list or search stackoverflow.  This tracker is for patching python, 
not for user questions.

--
assignee: terry.reedy -> 
components: +Installation -IDLE
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32943] confusing error message for rot13 codec

2018-02-24 Thread Xiang Zhang

Change by Xiang Zhang :


--
nosy: +lemburg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32943] confusing error message for rot13 codec

2018-02-24 Thread Xiang Zhang

Change by Xiang Zhang :


--
keywords: +patch
pull_requests: +5643
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32944] Need Guidance on Solving the Tcl problem

2018-02-24 Thread LBC2525

New submission from LBC2525 :

Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.

I have downloaded the Tcl and Tk files from 
http://www.python.org/download/mac/tcltk/ and I am still getting the error.  

Suggestions are appreciated.

--
assignee: terry.reedy
components: IDLE
messages: 312776
nosy: LBC2525, terry.reedy
priority: normal
severity: normal
status: open
title: Need Guidance on Solving the Tcl problem
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32943] confusing error message for rot13 codec

2018-02-24 Thread Xiang Zhang

New submission from Xiang Zhang :

rot13 codec does a str translate operation. But it doesn't check the input type 
and then the error message would be quite confusing, especially for bytes:

>>> codecs.encode(b'abc', 'rot13')
Traceback (most recent call last):
  File 
"/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/rot_13.py",
 line 15, in encode
return (input.translate(rot13_map), len(input))
TypeError: a bytes-like object is required, not 'dict'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
TypeError: encoding with 'rot13' codec failed (TypeError: a bytes-like object 
is required, not 'dict')

--
messages: 312775
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: confusing error message for rot13 codec
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32939] IDLE: self.use_context_ps1 defined in editor, but always False

2018-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

#31858 (second link) replaced one (?) use of "if use_context_ps1" ('in Shell') 
with "if self.last_prompt_line != ''" ("prompt before code on same line").  
This can only happen in Shell, and only if the prompt ends with something other 
than '\n'.

I cannot remember whether intentionally removing use_context_ps1 = True, but I 
may have found that it improved behavior in some case and may have intended to 
followup but have not yet.  Part of the problem is that smart indents do not 
work right in the shell, and if they did, they would be wrong as soon as one 
copied code from shell to editor.

Before merging "I tested the patch manually in both shell and editor with both 
the default prompt and with sys.ps1 set before importing idlelib.idle."  But I 
did not write out what I did and what the results were.

The immediate issue is to decide whether to do nothing, revert the removal, or 
change the editor code, and document why.  Fresh knowledge of pyparse should 
help.

--
type: enhancement -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17232] Improve -O docs

2018-02-24 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17232] Improve -O docs

2018-02-24 Thread miss-islington

miss-islington  added the comment:


New changeset fc9471a888f373aedff3c118ae9a6cbf2037bd7c by Miss Islington (bot) 
in branch '3.6':
bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)
https://github.com/python/cpython/commit/fc9471a888f373aedff3c118ae9a6cbf2037bd7c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17232] Improve -O docs

2018-02-24 Thread miss-islington

miss-islington  added the comment:


New changeset b5655f3d187084579ff389dbd8734742a8b66cbc by Miss Islington (bot) 
in branch '3.7':
bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)
https://github.com/python/cpython/commit/b5655f3d187084579ff389dbd8734742a8b66cbc


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17232] Improve -O docs

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5642

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17232] Improve -O docs

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5641

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17232] Improve -O docs

2018-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:


New changeset 186b606d8a2ea4fd51b7286813302c8e8c7006cc by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-17232: Clarify docs for -O and -OO command line options (#5839)
https://github.com/python/cpython/commit/186b606d8a2ea4fd51b7286813302c8e8c7006cc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - simplify StringTranslatePseudoMapping

2018-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I simplified ParseMap to a dict subclass with one override -- __getitem__ and 
then the tests.  They run faster.  I suspect translate is faster.

--
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12345] Add math.tau

2018-02-24 Thread Nick Coghlan

Change by Nick Coghlan :


--
pull_requests:  -5640

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32932] better error message when __all__ contains non-str objects

2018-02-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

I believe the original rationale for the `__path__` check was to restrict that 
branch to the case where we may need to import a not-yet-imported submodule in 
order to get the attribute set appropriately.

However, giving a better error message for __all__ in ordinary modules also 
seems like a good reason to follow that branch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12345] Add math.tau

2018-02-24 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5640

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - simplify StringTranslatePseudoMapping

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

New PR submitted.  Really glad I worked on this today.  I learned a lot of 
things that were new to me.  :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4260] Document that ctypes.xFUNCTYPE are decorators.

2018-02-24 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32185] SSLContext.wrap_socket sends SNI Extension when server_hostname is IP

2018-02-24 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5639

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2018-02-24 Thread Christian Heimes

Change by Christian Heimes :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 8d4d17399fb82801eaaca5beeb97a19908b40222 by Christian Heimes in 
branch '2.7':
bpo-31518: Change TLS protocol for Debian (#3661)
https://github.com/python/cpython/commit/8d4d17399fb82801eaaca5beeb97a19908b40222


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset aab225840360719516eca55a7a69cfee45aee2af by Christian Heimes in 
branch '3.6':
bpo-31518: Change TLS protocol for Debian (#3660)
https://github.com/python/cpython/commit/aab225840360719516eca55a7a69cfee45aee2af


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-24 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5638

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - simplify StringTranslatePseudoMapping

2018-02-24 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
pull_requests: +5637
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-24 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5636

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32942] Regression: test_script_helper fails

2018-02-24 Thread Andrew Brezovsky

New submission from Andrew Brezovsky :

Test test_script_helper fails, details:

Running Debug|Win32 interpreter...
== CPython 3.8.0a0 (heads/master:6cdb7954b0, Feb 24 2018, 17:25:46) [MSC v.1912 
32 bit (Intel)]
== Windows-10-10.0.16299-SP0 little-endian
== cwd: \cpython\build\test_python_7920
== CPU count: 4
== encodings: locale=cp1252, FS=utf-8
Run tests sequentially
0:00:00 [1/1] test_script_helper
test_assert_python_failure (test.test_script_helper.TestScriptHelper) ... ok
test_assert_python_failure_raises (test.test_script_helper.TestScriptHelper) 
... ok
test_assert_python_isolated_when_env_not_required 
(test.test_script_helper.TestScriptHelper) ... ok
test_assert_python_not_isolated_when_env_is_required 
(test.test_script_helper.TestScriptHelper)
Ensure that -I is not passed when the environment is required. ... ok
test_assert_python_ok (test.test_script_helper.TestScriptHelper) ... ok
test_assert_python_ok_raises (test.test_script_helper.TestScriptHelper) ... ok
test_interpreter_requires_environment_details 
(test.test_script_helper.TestScriptHelperEnvironment) ... FAIL
test_interpreter_requires_environment_false 
(test.test_script_helper.TestScriptHelperEnvironment) ... FAIL
test_interpreter_requires_environment_true 
(test.test_script_helper.TestScriptHelperEnvironment) ... FAIL

==
FAIL: test_interpreter_requires_environment_details 
(test.test_script_helper.TestScriptHelperEnvironment)
--
Traceback (most recent call last):
  File "C:\Users\andor\Documents\Projects\cpython\lib\unittest\mock.py", line 
1191, in patched
return func(*args, **keywargs)
  File 
"C:\Users\andor\Documents\Projects\cpython\lib\test\test_script_helper.py", 
line 101, in test_interpreter_requires_environment_details
self.assertFalse(script_helper.interpreter_requires_environment())
AssertionError: True is not false

==
FAIL: test_interpreter_requires_environment_false 
(test.test_script_helper.TestScriptHelperEnvironment)
--
Traceback (most recent call last):
  File "C:\Users\andor\Documents\Projects\cpython\lib\unittest\mock.py", line 
1191, in patched
return func(*args, **keywargs)
  File 
"C:\Users\andor\Documents\Projects\cpython\lib\test\test_script_helper.py", 
line 95, in test_interpreter_requires_environment_false
self.assertFalse(script_helper.interpreter_requires_environment())
AssertionError: True is not false

==
FAIL: test_interpreter_requires_environment_true 
(test.test_script_helper.TestScriptHelperEnvironment)
--
Traceback (most recent call last):
  File "C:\Users\andor\Documents\Projects\cpython\lib\unittest\mock.py", line 
1191, in patched
return func(*args, **keywargs)
  File 
"C:\Users\andor\Documents\Projects\cpython\lib\test\test_script_helper.py", 
line 89, in test_interpreter_requires_environment_true
self.assertEqual(1, mock_check_call.call_count)
AssertionError: 1 != 0

--
Ran 9 tests in 0.240s

FAILED (failures=3)
test test_script_helper failed
test_script_helper failed

1 test failed:
test_script_helper

Total duration: 281 ms
Tests result: FAILURE

--
components: Tests
messages: 312765
nosy: abrezovsky
priority: normal
severity: normal
status: open
title: Regression: test_script_helper fails
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - simplify StringTranslatePseudoMapping

2018-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I forget about this defaultdict behavior: "this value is inserted in the 
dictionary for the key, and returned."  Reason: when default_factory returns a 
mutable, d[key] must return the same possibly mutated object with each call.  I 
agree that defaultdict is not the right replacement.

We need to pass to str.translate a dict that can be used by subscripting, 
newchar = d[char].  So partial(non-defaults.get, default_value) will not work.  
Instead, we need a __getitem__ that returns the same.

In msg312444 I suggested simplifying STPM (including the name) because it has 
unneeded complexity.  Remove the buggy .get override.  Combine the _get stuff 
in __init__ (also removed) with current __getitem__ and simplify and we get 
what we actually need (untested, at yet).

def __getitem__
return self._non_defaults.get(self._default_value)

Actually, we could hard-code the default value as 'X' as we never need anything 
else.  

How about ParseMap for the name?

--
stage: patch review -> needs patch
title: IDLE: pyparse - replace StringTranslatePseudoMapping with defaultdict -> 
IDLE: pyparse - simplify StringTranslatePseudoMapping

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-24 Thread Guido van Rossum

Guido van Rossum  added the comment:

Sorry, I used imprecise language. What you propose is fine.

On Feb 24, 2018 09:54, "Eric V. Smith"  wrote:

>
> Eric V. Smith  added the comment:
>
> Note that this class (from the test suite) will now raise an exception:
>
> @dataclass(unsafe_hash=True)
> class C:
> i: int
> def __eq__(self, other):
> return self.i == other.i
>
> That's because it has a __hash__, added when __eq__ is defined. I think
> we're better off with the rule being:
>
> If unsafe_hash=True, raise an exception if __hash__ exists and is not
> None. Otherwise add __hash__.
>
> That's how it used to be with hash=True (in 3.70b1).
>
> Or is that what you meant by "but if a __hash__ method is present, an
> exception is raised"? Notice the word "method", instead of attribute.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 01d9c23e470d708b922a1085347404000e985c0f by Christian Heimes 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-30622: Improve NPN support detection (GH-5859) (#5860)
https://github.com/python/cpython/commit/01d9c23e470d708b922a1085347404000e985c0f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31355] Remove Travis CI macOS job: rely on buildbots

2018-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Last macOS job took 13 minutes and there was almost no wait.  That looks ok.  
I'm not sure it's required to backport to 3.6 and 2.7 since those branches 
typically have less churn.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32912] Raise non-silent warning for invalid escape sequences

2018-02-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 5849 changes not only the Python parser, but codecs. It shouldn't. The 
Python parser and codecs will go different ways. The warning in the Python 
parser will finally be upgraded to SyntaxError (it is already replaced with 
SyntaxError if the warning is raised as error). The warning in codecs will 
become UnicodeDecodeError or ValueError. This is why the code for emitting the 
warning is not shared between the parser and codecs at first place.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg312739

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Terry J. Reedy

Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg312733

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32941] mmap should expose madvise()

2018-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For information:
- macOS manpage for madvise():
http://www.manpages.info/macosx/madvise.2.html
- FreeBSD manpage for madvise():
https://www.freebsd.org/cgi/man.cgi?query=madvise=2

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32941] mmap should expose madvise()

2018-02-24 Thread Antoine Pitrou

New submission from Antoine Pitrou :

On POSIX, mmap objects could expose a method wrapping the madvise() library 
call.  I suggest the following API

  mmap_object.madvise(option[, start[, length]])

If omitted, *start* and *length* would span the whole memory area described by 
the mmap object.  *option* must be a recognized OS option for the madvise() 
library call.

The mmap module would expose the various MADV_* options available on the 
current platform.

Open question: should we expose madvise() or posix_madvise()? (these are two 
different calls, at least on Linux)  posix_madvise() is arguably more portable, 
but madvise() is much more powerful, so I'd lean towards madvise().

--
components: Library (Lib)
messages: 312758
nosy: larry, ned.deily, neologix, pitrou, ronaldoussoren
priority: normal
severity: normal
status: open
title: mmap should expose madvise()
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 6cdb7954b0a578d899e4b78b868ea59eef08480a by Christian Heimes in 
branch 'master':
bpo-30622: Improve NPN support detection (#5859)
https://github.com/python/cpython/commit/6cdb7954b0a578d899e4b78b868ea59eef08480a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5635

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32932] better error message when __all__ contains non-str objects

2018-02-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I was wondering why the error is not raised by the IMPORT_NAME opcode which 
predates IMPORT_FROM. It calls _handle_fromlist() from _bootstrap. But in this 
case the module doesn't have the __path__ attribute and the sanity check was 
skipped.

I'm wondering if it is enough to add the sanity check in _handle_fromlist() for 
the case when the module doesn't have the __path__ attribute. The Python code 
could be simpler than the C code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24334] SSLSocket extra level of indirection

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks for your review, Antoine!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24334] SSLSocket extra level of indirection

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 8fa8478ddeba0870da1152f0a2985c8a7eeb9fd1 by Christian Heimes 
(Miss Islington (bot)) in branch '3.7':
[3.7] bpo-24334: Cleanup SSLSocket (GH-5252) (#5857)
https://github.com/python/cpython/commit/8fa8478ddeba0870da1152f0a2985c8a7eeb9fd1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30622] Fix NPN guard for OpenSSL 1.1

2018-02-24 Thread Christian Heimes

Change by Christian Heimes :


--
pull_requests: +5634

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31355] Remove Travis CI macOS job: rely on buildbots

2018-02-24 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
keywords: +patch
pull_requests: +5633
stage: resolved -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24334] SSLSocket extra level of indirection

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5632

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24334] SSLSocket extra level of indirection

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:


New changeset 141c5e8c2437a9fed95a04c81e400ef725592a17 by Christian Heimes in 
branch 'master':
bpo-24334: Cleanup SSLSocket (#5252)
https://github.com/python/cpython/commit/141c5e8c2437a9fed95a04c81e400ef725592a17


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - replace StringTranslatePseudoMapping with defaultdict

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Tal had written this on the original issue21765:

Finally, since the defaultdict is kept around as long as IDLE is running, I 
decided to avoid having it grow continually and consume memory unnecessarily. 
So I wrote a simple Mapping class, which wraps a normal dict and uses a custom 
default value instead of None, ord('x') in this case. Works like a charm :)
-
So maybe I misunderstood and this shouldn't be a defaultdict?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32937] Multiprocessing worker functions not terminating with a large number of processes and a manager

2018-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm not sure... I cannot reproduce your problem on Linux, even with 50 
processes and 1 iterations, on Python 3.6.4.

Which exact version are you using?
What happens if you replace the manager Queue with a non-manager Queue?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32931] Python 3.70b1 specifies non-existent compiler gcc++

2018-02-24 Thread Ned Deily

Ned Deily  added the comment:

Thanks for noticing!  Fixed for 3.7.0b2.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32931] Python 3.70b1 specifies non-existent compiler gcc++

2018-02-24 Thread Ned Deily

Ned Deily  added the comment:


New changeset d24c5a068c1831a8579a5915f44ae3b4344aba43 by Ned Deily (Miss 
Islington (bot)) in branch '3.7':
[3.7] bpo-32931: fix macOS 10.9+ installer c++ compiler name (GH-5856)
https://github.com/python/cpython/commit/d24c5a068c1831a8579a5915f44ae3b4344aba43


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32937] Multiprocessing worker functions not terminating with a large number of processes and a manager

2018-02-24 Thread EricG

EricG  added the comment:

I do plan to consume the messages on the queue, but only after all worker 
functions are complete...after pool.join() returns. Is this not ok?

I can certainly spawn a thread on the main process which will consume the queue 
entries and insert them into a list or queue which can then be accessed after 
join returns. Is that the correct way this code should be written?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32937] Multiprocessing worker functions not terminating with a large number of processes and a manager

2018-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

What happens if you add another process that calls get() on the queue?  You 
should not try to put data on a queue if you don't ever plan to consume it, as 
the queue's background thread will eventually block until something gets 
consumed.

For example, this blocks here on Linux:

$ ./python -c "import multiprocessing as mp; q = mp.Queue(); [q.put(None) for i 
in range(5)]"

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32931] Python 3.70b1 specifies non-existent compiler gcc++

2018-02-24 Thread Ned Deily

Ned Deily  added the comment:


New changeset acd7163c0a0674b2fb6cc0178d52cf90c953fbae by Ned Deily in branch 
'master':
bpo-32931: fix macOS 10.9+ installer c++ compiler name (#5855)
https://github.com/python/cpython/commit/acd7163c0a0674b2fb6cc0178d52cf90c953fbae


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32931] Python 3.70b1 specifies non-existent compiler gcc++

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5631

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32886] new Boolean ABC in numbers module

2018-02-24 Thread R. David Murray

Change by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32931] Python 3.70b1 specifies non-existent compiler gcc++

2018-02-24 Thread Ned Deily

Change by Ned Deily :


--
keywords: +patch
pull_requests: +5630
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Ned Batchelder

On 2/24/18 2:08 PM, Peng Yu wrote:

On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list
 wrote:

On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote:


I would like to just get the escaped string without the single quotes.
Is there a way to do so? Thanks.


x='\n'
print repr(x)

'\n'

Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.

x='/n'
print(repr(x))

'/n'

print(repr(x).strip("'"))

/n
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.

x='/n'
print repr(x)

'/n'

print repr(x).strip("'")

/n

I was looking for something builtin python. There is not such a builtin way?



Peng, your last three questions all make me wonder what larger problem 
you are working on.  These all sound like there might be an easier way.  
Can you take a step back and tell us about the big picture?


--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Peng Yu
On Sat, Feb 24, 2018 at 1:08 PM, Peng Yu  wrote:
> On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list
>  wrote:
>> On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote:
>>
>>> I would like to just get the escaped string without the single quotes.
>>> Is there a way to do so? Thanks.
>>>
>> x='\n'
>> print repr(x)
>>> '\n'
>>
>> Python 3.5.3 (default, Jan 19 2017, 14:11:04)
>> [GCC 6.3.0 20170118] on linux
>> Type "help", "copyright", "credits" or "license" for more information.
> x='/n'
> print(repr(x))
>> '/n'
> print(repr(x).strip("'"))
>> /n
>
>>
>> Python 2.7.13 (default, Nov 24 2017, 17:33:09)
>> [GCC 6.3.0 20170516] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
> x='/n'
> print repr(x)
>> '/n'
> print repr(x).strip("'")
>> /n
>
>
> I was looking for something builtin python. There is not such a builtin way?

Also, this is not printed as \f or \e. I'd like things like \a, \b,
... \v be printed as such. Is there a way to do so in python?

>>> print repr('\f')
'\x0c'
>>> print repr('\e')
'\\e'

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32884] Adding the ability for getpass to print asterisks when passowrd is typed

2018-02-24 Thread R. David Murray

R. David Murray  added the comment:

getpass is emulating the unix password prompt behavior.  I'm not sure if the 
complication is worth it, especially since not echoing asterisks is, as you 
observe, fractionally more secure.  So I guess I'm about -.5 on this feature.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Peng Yu
On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list
 wrote:
> On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote:
>
>> I would like to just get the escaped string without the single quotes.
>> Is there a way to do so? Thanks.
>>
> x='\n'
> print repr(x)
>> '\n'
>
> Python 3.5.3 (default, Jan 19 2017, 14:11:04)
> [GCC 6.3.0 20170118] on linux
> Type "help", "copyright", "credits" or "license" for more information.
 x='/n'
 print(repr(x))
> '/n'
 print(repr(x).strip("'"))
> /n

>
> Python 2.7.13 (default, Nov 24 2017, 17:33:09)
> [GCC 6.3.0 20170516] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
 x='/n'
 print repr(x)
> '/n'
 print repr(x).strip("'")
> /n


I was looking for something builtin python. There is not such a builtin way?

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

For msg312474 regarding replace vs re.

Running the 20,000 copy version of the translated text (only translating once 
gives the following timings:
copies: 2   translate time: 5.591020822525024
copies: 2   translate time: 5.5614333152771
copies: 2   translate time: 5.561311483383179
copies: 2   translate time: 5.558183670043945
copies: 2   translate time: 5.580726385116577
copies: 2   translate time: 5.588990688323975
copies: 2   translate time: 5.570690155029297
copies: 2   translate time: 5.601408004760742
copies: 2   translate time: 5.76714825630188
copies: 2   translate time: 5.697475910186768

And the re version gives:
copies: 2   translate time: 5.935032844543457
copies: 2   translate time: 5.939348220825195
copies: 2   translate time: 5.933218240737915
copies: 2   translate time: 6.070481538772583
copies: 2   translate time: 6.319685935974121
copies: 2   translate time: 6.4209065437316895
copies: 2   translate time: 6.476579666137695
copies: 2   translate time: 6.520790100097656
copies: 2   translate time: 6.541554927825928
copies: 2   translate time: 6.620612859725952

So, it's a little slower on a big string.  It also gives slightly different 
results because of the last replace:
code.replace('\nx', '\n')  isn't in the re.

On a more practical size document, they are about the same:
replace:
copies: 20   translate time: 0.0058782100677490234
copies: 20   translate time: 0.006024599075317383
copies: 20   translate time: 0.0056345462799072266
copies: 20   translate time: 0.005848884582519531
copies: 20   translate time: 0.005696296691894531
copies: 20   translate time: 0.00574946403503418
copies: 20   translate time: 0.005642890930175781
copies: 20   translate time: 0.005755901336669922
copies: 20   translate time: 0.0058023929595947266
copies: 20   translate time: 0.005713939666748047

re:
copies: 20   translate time: 0.005833148956298828
copies: 20   translate time: 0.005682229995727539
copies: 20   translate time: 0.00565028190612793
copies: 20   translate time: 0.005823850631713867
copies: 20   translate time: 0.0057680606842041016
copies: 20   translate time: 0.0058100223541259766
copies: 20   translate time: 0.005717277526855469
copies: 20   translate time: 0.005885601043701172
copies: 20   translate time: 0.005852460861206055
copies: 20   translate time: 0.005867958068847656

It appears the time for the replace is linear and the re is just a little more 
than linear.  Maybe it's just my computer.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32932] better error message when __all__ contains non-str objects

2018-02-24 Thread Brett Cannon

Brett Cannon  added the comment:

Fixing the message makes sense. I assume this is happening in ceval.c or 
import.c since 
https://github.com/python/cpython/blob/42c35d9c0c8175332f50fbe034a001fe52f057b9/Lib/importlib/_bootstrap.py#L1021
 has the appropriate message?

--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32937] Multiprocessing worker functions not terminating with a large number of processes and a manager

2018-02-24 Thread Ned Deily

Change by Ned Deily :


--
nosy: +davin, pitrou -ned.deily, ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32924] Python 3.7 docs in docs.p.o points to GitHub's master branch

2018-02-24 Thread Ned Deily

Ned Deily  added the comment:

It would be great if the URL in the template were constructed from the value of 
SOURCE_URI in Doc/tools/extensions/pyspecific.py.  I was unaware that there was 
this additional URL reference in the template.

--
nosy: +ned.deily
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I wish I could delete my last message (and duplicate posting of the one before. 
 On the last one, I didn't move my timings.  I feel like an idiot.  Anyway, 
there is a difference.
```
start = time.time()
for i in range(100):
_tran = defaultdict(lambda: 'x')
_tran.update((ord(c), ord('(')) for c in "({[")
_tran.update((ord(c), ord(')')) for c in ")}]")
_tran.update((ord(c), ord(c)) for c in "\"'\\\n#")
end = time.time()
print(f'translate time: {end - start}')
```
translate time: 7.443669319152832

```
start = time.time()
for i in range(100):
_tran = defaultdict(lambda: 'x')
_tran.update({40: 40,# ord('(')
  91: 40,# ord('[')
  123: 40,   # ord('{')
  41: 41,# ord(')')
  93: 41,# ord(']')
  125: 41,   # ord('}')
  34: 34,# ord('"')
  39: 39,# ord("'")
  92: 92,# ord("\\")
  10: 10,# ord("\n")
  35: 35,# ord("#")
  })
end = time.time()
print(f'translate time: {end - start}')
```
translate time: 1.7251780033111572

It's still probably negligible since it's only done once and not a million 
times.  :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to only get \n for newline without the single quotes?

2018-02-24 Thread Wildman via Python-list
On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote:

> I would like to just get the escaped string without the single quotes.
> Is there a way to do so? Thanks.
> 
 x='\n'
 print repr(x)
> '\n'

Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x='/n'
>>> print(repr(x))
'/n'
>>> print(repr(x).strip("'"))
/n
>>> 

Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x='/n'
>>> print repr(x)
'/n'
>>> print repr(x).strip("'")
/n
>>> 

-- 
 GNU/Linux user #557453
"There are only 10 types of people in the world...
those who understand Binary... and those who don't."
  -Spike
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32940] IDLE: pyparse - replace StringTranslatePseudoMapping with defaultdict

2018-02-24 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
title: IDLE: pyparse - replace StringTranslatePseudoMappingTest with 
defaultdict -> IDLE: pyparse - replace StringTranslatePseudoMapping with 
defaultdict

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32930] [help][webbrowser always opens new tab. I want to open in the same tab]

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I'm going to close this as third party since it's browser and not Python 
related.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I also timed this for a `_tran` optimization (instead of looping and doing the 
`ord`), but it didn't really make a difference.
```
_tran = defaultdict(lambda: 'x')
_tran.update({40: 40,# ord('(')
  91: 40,# ord('[')
  123: 40,   # ord('{')
  41: 41,# ord(')')
  93: 41,# ord(']')
  125: 41,   # ord('}')
  34: 34,# ord('"')
  39: 39,# ord("'")
  92: 92,# ord("\\")
  10: 10,# ord("\n")
  35: 35,# ord("#")
  })
```
I think both the loop and the above mapping are equally difficult to understand 
without stopping to think about it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-24 Thread Eric V. Smith

Eric V. Smith  added the comment:

Note that this class (from the test suite) will now raise an exception:

@dataclass(unsafe_hash=True)
class C:
i: int
def __eq__(self, other):
return self.i == other.i

That's because it has a __hash__, added when __eq__ is defined. I think we're 
better off with the rule being:

If unsafe_hash=True, raise an exception if __hash__ exists and is not None. 
Otherwise add __hash__.

That's how it used to be with hash=True (in 3.70b1).

Or is that what you meant by "but if a __hash__ method is present, an exception 
is raised"? Notice the word "method", instead of attribute.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - replace StringTranslatePseudoMappingTest with defaultdict

2018-02-24 Thread Cheryl Sabella

Change by Cheryl Sabella :


--
keywords: +patch
pull_requests: +5629
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-24 Thread miss-islington

miss-islington  added the comment:


New changeset 980790eee0c804061a49b8ad7373e4669b48f2ec by Miss Islington (bot) 
in branch '3.6':
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
https://github.com/python/cpython/commit/980790eee0c804061a49b8ad7373e4669b48f2ec


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



How to only get \n for newline without the single quotes?

2018-02-24 Thread Peng Yu
I would like to just get the escaped string without the single quotes.
Is there a way to do so? Thanks.

>>> x='\n'
>>> print repr(x)
'\n'

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

For msg312444 on StringTranslatePseudoMapping:

I ran a comparison of the current class vs defaultdict.

This was my test:
```
with open('/home/cheryl/cpython/Lib/idlelib/pyparse.py') as fd:
code = fd.read()
copies = 2
code *= copies
for i in range(10):
start = time.time()
trans_code = code.translate(_tran)
end = time.time()
print(f'copies: {copies}   translate time: {end - start}')
```

I ran the current `_tran` first and saved the results.
```
_tran = {}
_tran.update((ord(c), ord('(')) for c in "({[")
_tran.update((ord(c), ord(')')) for c in ")}]")
_tran.update((ord(c), ord(c)) for c in "\"'\\\n#")
_tran = StringTranslatePseudoMapping(_tran, default_value=ord('x'))
```
I know time.time isn't perfect, but thought it might be good enough.  The 
results:
copies: 2   translate time: 0.8162932395935059
copies: 2   translate time: 0.610985517501831
copies: 2   translate time: 0.8164870738983154
copies: 2   translate time: 0.6125986576080322
copies: 2   translate time: 0.8143167495727539
copies: 2   translate time: 0.612929105758667
copies: 2   translate time: 0.8299245834350586
copies: 2   translate time: 0.6127865314483643
copies: 2   translate time: 0.812185525894165
copies: 2   translate time: 0.6151354312896729


Then I changed it to a defaultdict:
```
_tran = defaultdict(lambda: 'x')
 # _tran = {}
_tran.update((ord(c), ord('(')) for c in "({[")
_tran.update((ord(c), ord(')')) for c in ")}]")
_tran.update((ord(c), ord(c)) for c in "\"'\\\n#")
# _tran = StringTranslatePseudoMapping(_tran, default_value=ord('x'))
```

I compared the results to make sure the defaultdict produced the same output as 
the mapping, which it did.

The results:
copies: 2   translate time: 0.8172969818115234
copies: 2   translate time: 0.6214878559112549
copies: 2   translate time: 0.8143007755279541
copies: 2   translate time: 0.6127951145172119
copies: 2   translate time: 0.8154017925262451
copies: 2   translate time: 0.6144123077392578
copies: 2   translate time: 0.8128812313079834
copies: 2   translate time: 0.6167266368865967
copies: 2   translate time: 0.8143749237060547
copies: 2   translate time: 0.6116495132446289


So, the results are simliar, down to the alternating of .61ish and .81ish times.

--
dependencies: +IDLE: pyparse - replace StringTranslatePseudoMappingTest with 
defaultdict

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-24 Thread miss-islington

miss-islington  added the comment:


New changeset e49bf0f353a968cddc4d8e6ea668b9d2d116e2ac by Miss Islington (bot) 
in branch '3.7':
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
https://github.com/python/cpython/commit/e49bf0f353a968cddc4d8e6ea668b9d2d116e2ac


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32940] IDLE: pyparse - replace StringTranslatePseudoMappingTest with defaultdict

2018-02-24 Thread Cheryl Sabella

New submission from Cheryl Sabella :

Based on timing test on msg312733, StringTranslatePseudoMappingTest and a 
defaultdict have about the same performance, so this replaces the custom class 
with the stdlib functionality.

--
assignee: terry.reedy
components: IDLE
messages: 312734
nosy: csabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: pyparse - replace StringTranslatePseudoMappingTest with defaultdict
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: read Unicode characters one by one in python2

2018-02-24 Thread Karsten Hilbert
On Sat, Feb 24, 2018 at 10:17:35AM -0600, Peng Yu wrote:

> Here shows some code for reading Unicode characters one by one in
> python2. Is it the best code for reading Unicode characters one by one
> in python2?
> 
> https://rosettacode.org/wiki/Read_a_file_character_by_character/UTF8#Python

This seems off, because in Python2 you can also specify an
encoding.

However, you seem to be asking about reading the console
which comes with more caveats.

So, what is it ?

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

For msg312444 on StringTranslatePseudoMapping:

I ran a comparison of the current class vs defaultdict.

This was my test:
```
with open('/home/cheryl/cpython/Lib/idlelib/pyparse.py') as fd:
code = fd.read()
copies = 2
code *= copies
for i in range(10):
start = time.time()
trans_code = code.translate(_tran)
end = time.time()
print(f'copies: {copies}   translate time: {end - start}')
```

I ran the current `_tran` first and saved the results.
```
_tran = {}
_tran.update((ord(c), ord('(')) for c in "({[")
_tran.update((ord(c), ord(')')) for c in ")}]")
_tran.update((ord(c), ord(c)) for c in "\"'\\\n#")
_tran = StringTranslatePseudoMapping(_tran, default_value=ord('x'))
```
I know time.time isn't perfect, but thought it might be good enough.  The 
results:
copies: 2   translate time: 0.8162932395935059
copies: 2   translate time: 0.610985517501831
copies: 2   translate time: 0.8164870738983154
copies: 2   translate time: 0.6125986576080322
copies: 2   translate time: 0.8143167495727539
copies: 2   translate time: 0.612929105758667
copies: 2   translate time: 0.8299245834350586
copies: 2   translate time: 0.6127865314483643
copies: 2   translate time: 0.812185525894165
copies: 2   translate time: 0.6151354312896729


Then I changed it to a defaultdict:
```
_tran = defaultdict(lambda: 'x')
 # _tran = {}
_tran.update((ord(c), ord('(')) for c in "({[")
_tran.update((ord(c), ord(')')) for c in ")}]")
_tran.update((ord(c), ord(c)) for c in "\"'\\\n#")
# _tran = StringTranslatePseudoMapping(_tran, default_value=ord('x'))
```

I compared the results to make sure the defaultdict produced the same output as 
the mapping, which it did.

The results:
copies: 2   translate time: 0.8172969818115234
copies: 2   translate time: 0.6214878559112549
copies: 2   translate time: 0.8143007755279541
copies: 2   translate time: 0.6127951145172119
copies: 2   translate time: 0.8154017925262451
copies: 2   translate time: 0.6144123077392578
copies: 2   translate time: 0.8128812313079834
copies: 2   translate time: 0.6167266368865967
copies: 2   translate time: 0.8143749237060547
copies: 2   translate time: 0.6116495132446289


So, the results are simliar, down to the alternating of .61ish and .81ish times.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32928] _findvs failing on Windows 10 (Release build only)

2018-02-24 Thread William Pickard

William Pickard  added the comment:

The powershell module that interacts with the API works if I don't supply 
"-All", supplying said option produces the same issue that is plagues me when 
_findvs.findall() is used.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5628

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-24 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5627

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32928] _findvs failing on Windows 10 (Release build only)

2018-02-24 Thread Steve Dower

Steve Dower  added the comment:

If you think it should be working, go ahead and use the Report a Problem tool 
in VS to let the team know about the PowerShell module. There might be a case 
that isn't handled properly in their code that they can fix (obviously they 
don't know/care about the Python module, but we are using the same API).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 42c35d9c0c8175332f50fbe034a001fe52f057b9 by Serhiy Storchaka in 
branch 'master':
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
https://github.com/python/cpython/commit/42c35d9c0c8175332f50fbe034a001fe52f057b9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



How to extract the raw bytes of the decoded unicode?

2018-02-24 Thread Peng Yu
Hi,

I can extracted the encoded value as bytes. But is there a way to
extracted the decoded value (for á, it is C1)? Thanks.

$ cat ./dumpunicode.py
#!/usr/bin/env python3

while True:
c = sys.stdin.read(1)
if c:
print(c)
print('0x' + ''.join(['%x' % x for x in reversed(bytes(c,
encoding='utf-8'))]))
else:
break
$ ./dumpunicode.py <<< á
á
0xa1c3


0xa


-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


SQLObject 3.6.0

2018-02-24 Thread Oleg Broytman
Hello!

I'm pleased to announce version 3.6.0, the first stable release of branch
3.6 of SQLObject.


What's new in SQLObject
===

Contributor for this release is Michael S. Root.

Minor features
--

* Close cursors after using to free resources immediately
  instead of waiting for gc.

Bug fixes
-

* Fix for TypeError using selectBy on a BLOBCol. PR by Michael S. Root.

Drivers
---

* Extend support for oursql and Python 3 (requires our fork of the driver).

* Fix cursor.arraysize - pymssql doesn't have arraysize.

* Set timeout for ODBC with MSSQL.

* Fix _setAutoCommit for MSSQL.

Documentation
-

* Document extras that are available for installation.

Build
-

* Use ``python_version`` environment marker in ``setup.py`` to make
  ``install_requires`` and ``extras_require`` declarative. This makes
  the universal wheel truly universal.

* Use ``python_requires`` keyword in ``setup.py``.

For a more complete list, please see the news:
http://sqlobject.org/News.html


What is SQLObject
=

SQLObject is an object-relational mapper.  Your database tables are described
as classes, and rows are instances of those classes.  SQLObject is meant to be
easy to use and quick to get started with.

SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite,
Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB).

Python 2.7 or 3.4+ is required.


Where is SQLObject
==

Site:
http://sqlobject.org

Development:
http://sqlobject.org/devel/

Mailing list:
https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss

Download:
https://pypi.python.org/pypi/SQLObject/3.6.0

News and changes:
http://sqlobject.org/News.html

StackOverflow:
https://stackoverflow.com/questions/tagged/sqlobject


Example
===

Create a simple class that wraps a table::

  >>> from sqlobject import *
  >>>
  >>> sqlhub.processConnection = connectionForURI('sqlite:/:memory:')
  >>>
  >>> class Person(SQLObject):
  ... fname = StringCol()
  ... mi = StringCol(length=1, default=None)
  ... lname = StringCol()
  ...
  >>> Person.createTable()

Use the object::

  >>> p = Person(fname="John", lname="Doe")
  >>> p
  
  >>> p.fname
  'John'
  >>> p.mi = 'Q'
  >>> p2 = Person.get(1)
  >>> p2
  
  >>> p is p2
  True

Queries::

  >>> p3 = Person.selectBy(lname="Doe")[0]
  >>> p3
  
  >>> pc = Person.select(Person.q.lname=="Doe").count()
  >>> pc
  1

Oleg.
-- 
 Oleg Broytmanhttp://phdru.name/p...@phdru.name
   Programmers don't die, they just GOSUB without RETURN.
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


SQLObject 3.6.0

2018-02-24 Thread Oleg Broytman
Hello!

I'm pleased to announce version 3.6.0, the first stable release of branch
3.6 of SQLObject.


What's new in SQLObject
===

Contributor for this release is Michael S. Root.

Minor features
--

* Close cursors after using to free resources immediately
  instead of waiting for gc.

Bug fixes
-

* Fix for TypeError using selectBy on a BLOBCol. PR by Michael S. Root.

Drivers
---

* Extend support for oursql and Python 3 (requires our fork of the driver).

* Fix cursor.arraysize - pymssql doesn't have arraysize.

* Set timeout for ODBC with MSSQL.

* Fix _setAutoCommit for MSSQL.

Documentation
-

* Document extras that are available for installation.

Build
-

* Use ``python_version`` environment marker in ``setup.py`` to make
  ``install_requires`` and ``extras_require`` declarative. This makes
  the universal wheel truly universal.

* Use ``python_requires`` keyword in ``setup.py``.

For a more complete list, please see the news:
http://sqlobject.org/News.html


What is SQLObject
=

SQLObject is an object-relational mapper.  Your database tables are described
as classes, and rows are instances of those classes.  SQLObject is meant to be
easy to use and quick to get started with.

SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite,
Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB).

Python 2.7 or 3.4+ is required.


Where is SQLObject
==

Site:
http://sqlobject.org

Development:
http://sqlobject.org/devel/

Mailing list:
https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss

Download:
https://pypi.python.org/pypi/SQLObject/3.6.0

News and changes:
http://sqlobject.org/News.html

StackOverflow:
https://stackoverflow.com/questions/tagged/sqlobject


Example
===

Create a simple class that wraps a table::

  >>> from sqlobject import *
  >>>
  >>> sqlhub.processConnection = connectionForURI('sqlite:/:memory:')
  >>>
  >>> class Person(SQLObject):
  ... fname = StringCol()
  ... mi = StringCol(length=1, default=None)
  ... lname = StringCol()
  ...
  >>> Person.createTable()

Use the object::

  >>> p = Person(fname="John", lname="Doe")
  >>> p
  
  >>> p.fname
  'John'
  >>> p.mi = 'Q'
  >>> p2 = Person.get(1)
  >>> p2
  
  >>> p is p2
  True

Queries::

  >>> p3 = Person.selectBy(lname="Doe")[0]
  >>> p3
  
  >>> pc = Person.select(Person.q.lname=="Doe").count()
  >>> pc
  1

Oleg.
-- 
 Oleg Broytmanhttp://phdru.name/p...@phdru.name
   Programmers don't die, they just GOSUB without RETURN.
-- 
https://mail.python.org/mailman/listinfo/python-list


read Unicode characters one by one in python2

2018-02-24 Thread Peng Yu
Here shows some code for reading Unicode characters one by one in
python2. Is it the best code for reading Unicode characters one by one
in python2?

https://rosettacode.org/wiki/Read_a_file_character_by_character/UTF8#Python

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32929] Change dataclasses hashing to use unsafe_hash boolean (default to False)

2018-02-24 Thread Guido van Rossum

Guido van Rossum  added the comment:

It is important to convey the idea that if you are thinking of using this you 
are probably doing something fishy.

An alternative could be `_hash`, which at least indicates it is not for general 
use, like `sys._getframe()`.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32928] _findvs failing on Windows 10 (Release build only)

2018-02-24 Thread William Pickard

William Pickard  added the comment:

Looks like something wierd about my computer as the powershell module that 
interacts with the API also has the issue with Windows reporting "File not 
found" for a 2nd instance (maybe Community edition of VS)

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32939] IDLE: self.use_context_ps1 defined in editor, but always False

2018-02-24 Thread Cheryl Sabella

New submission from Cheryl Sabella :

In the EditorWindow in editor.py, there is an attribute called 
`self.context_use_ps1` that is only set to False.

Changed to an instance variable in:
https://github.com/python/cpython/commit/6af44986029c84c4c5df62a64c60a6ed978a3693
 

Removed from pyshell in:
https://github.com/python/cpython/commit/e86172d63af5827a3c2b55b80351cb38a26190eb

--
assignee: terry.reedy
components: IDLE
messages: 312727
nosy: csabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: self.use_context_ps1 defined in editor, but always False
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

New issue:

find_good_parse_start() call in editor.py has the wrong signature.  There's 
actually a few things going on here.  Here's the section in editor:
```
if not self.context_use_ps1:
for context in self.num_context_lines:
startat = max(lno - context, 1)
startatindex = repr(startat) + ".0"
rawtext = text.get(startatindex, "insert")
y.set_code(rawtext)
bod = y.find_good_parse_start(
  self.context_use_ps1, 
self._build_char_in_string_func(startatindex))
if bod is not None or startat == 1:
break
y.set_lo(bod or 0)
else:
r = text.tag_prevrange("console", "insert")
if r:
startatindex = r[1]
else:
startatindex = "1.0"
rawtext = text.get(startatindex, "insert")
y.set_code(rawtext)
y.set_lo(0)
```

1. self.context_use_ps1 is always False.  There's no where in IDLE that it can 
be set to True.  I'll open an another issue for this since it's really not 
pyparse.

2. The call to find_good_parse_start:
```
bod = y.find_good_parse_start(
  self.context_use_ps1, 
self._build_char_in_string_func(startatindex))
```
sends 3 parameters.  And in pyparse, the signature allows 3.  However, the 
signature is:
```
def find_good_parse_start(self, is_char_in_string=None,
  _synchre=_synchre):
```

This means that the False self.use_context_ps1 is the first value instead of 
the function, so pyparse is always executing:
```
if not is_char_in_string:
# no clue -- make the caller pass everything
return None
```
In the test, I had assumed this was for the default of None.  Bad assumption.  
:-(

Here's the commit that changed the signature:
https://github.com/python/cpython/commit/b17544551fc8dfd1304d5679c6e444cad4d34d97

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32819] match_hostname() error reporting bug

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:

Don't worry, it happens automatically when somebody replies to a pending ticket 
w/o closing it explicitly.

I need to backport the patch manually.

--
resolution: fixed -> 
stage: resolved -> needs patch
status: pending -> open
versions: +Python 2.7, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32819] match_hostname() error reporting bug

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:

I also fixed an issue for Brandon's backport, 
https://bitbucket.org/brandon/backports.ssl_match_hostname/issues/12/update-to-implementation-from-37

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32819] match_hostname() error reporting bug

2018-02-24 Thread Alex Gaynor

Alex Gaynor  added the comment:

(Didn't mean to update status)

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32819] match_hostname() error reporting bug

2018-02-24 Thread Alex Gaynor

Alex Gaynor  added the comment:

Can confirm, no browsers do partial (or multiple) wildcards and the CABF rules 
don't allow public CAs to issue them.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32819] match_hostname() error reporting bug

2018-02-24 Thread Christian Heimes

Christian Heimes  added the comment:

master and 3.7 are fixed.

Should I backport the issue to 2.7 and 3.6, too? It changes behavior slightly 
because it drops support for partial wildcards. RFC 6125 consider it an 
optional feature. AFAIK browsers don't match them either.

--
nosy: +alex, dstufft, janssen
resolution:  -> fixed
stage: patch review -> resolved
status: open -> pending
versions: +Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to make Python run as fast (or faster) than Julia

2018-02-24 Thread bartc

On 24/02/2018 02:05, Steven D'Aprano wrote:

On Fri, 23 Feb 2018 19:25:35 +, bartc wrote:



Python is 10 times slower than a competitor = doesn't matter
My language is 1.5 times slower than the big boys' = matters
a great deal



As for Python's order-of-magnitude speed difference, thank you for being
generous.


Actually that comparison was with a competitor, ie. another dynamic 
language, because I understand such languages work in different fields 
from the Cs and C++s.


I'm sure there must be some that are faster (years since I've looked at 
the field), but I vaguely had in mind mine. Although since then, CPython 
has gotten faster.


Note that there are JIT-based implementations now which can give very 
good results (other than PyPy) with dynamic languages.


My own efforts are still byte-code based so are unlikely to get any 
faster. But they are also very simple.



So it is quite possible to get practical work done and be a competitive,
useful language despite being (allegedly) a thousand or more times slower
than C.


Of course. I've been using a dynamic scripting language as an adjunct to 
my compiled applications since the mid 80s. Then they were crude and 
hopelessly slow (and machines were a lot slower too), but they could 
still be tremendously useful with the right balance.


But the faster they are, the more work they can take over.


--
bartc
--
https://mail.python.org/mailman/listinfo/python-list


[issue32146] multiprocessing freeze_support needed outside win32

2018-02-24 Thread bbayles

Change by bbayles :


--
pull_requests: +5626

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32930] [help][webbrowser always opens new tab. I want to open in the same tab]

2018-02-24 Thread TitanSnow

TitanSnow  added the comment:

Yes, I think so.

Maybe, in a web application, to achieve this,
the way is to use a GUI library then use its
web view widget.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32938] webbrowser: Add options for private mode

2018-02-24 Thread Cheryl Sabella

New submission from Cheryl Sabella :

When looking at the command line option page for Mozilla 
(https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options), I 
noticed options for opening a private mode window (-private-window or 
-private-window URL).  

Chrome also has an --incognito switch.  
(https://peter.sh/experiments/chromium-command-line-switches/)

Maybe it would be nice to add a flag to allow for options?

--
components: Library (Lib)
messages: 312719
nosy: csabella
priority: normal
severity: normal
status: open
title: webbrowser: Add options for private mode
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >