[issue21145] Add the @cached_property decorator

2018-05-18 Thread Carl Meyer
Carl Meyer added the comment: Oops, never mind; closed mine as dupe. -- ___ Python tracker ___

[issue33577] remove wrapping of __set_name__ exceptions in RuntimeError

2018-05-18 Thread Carl Meyer
Carl Meyer added the comment: Oops, duplicate of issue33576. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker

[issue21145] Add the @cached_property decorator

2018-05-18 Thread Carl Meyer
Carl Meyer added the comment: Makes sense to me. Sounds like a separate issue and PR; I filed issue33577 and will work on a patch. -- ___ Python tracker

[issue33577] remove wrapping of __set_name__ exceptions in RuntimeError

2018-05-18 Thread Carl Meyer
New submission from Carl Meyer : Per Nick Coghlan in discussion on issue21145: "I think it would make sense to remove the exception wrapping from the __set_name__ calls - I don't think we're improving the ease of understanding the tracebacks by converting everything to a

[issue21145] Add the @cached_property decorator

2018-05-18 Thread Nick Coghlan
Nick Coghlan added the comment: I filed https://bugs.python.org/issue33576 to cover removing the exception wrapping from __set_name__ errors. -- ___ Python tracker

[issue33576] Remove exception wrapping from __set_name__ calls

2018-05-18 Thread Nick Coghlan
New submission from Nick Coghlan : Type creation currently wraps all exceptions raised by __set_name__ calls with a generic RuntimeError: https://github.com/python/cpython/blob/master/Objects/typeobject.c#L7263 Unfortunately, this makes it difficult to use __set_name__ for

[issue21145] Add the @cached_property decorator

2018-05-18 Thread Nick Coghlan
Nick Coghlan added the comment: I think it would make sense to remove the exception wrapping from the __set_name__ calls - I don't think we're improving the ease of understanding the tracebacks by converting everything to a generic RuntimeError, and we're hurting the UX

[issue21145] Add the @cached_property decorator

2018-05-18 Thread Carl Meyer
Carl Meyer added the comment: Sent a PR with the patch. Nick, I tried your `__set_name__` proposal to get an earlier error in case of an object with slots, but it has the downside that Python seems to always raise a new chained exception if `__set_name__` raises any

[issue21145] Add the @cached_property decorator

2018-05-18 Thread Carl Meyer
Change by Carl Meyer : -- pull_requests: +6636 stage: -> patch review ___ Python tracker ___

Numpy array

2018-05-18 Thread Sharan Basappa
This is regarding numpy array. I am a bit confused how parts of the array are being accessed in the example below. 1 import scipy as sp 2 data = sp.genfromtxt("web_traffic.tsv", delimiter="\t") 3 print(data[:10]) 4 x = data[:,0] 5 y = data[:,1] Apparently, line 3 prints the first 10 entries in

[issue19251] bitwise ops for bytes of equal length

2018-05-18 Thread Nick Coghlan
Nick Coghlan added the comment: I think Antoine's right that another venue (such as python-ideas) might be a better venue for this discussion, but I'll still try to explain the potential analogy I see to bytes.upper()/.lower()/etc: those operations let you treat ASCII

[issue33528] os.getentropy support

2018-05-18 Thread David Carlier
David Carlier added the comment: Those are valid points honestly. OpenBSD's getentropy works that way indeed (getentropy has also been implemented into FreeBSD in the CURRENT branch couple of months ago). So indeed os.urandom provides already a wrapping usage only this

[issue33575] Python relies on C undefined behavior float-cast-overflow

2018-05-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: You might want to have a look at #20941. Arguably ubsan is too pendantic in some of these cases. -- nosy: +benjamin.peterson ___ Python tracker

[issue33499] Environment variable to set alternate location for pycache tree

2018-05-18 Thread Carl Meyer
Carl Meyer added the comment: Cool, thanks for the pointer on -X. PR is updated with `-X bytecode_path=PATH`; don't think it's critical to have it, but it wasn't that hard to add. -- ___ Python tracker

[issue20941] pytime.c:184 and pytime.c:218: runtime error, outside the range of representable values of type 'long'

2018-05-18 Thread Martin Panter
Martin Panter added the comment: I don’t know; I haven’t tested it. I was anticipating that it is fixed, but perhaps I should leave the resolution alone instead? -- ___ Python tracker

[issue20941] pytime.c:184 and pytime.c:218: runtime error, outside the range of representable values of type 'long'

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: "resolution: out of date" Is this issue fixed or not? It's still open. -- ___ Python tracker

[issue20941] pytime.c:184 and pytime.c:218: runtime error, outside the range of representable values of type 'long'

2018-05-18 Thread Martin Panter
Martin Panter added the comment: Maybe worth checking if this is fixed due to the changes in Issue 31373 for 3.6+. -- nosy: +martin.panter resolution: -> out of date superseder: -> demoting floating float values to unrepresentable types is undefined behavior

[issue33321] Add a Linux clang ubsan undefined behavior sanitizer buildbot

2018-05-18 Thread Martin Panter
Martin Panter added the comment: Perhaps your “ctypes” problems may be helped by my ctypes_v2.patch in Issue 1621. Or perhaps they are already documented in Issue 15119 and/or Issue 28169. -- nosy: +martin.panter ___ Python

decorat{or,ion}

2018-05-18 Thread Mike McClain
Let's say I want something that does most or all of foo's functionality plus a little more and maybe tweek some of foo's output, so I write a wrapper around foo and call it bar. If inside bar are the call to foo, as well as methods baz(), buz() and bug() that make their magic and bar ends up

[issue1621] Do not assume signed integer overflow behavior

2018-05-18 Thread Martin Panter
Martin Panter added the comment: Sorry I haven’t made a PR for ctypes_v2.patch, but I don’t mind if someone else takes over. I understand the HAVE_LONG_LONG check may no longer necessary for newer Python versions. -- ___

Re: what does := means simply?

2018-05-18 Thread Chris Angelico
On Sat, May 19, 2018 at 11:10 AM, bartc wrote: > On 19/05/2018 02:00, Steven D'Aprano wrote: >> >> On Fri, 18 May 2018 20:42:05 -0400, Dennis Lee Bieber wrote: >> >>> Unfortunately -- in the current era, "text" means "a defined >> >> encoding", >> >> Text has ALWAYS meant

Re: what does := means simply?

2018-05-18 Thread bartc
On 19/05/2018 02:00, Steven D'Aprano wrote: On Fri, 18 May 2018 20:42:05 -0400, Dennis Lee Bieber wrote: Unfortunately -- in the current era, "text" means "a defined encoding", Text has ALWAYS meant "a defined encoding". It is just that for a long time, people could get away with

Re: what does := means simply?

2018-05-18 Thread bartc
On 19/05/2018 01:42, Dennis Lee Bieber wrote: On Fri, 18 May 2018 22:53:06 +0100, bartc declaimed the following: I've worked with text files for 40 years. Now Python is telling me I've been doing it wrong all that time! Look at the original code I posted from which this

Re: what does := means simply?

2018-05-18 Thread Steven D'Aprano
On Fri, 18 May 2018 20:42:05 -0400, Dennis Lee Bieber wrote: > Unfortunately -- in the current era, "text" means "a defined encoding", Text has ALWAYS meant "a defined encoding". It is just that for a long time, people could get away with assuming that the encoding they used was the

Re: what does := means simply?

2018-05-18 Thread bartc
On 19/05/2018 01:00, Chris Angelico wrote: On Sat, May 19, 2018 at 7:53 AM, bartc wrote: I've worked with text files for 40 years. Now Python is telling me I've been doing it wrong all that time! Look at the original code I posted from which this Python was based. That

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-18 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 436972e295f5057fe7cdd7312f543c2fa884705d by Gregory P. Smith (Miss Islington (bot)) in branch '3.7': bpo-19950: Clarify unittest TestCase instance use. (GH-6875) (GH-6938)

[issue19950] Document that unittest.TestCase.__init__ is called once per test

2018-05-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset a5f33a899f6450de96f5e4cd154de4486d50bdd7 by Gregory P. Smith (Miss Islington (bot)) in branch '3.6': bpo-19950: Clarify unittest TestCase instance use. (GH-6875) (GH-6939)

[issue20104] expose posix_spawn(p)

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: > I originally removed it from the configure script in PR6794 but it was > reintroduced in commit 57009526f6a405e0ffe8c16012cce509b62cb577. Check the PR > for Greg's rationale. Oh ok. -- ___

[issue33565] strange tracemalloc results

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: tracemalloc doesn't track memory leaks. It tracks memory allocations. I'm not sure that you are using tracemalloc properly. I suggest you to enable tracemalloc as soon as possible, take snapshot frequently (eg. at each iteration) and

[issue33565] strange tracemalloc results

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: Once you found and fixed your memory leak, any documentation enhancement is welcome :-) -- ___ Python tracker

[issue33531] test_asyncio: test_subprocess test_stdin_broken_pipe() failure on Travis CI

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: Terry: " The Travis retest (for 3.7 backport) just failed with the same errors. Why can't we disable this tests. It now takes hours to do a merge with two backports." Usually, I prefer to try to understand a bug before disabling, even

[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___

[issue28584] ICC compiler check is too permissive

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___

[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___

[issue26819] _ProactorReadPipeTransport pause_reading()/resume_reading() broken if called before any read is perfored

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___

[issue33501] split existing optimization levels into granular options

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: I'm not sure that the bug tracker is the best place to propose such idea. Maybe start a new thread on python-ideas? -- ___ Python tracker

[issue21145] Add the @cached_property decorator

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___

[issue33528] os.getentropy support

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: I know two main use cases for random numbers: * security: use os.urandom(), secrets and random.SystemRandom * not security: use the random module Exposing os.getentropy() seems like a new non-portable function for the first use case,

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: > Sorry for mixing two things here, but I meant that I found out about this > because of the private API use in gdb, however nothing from the change is > documented on whatsnew at all. It seems like there is at least one change in the

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: Oh, it seems like I was wrong in my previous comment. Python 2.7 code base is already designed to support native TLS. It's just that we only implement native TLS on Windows. So yeah, it seems doable to implement native TLS for pthread.

[issue20104] expose posix_spawn(p)

2018-05-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I originally removed it from the configure script in PR6794 but it was reintroduced in commit 57009526f6a405e0ffe8c16012cce509b62cb577. Check the PR for Greg's rationale. -- ___ Python

[issue32534] Speed-up list.insert: use memmove()

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: This issue is a micro-optimization which is only 1.08x faster: https://bugs.python.org/issue32534#msg310146 Moreover, it seems really hard to measure precisely the benefit on benchmarks. Results seem to not be reliable. I suggest to

[issue33575] Python relies on C undefined behavior float-cast-overflow

2018-05-18 Thread Gregory P. Smith
New submission from Gregory P. Smith : Clang's undefined behavior sanitizer is flagging several places in CPython where it is relying on float-cast-overflow behavior. Typically exposed where an out of bounds floating point value is cast to another type. The clang compiler is

Re: what does := means simply?

2018-05-18 Thread Steven D'Aprano
On Fri, 18 May 2018 22:53:06 +0100, bartc wrote: > I've worked with text files for 40 years. Now Python is telling me I've > been doing it wrong all that time! Welcome to the 20th Century! We interchange text and data with people from all over the world now, and one or two of them use characters

Re: what does := means simply?

2018-05-18 Thread Chris Angelico
On Sat, May 19, 2018 at 7:53 AM, bartc wrote: > I've worked with text files for 40 years. Now Python is telling me I've been > doing it wrong all that time! > > Look at the original code I posted from which this Python was based. That > creates a file - just a file - without

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: I backported manually the fix to Python 2.7 for int and long types. Thank you Chris Jerdonek for the bug report, and Sanyam Khurana for the bugfix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset d13169fc5ac7572a272cbcff830c3d96ba27cc7c by Victor Stinner in branch '2.7': bpo-16055: Fixes incorrect error text for int('1', base=1000) (#6980)

[issue20104] expose posix_spawn(p)

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: posix_spawn can still be found in Python 3.7: configure:11243: posix_fallocate posix_fadvise posix_spawn pread preadv preadv2 \ configure.ac:3470: posix_fallocate posix_fadvise posix_spawn pread preadv preadv2 \ pyconfig.h.in:710:/*

[issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: Thank you for the fix Pablo! -- ___ Python tracker ___

[issue33518] Add PEP to glossary

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset fb5d0aa116125dfb29a3c4d8819a38dfb2760bb9 by Victor Stinner (Andrés Delfino) in branch '3.6': [3.6] bpo-33518: Add PEP entry to documentation glossary (GH-6860) (#6935)

[issue33518] Add PEP to glossary

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset a3a554a536599189166843cd80e62d02b2b68aa8 by Victor Stinner (Andrés Delfino) in branch '3.7': [3.7] bpo-33518: Add PEP entry to documentation glossary (GH-6860) (#6934)

[issue30273] The coverage job is broken: distutils build_ext fails on None

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: https://github.com/python/cpython/pull/1515 has the "needs backport to 2.7" label, but I'm unable to reproduce the bug on Python 2.7: * Python 2.7 has no "venv" module * When I compile Python out of tree, and then use "virtualenv -p

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +6635 ___ Python tracker ___ ___

[issue28556] typing.py upgrades

2018-05-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 09ca5906b7d1619b7efed0bebb6f3c424fe3d83b by Ivan Levkivskyi (Miss Islington (bot)) in branch '3.7': bpo-28556: Don't simplify unions at runtime (GH-6841) (GH-6979)

[issue33521] Add 1.32x faster C implementation of asyncio.isfuture().

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: About the benchmark: you should not loop inside the function. I propose a variant of the benchmark: isfuture_benchmark2.py. Jimmy: Would you mind to run this variant on your PR? -- Added file:

[issue28556] typing.py upgrades

2018-05-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6634 ___ Python tracker ___

[issue28556] typing.py upgrades

2018-05-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset f65e31fee3b55dfb6ed5398179d5c5d6b502dee5 by Ivan Levkivskyi in branch 'master': bpo-28556: Don't simplify unions at runtime (GH-6841) https://github.com/python/cpython/commit/f65e31fee3b55dfb6ed5398179d5c5d6b502dee5

[issue32996] Improve What's New in 3.7

2018-05-18 Thread Elvis Pranskevichus
Change by Elvis Pranskevichus : -- pull_requests: +6633 ___ Python tracker ___ ___

Re: syntax oddities

2018-05-18 Thread José María Mateos
On Fri, May 18, 2018 at 02:55:52PM +, Grant Edwards wrote: > You work someplace pretty unique. Everyplace I've worked has done the > whole top-posting and include the whole damn thread in reverse order > thing. It just doesn't work. The attached reverse-chronological > history doesn't seem

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread R. David Murray
R. David Murray added the comment: Yes, you are substantially correct. A subtlety that may enhance your understanding (if it doesn't instead totally confuse you :) is that __init__ is simply the most straightforward way to affect the module namespace. You would see

Re: syntax oddities

2018-05-18 Thread José María Mateos
On Thu, May 17, 2018 at 07:56:41AM -0700, Rich Shepard wrote: > Allow me to add an additional reason for trimming and responding > beneath each quoted section: it puts the response in the proper > context. And another one I learned recently on a similar conversation on another mailing list

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread Rolf Campbell
Rolf Campbell added the comment: OK, OK, I think I finally understand what you mean here. Let me try to repeat it just to make sure I really understand: When requesting a member of a multi-file module (like "func" in my example), python only tries to load that

Re: what does := means simply?

2018-05-18 Thread bartc
On 18/05/2018 19:57, Chris Angelico wrote: On Sat, May 19, 2018 at 4:48 AM, bartc wrote: The translation was straightforward, EXCEPT that I wasted an hour trying to figure out to write /a single byte/ to a file. The following eventually worked, using a binary file as a text

[issue33447] Asynchronous lambda syntax

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: The only thing special about functions defined with lambda expressions rather than def statements is the generic name attribute '' instead of a specific name. PEP8 intentionally and properly discourages 'name = lambda ...' as inferior to

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread R. David Murray
R. David Murray added the comment: It's the same answer. __init__ *is* the package namespace, so you are setting the value of 'func' in the package (.) namespace, and what import is doing is correct. I know this is confusing. I banged my head against it while

[issue33540] socketserver: Add an opt-in option to get Python 3.6 behaviour on server_close()

2018-05-18 Thread Ned Deily
Ned Deily added the comment: It would be great if someone(s) could give PR 6911 a review, since it is a release blocker for 3.7.0rc1. Thanks! -- ___ Python tracker

Re: what does := means simply?

2018-05-18 Thread bartc
On 18/05/2018 20:15, Alexandre Brault wrote: On 2018-05-18 02:48 PM, bartc wrote: Note this version doesn't use any imports at all. Except your version doesn't read its parameter from the command line args and doesn't output to standard output, which all of the others do. That's why the

Re: About: from sklearn import linear_model ModuleNotFoundError: No module named sklearn

2018-05-18 Thread jladasky
On Thursday, May 17, 2018 at 4:54:11 AM UTC-7, Jpn Jha wrote: > Dear Team > Please attached Python_PyCharm Interpreter doc and zoom it . > > The screen shots are explanatory. The Python mailing list is text-only. Your screen shots were removed. In general, please don't use screenshots when

[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-18 Thread Andrew Gaul
Change by Andrew Gaul : -- nosy: +gaul ___ Python tracker ___ ___ Python-bugs-list mailing

[issue30437] SSL_shutdown needs SSL_read() until SSL_ERROR_ZERO_RETURN

2018-05-18 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +6632 stage: -> patch review ___ Python tracker ___

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Steve Dower
Steve Dower added the comment: GitHub has broken CSS everywhere right now :) Their oauth page doesn't show scroll bars either, which means you can't get to the "authorise" button if you're in more than a couple of organisations. --

[issue33574] Conversion of Number to String(str(number))

2018-05-18 Thread Eric V. Smith
Eric V. Smith added the comment: The way to avoid this problem is to not assign to str. You should not shadow python builtins that you want to continue using. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: compile

[issue33447] Asynchronous lambda syntax

2018-05-18 Thread Yury Selivanov
Yury Selivanov added the comment: The syntax for async lambdas doesn't look nice and I, personally, don't see that many use cases for them to justify adding new syntax. And this would need a new PEP. I suggest to start a discussion on the Python-ideas mailing list if

[issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes

2018-05-18 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +6631 stage: test needed -> patch review ___ Python tracker ___

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread Zachary Ware
Zachary Ware added the comment: Done, thanks Skip :) Can we convince you to reclaim your commit bits so you can click the buttons yourself next time? ;) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread Zachary Ware
Zachary Ware added the comment: New changeset abde17e663edd6437cc7eb0405fe418449a25d72 by Zachary Ware (Miss Islington (bot)) in branch '3.7': bpo-33556: Remove reference to thread module from docstring (GH-6963)

[issue33572] Better document mixed-type comparison of set items, dict keys

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: With Tim's addition >>> from fractions import Fraction as F >>> from decimal import Decimal as D >>> s = {0, 1, 0.0, 1.0, F(0,1), F(1, 1), D(0), D(1), False, True} >>> s {0, 1} I think we should consider moving the main discussion of the

[issue33565] strange tracemalloc results

2018-05-18 Thread Alexander Mohr
Alexander Mohr added the comment: here's a version that tries to do something similar but does not reproduce the issue -- Added file: https://bugs.python.org/file47602/tracemalloc_test2.py ___ Python tracker

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread miss-islington
miss-islington added the comment: New changeset c6a5cc8f244ee71ce932003366411aacadda8dd0 by Miss Islington (bot) in branch '3.6': bpo-33556: Remove reference to thread module from docstring (GH-6963)

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread Rolf Campbell
Change by Rolf Campbell : -- resolution: not a bug -> ___ Python tracker ___

[issue33574] Conversion of Number to String(str(number))

2018-05-18 Thread Khalid Moh'd.
New submission from Khalid Moh'd. : Consider conversion of an integer to string: a=5 #number str #outputs str(a) #works perfectly and prints '5' Now, consider: str="Hello World" #reads the string str #prints "Hello World" str(5) #gives an error Interpreter considers

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread Rolf Campbell
Rolf Campbell added the comment: Re-opening because I've found a simple example that does not involve __main__. ./func/__init__.py:func = 1 ./func/__init__.py:from . import func ./func/__init__.py:print(f"Namespace value of func after func module import:{func}")

[issue33573] statistics.median does not work with ordinal scale

2018-05-18 Thread W deW
New submission from W deW : The 0.5-quantile or median is defined for ordinal, interval, and ratio scales. An Enumerator as derived from Enum and extended with rich comparison methods implements an ordinal scale. Therefore calculating the median over a list of such

Re: what does := means simply?

2018-05-18 Thread Alexandre Brault
On 2018-05-18 02:48 PM, bartc wrote: > On 18/05/2018 18:27, bartc wrote: > >> (BTW here's a port of that benchmark based on the Lua code: >> >>    https://pastebin.com/raw/ivDaKudX > > And here's the payoff: I was able to use this version to port it to > Python. One which works better the the

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- assignee: -> docs@python components: +Documentation -Interpreter Core nosy: +docs@python ___ Python tracker

Re: what does := means simply?

2018-05-18 Thread Chris Angelico
On Sat, May 19, 2018 at 4:53 AM, bartc wrote: > On 18/05/2018 19:36, Chris Angelico wrote: >> >> On Sat, May 19, 2018 at 3:27 AM, bartc wrote: > > >> Once again, you're confusing *porting* with *emulating*. > > > This is the point. Those libraries are specific

Re: what does := means simply?

2018-05-18 Thread Chris Angelico
On Sat, May 19, 2018 at 4:48 AM, bartc wrote: > The translation was straightforward, EXCEPT that I wasted an hour trying to > figure out to write /a single byte/ to a file. The following eventually > worked, using a binary file as a text one had Unicode problems, but it's > still

Re: what does := means simply?

2018-05-18 Thread bartc
On 18/05/2018 19:36, Chris Angelico wrote: On Sat, May 19, 2018 at 3:27 AM, bartc wrote: Once again, you're confusing *porting* with *emulating*. This is the point. Those libraries are specific to Python and cannot be ported. And very often they don't just provide

Re: what does := means simply?

2018-05-18 Thread bartc
On 18/05/2018 18:27, bartc wrote: (BTW here's a port of that benchmark based on the Lua code:   https://pastebin.com/raw/ivDaKudX And here's the payoff: I was able to use this version to port it to Python. One which works better the the originals, as they wrote output to the screen

Re: Fwd: sys module does not contain ps1

2018-05-18 Thread Terry Reedy
On 5/18/2018 7:40 AM, Alferdize wrote: -- Forwarded message -- From: Alferdize Date: Thu, May 17, 2018 at 10:13 PM Subject: sys module does not contain ps1 To: python-list@python.org It is giving error like I have given below import sys sys.ps1

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6630 ___ Python tracker ___

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6629 ___ Python tracker ___

Re: what does := means simply?

2018-05-18 Thread Chris Angelico
On Sat, May 19, 2018 at 3:27 AM, bartc wrote: > On 18/05/2018 15:47, Chris Angelico wrote: >> >> On Sat, May 19, 2018 at 12:37 AM, bartc wrote: >>> >>> Have a look at some of the implementations here (to test some Mandelbrot >>> benchmark): >>> >>> >>>

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread Zachary Ware
Zachary Ware added the comment: New changeset 5634331a76dfe9fbe4b76475e11307a0922d6a15 by Zachary Ware (Skip Montanaro) in branch 'master': bpo-33556: Remove reference to thread module from docstring (GH-6963)

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Tim Peters
Tim Peters added the comment: I expect these docs date back to when ints, longs, and floats were the only hashable language-supplied types for which mixed-type comparison could ever return True. They could stand some updates ;-) `fractions.Fraction` and `decimal.Decimal`

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Mark, are you suggesting a doc addition (and a change of Components) or should we close this as 'not a bug'? -- nosy: +terry.reedy ___ Python tracker

[issue33527] Invalid child function scope

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: -> test needed versions: -Python 3.4, Python 3.5 ___ Python tracker ___

[issue33516] unittest.mock: Add __round__ to supported magicmock methods

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +michael.foord versions: +Python 3.8 ___ Python tracker ___

[issue33500] Python TKinter for Mac on latest 2.7.15 still extremely slow vs Windows

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Responses to the following might help anyone who works on this. 1. Is the relative performance only an issue on 2.7 and not 3.6+? 2. What are the 'recent issues here'? What is different about your example code. 3. We prefer plain text .py

  1   2   >