Re: N-grams

2016-11-09 Thread srinivas devaki
On Thu, Nov 10, 2016 at 12:43 PM, srinivas devaki wrote: > complexity wise it's O(N), but space complexity is O(N**2) to execute > this function, I'm sorry, that is a mistake. I just skimmed through the itertoolsmodule.c, and it seems like the space complexity is just

Re: N-grams

2016-11-09 Thread Paul Rubin
Ian Kelly writes: > I'd use the maxlen argument to deque here. Oh that's cool, it's a Python 3 thing though. > Better to move the extra yield above the loop and reorder the loop > body so that the yielded tuple includes the element just read. Thanks, I'll give that a

Re: Help me cythonize a python routine!

2016-11-09 Thread Steven D'Aprano
On Thursday 10 November 2016 18:23, Andrea D'Amore wrote: > On 10 November 2016 at 00:15, Steve D'Aprano > wrote: >> py> import collections > […] >> py> import os >> py> os.listdir('/usr/local/lib/python3.5/collections/') > > Not > >

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Steven D'Aprano
On Thursday 10 November 2016 17:43, breamore...@gmail.com wrote: > On Thursday, November 10, 2016 at 1:09:31 AM UTC, Steve D'Aprano wrote: >> > > [snipped] > > Steven, there is no need to be rude or condescending. Indeed, and if I thought you were sincere, or knew what you were objecting

Re: Help me cythonize a python routine!

2016-11-09 Thread Andrea D'Amore
On 10 November 2016 at 00:15, Steve D'Aprano wrote: > py> import collections […] > py> import os > py> os.listdir('/usr/local/lib/python3.5/collections/') Not os.listdir(collections.__path__[0]) since it's already there? -- Andrea --

Re: N-grams

2016-11-09 Thread srinivas devaki
> def ngrams(iterable, n=2): > if n < 1: > raise ValueError > t = tee(iterable, n) > for i, x in enumerate(t): > for j in range(i): > next(x, None) > return zip(*t) def myngrams(iterable, n=2): t = list(tee(iterable, 1)) for _ in range(n - 1):

[issue24329] __qualname__ and __slots__

2016-11-09 Thread Xiang Zhang
Changes by Xiang Zhang : -- keywords: +patch stage: -> patch review type: -> behavior Added file: http://bugs.python.org/file45420/slots_qualname.patch ___ Python tracker

Re: N-grams

2016-11-09 Thread Wolfram Hinderer
Am 10.11.2016 um 03:06 schrieb Paul Rubin: This can probably be cleaned up some: from itertools import islice from collections import deque def ngram(n, seq): it = iter(seq) d = deque(islice(it, n)) if len(d) != n: return for s in

[issue23839] Clear caches after every test

2016-11-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file45419/regrtest_clear_caches_3.patch ___ Python tracker ___

Re: Help me cythonize a python routine!

2016-11-09 Thread Ethan Furman
On 11/09/2016 04:30 PM, Michael Torrie wrote: On 11/09/2016 04:21 PM, Ethan Furman wrote: On 09/11/2016 21:25, breamore...@gmail.com wrote: [...filtered...] Mark, you do not need to be insulting nor condescending. Agreed. Is he still being filtered on the mailing list? He's still in my

[issue28615] Document clarification: Section 5.4 Complex Number

2016-11-09 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi, here is the doc update, to be applied to 2.7 branch. Please review. Thanks :) -- keywords: +patch nosy: +Mariatta Added file: http://bugs.python.org/file45418/issue28615.patch ___ Python tracker

Re: N-grams

2016-11-09 Thread Ian Kelly
On Wed, Nov 9, 2016 at 7:06 PM, Paul Rubin wrote: > This can probably be cleaned up some: Okay. :-) > from itertools import islice > from collections import deque > > def ngram(n, seq): Looks like "seq" can be any iterable, not just a sequence. >

I want to insert beacon scan result in to a database using python and mysql

2016-11-09 Thread sudeeratechneed
when this files run gives corresponding output values as; # test BLE Scanning software # jcs 6/8/2014 import MySQLdb as my import blescan import sys import bluetooth._bluetooth as bluez dev_id = 0 db = my.connect(host="localhost", user="root", passwd="root", db="test" ) cursor =

Re: Python rules!

2016-11-09 Thread Rustom Mody
On Thursday, November 10, 2016 at 7:02:31 AM UTC+5:30, Skip Montanaro wrote: > > Too bad that the indentation is still not actually significant. One little > > undetectable mistake with the braces and the meaning of the code is > totally > > changed. > > Maybe an Emacs mode which can toggle

Re: Python rules!

2016-11-09 Thread Skip Montanaro
On Wed, Nov 9, 2016 at 7:53 PM, Chris Angelico wrote: > It's called Jython. :) Well, sure, but that didn't look enough like Python, so no chance that I would mistake it for Jython. I suspect that whoever worked out that arrangement of semicolons and braces had some help from

Re: N-grams

2016-11-09 Thread Paul Rubin
This can probably be cleaned up some: from itertools import islice from collections import deque def ngram(n, seq): it = iter(seq) d = deque(islice(it, n)) if len(d) != n: return for s in it: yield tuple(d)

Re: Python rules!

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 12:32 PM, Skip Montanaro wrote: > > Maybe an Emacs mode which can toggle between "Java view/mode" (normal) and > "Python view/mode" (Rustom's Twitter example) would be useful. In the > latter, you'd edit the code as if it was Python and see it

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think Yury is right here. The good plan would be to add the tearDown(), but also fix the problem with test_generic_forward_ref. I could work on it tomorrow (really don't have time today, sorry). -- ___ Python

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It looks like the tearDown() works really well. It also somehow fixes the problem with test_generic_forward_ref -- ___ Python tracker

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 12:16 PM, BartC wrote: > But now that I was about to use it, another problem. The Ubuntu Python is > 2.7. The Windows one has both 2.7 and 3.4 (and my IDE can select either). > > The bit of code I wanted to run has Py3-style print functions. I tried >

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Segfault or traceback? Traceback. I should have said failed, not crashed :( > I'm not sure a crash the Python version of lru_cache with maxsize=10 is high on my list of worries. The problem is that the test fails depending on cache size, and caching

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > * It looks like that some types in the cache are being *reused* by different > tests. I also noticed this some time ago, ideally we need to make all tests more isolated between each other. > Now this all of this is just my guess of what's going on here.

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 10/11/2016 01:16, BartC wrote: I suppose I can get rid of the prints for the test I wanted to do, or find out how to do the same thing under Py2 print. Or install Py3 on Ubuntu, which is a big job and I've no idea how to switch between them. Some good news, it turned out Ubuntu had both

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Segfault or traceback? Anyway, it implements a doubly-linked list where each node is implemented as a list of 4 items... Maybe there's something in the GC code that recurses down at the C level??? I'm not sure a crash the Python version of lru_cache with

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: >> But why is this so different from the C implementation of lru_cache? > I don't know. Maybe C version of lru cache creates a bit less pressure on GC. Actually test/refleak.py now cleans up typing's lru cache & calls "gc.collect()". It seems that the typing

Re: Python rules!

2016-11-09 Thread Skip Montanaro
> Too bad that the indentation is still not actually significant. One little > undetectable mistake with the braces and the meaning of the code is totally > changed. Maybe an Emacs mode which can toggle between "Java view/mode" (normal) and "Python view/mode" (Rustom's Twitter example) would be

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > But why is this so different from the C implementation of lru_cache? I don't know. Maybe C version of lru cache creates a bit less pressure on GC. BTW, if I set maxsize=10 for typing lru_cache, test_generic_forward_ref crashes in refleak-test mode.

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: But why is this so different from the C implementation of lru_cache? -- ___ Python tracker ___

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 10/11/2016 00:38, Michael Torrie wrote: On 11/09/2016 02:10 PM, BartC wrote: Good point, I use Ubuntu under Windows. It should be child's play, except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. Something is wrong with your setup then. Because both python-numpy and

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: So Ivan made an interesting observation: if we use Python version of functools.lru_cache, typing tests start to leak like crazy: beginning 6 repetitions 123456 .. test_typing leaked [24980, 24980, 24980] references, sum=74940 I

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Steve D'Aprano
On Thu, 10 Nov 2016 11:38 am, Michael Torrie wrote: > On 11/09/2016 02:10 PM, BartC wrote: >> Good point, I use Ubuntu under Windows. It should be child's play, >> except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. > > Something is wrong with your setup then. Bart has been

[issue28653] refleak in C functools.lru_cache

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Ivan, I think I figured it out, I'll close this one and reopen the typing one. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed title: refleak in functools.lru_cache -> refleak in C functools.lru_cache

Re: Python rules!

2016-11-09 Thread Ian Kelly
On Nov 9, 2016 5:48 PM, "Michael Torrie" wrote: On 11/09/2016 12:39 PM, jlada...@itu.edu wrote: > On Wednesday, November 9, 2016 at 4:32:15 AM UTC-8, Rustom Mody wrote: >> https://twitter.com/UdellGames/status/788690145822306304 > > It took me a minute to see it. That's

Re: Python rules!

2016-11-09 Thread Michael Torrie
On 11/09/2016 05:54 PM, Chris Angelico wrote: > On Thu, Nov 10, 2016 at 11:42 AM, Michael Torrie wrote: >> On 11/09/2016 12:39 PM, jlada...@itu.edu wrote: >>> On Wednesday, November 9, 2016 at 4:32:15 AM UTC-8, Rustom Mody wrote:

Re: Python rules!

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 11:42 AM, Michael Torrie wrote: > On 11/09/2016 12:39 PM, jlada...@itu.edu wrote: >> On Wednesday, November 9, 2016 at 4:32:15 AM UTC-8, Rustom Mody wrote: >>> https://twitter.com/UdellGames/status/788690145822306304 >> >> It took me a minute to see it.

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 11:38 AM, Michael Torrie wrote: > On 11/09/2016 02:10 PM, BartC wrote: >> Good point, I use Ubuntu under Windows. It should be child's play, >> except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. > > Something is wrong with your setup

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I am not sure what does this mean, but when I remove __slots__ = () from some classes, numbers of leaked references change. -- ___ Python tracker

Re: Python rules!

2016-11-09 Thread Michael Torrie
On 11/09/2016 12:39 PM, jlada...@itu.edu wrote: > On Wednesday, November 9, 2016 at 4:32:15 AM UTC-8, Rustom Mody wrote: >> https://twitter.com/UdellGames/status/788690145822306304 > > It took me a minute to see it. That's insane! Yeah it is... however Java actually looks pretty nice without

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Michael Torrie
On 11/09/2016 02:10 PM, BartC wrote: > Good point, I use Ubuntu under Windows. It should be child's play, > except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. Something is wrong with your setup then. Because both python-numpy and python3-numpy are in the standard ubuntu

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 8:35 AM, wrote: > I don't actually use pip much myself, I use Synaptic Package Manager. Unless > you need a package from the PSF repository that Canonical doesn't have, > Synaptic should be fine for you. If you want to run the Python3 version of >

Re: Help me cythonize a python routine!

2016-11-09 Thread Michael Torrie
On 11/09/2016 04:21 PM, Ethan Furman wrote: >> On 09/11/2016 21:25, breamore...@gmail.com wrote: > > [...filtered...] > > Mark, you do not need to be insulting nor condescending. Agreed. Is he still being filtered on the mailing list? He's still in my killfile. --

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Wow. I can reproduce refleaks in test_typing, but not in test_functools. This > is weird. Indeed, I copied the new test from test_functools to test_typing, but now I see that pure Python version of lru_cache fails even if I remove this test and test that

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Anyway, this is not urgent Not so sure, a refleak in pure-python version kind of scares me. It can be a bug in the core. -- ___ Python tracker

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- stage: commit review -> needs patch ___ Python tracker ___

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > It seems to be unrelated to typing.py Wow. I can reproduce refleaks in test_typing, but not in test_functools. This is weird. -- ___ Python tracker

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Anyway, this is not urgent, typing.py uses the default version, which is the C version. -- ___ Python tracker ___

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It seems to be unrelated to typing.py With your test from test_functools: def test_lru_type_error(self): @functools.lru_cache(maxsize=None) def infinite_cache(o): pass with self.assertRaises(TypeError):

Re: is modulefinder.ModuleFinder working at all?

2016-11-09 Thread Steve D'Aprano
On Thu, 10 Nov 2016 08:08 am, Wolfgang Maier wrote: > Hi, > > I just used the stdlib's modulefinder.ModuleFinder (intended to find > modules used by a script) for the first time in my life and it just > doesn't seem to work like documented at all. > Not sure what is going on, but if I try the

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > FWIW, if I comment out this code Oh boy... This is something else. Please re-open #28649 explaining that it now leaks with pure-Python lru_cache. Could you please take a look at it? -- ___ Python tracker

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset ba59f3328032 by Yury Selivanov in branch '3.5': Issue #28653: Fix a refleak in functools.lru_cache. https://hg.python.org/cpython/rev/ba59f3328032 New changeset 5b253d641826 by Yury Selivanov in branch '3.6': Merge 3.6 (issue #28653)

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: FWIW, if I comment out this code try: from _functools import _lru_cache_wrapper except ImportError: pass in functools.py to use the pure Python version, then I get much larger numbers: $ ./python -m test -R : test_typing Run tests sequentially

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: -> yselivanov stage: patch review -> commit review ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: See http://bugs.python.org/issue28653 for details. -- ___ Python tracker ___

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
New submission from Yury Selivanov: The attached patch fixes a refleak in functools.lru_cache. -- components: Library (Lib) files: refleak.patch keywords: patch messages: 280468 nosy: gvanrossum, larry, ned.deily, serhiy.storchaka, yselivanov priority: release blocker severity: normal

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Found it, will open a separate issue. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: reflesk with only functools: def test_lru_type_error(self): @functools.lru_cache(maxsize=None) def foo(o): raise TypeError with self.assertRaises(TypeError): foo([]) --

Re: Help me cythonize a python routine!

2016-11-09 Thread Ethan Furman
On 09/11/2016 21:25, breamore...@gmail.com wrote: [...filtered...] Mark, you do not need to be insulting nor condescending. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: A very simple repro: with self.assertRaises(TypeError): Union[[]] It looks like the problem happens when a non-hashable argument is passed to cached function -- ___ Python tracker

Re: Help me cythonize a python routine!

2016-11-09 Thread Steve D'Aprano
On Thu, 10 Nov 2016 10:01 am, BartC wrote: > I haven't ruled out that collections is written in Python. But I can't > find a 'collections.py' module in my Python 3.4; the nearest is > "__init__.py". And there /is/ a lot of code there. And that's exactly right. py> import collections py>

Re: Confused with installing per-user in Windows

2016-11-09 Thread ddbug
@eryk sun: Thank you for useful reply. But note that I don't propose to touch the python interpeters (python*.exe), neither to change anything in how distutils work (about entry points). My proposal is only for the Windows-specific Py launcher. For those who runs python*.exe thru associations

Re: Help me cythonize a python routine!

2016-11-09 Thread BartC
On 09/11/2016 21:25, breamore...@gmail.com wrote: On Wednesday, November 9, 2016 at 7:34:41 PM UTC, BartC wrote: All the real work is done inside the Collections module. If that was written in Python, then you'd have to Cythonise that, and there might be quite a lot of it! But I think

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: My impression is like something wrong happens when TypeError is raised by a cached function. -- ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Oh. This is a bug in C implementation of functools.lru_cache. I'll take a look. -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Ivan, this is the part of the test that leaks: def test_extended_generic_rules_eq(self): T = TypeVar('T') U = TypeVar('U') with self.assertRaises(TypeError): Callable[[T], U][[], int] --

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury, yes I will take a look at this now. -- ___ Python tracker ___ ___

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: The specific test that leaks is test_extended_generic_rules_eq -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: With all commits pushed, test_typing still seems to leak. Ivan, do you have time to see what's going on? test_typing leaked [125, 125, 125] references, sum=375 test_typing leaked [49, 49, 49] memory blocks, sum=147 --

Re: What is currently the recommended way to work with a distutils-based setup.py that requires compilation?

2016-11-09 Thread ddbug
I am a Python beginner but would like to contribute $0.02 in absence of authoritative answers (thanks Tim J. for encouragement). After researching this topic for a while, it looks like they now recommend distributing wheels rather than sdist's. For Windows thus is reasonable, given that there

Re: is modulefinder.ModuleFinder working at all?

2016-11-09 Thread Wolfgang Maier
On 09.11.2016 22:48, Skip Montanaro wrote: I've not used it before, but I suspect it's meant to be used in "freeze" type environments. In that situation, you really do want everything reachable, whether the script imported it or not. Hmm, but that's exactly the problem. It *is* supposed to

[issue28649] refleak in typing.py

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d926b484d33a by Serhiy Storchaka in branch '3.5': Issue #28649: Clear the typing module caches when search for reference leaks. https://hg.python.org/cpython/rev/d926b484d33a New changeset caf3ceb93307 by Serhiy Storchaka in branch '3.6': Issue

Re: is modulefinder.ModuleFinder working at all?

2016-11-09 Thread Skip Montanaro
I've not used it before, but I suspect it's meant to be used in "freeze" type environments. In that situation, you really do want everything reachable, whether the script imported it or not. It doesn't take much to wind up importing much of the stdlib either. Try: python -m modulefinder -m

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread jladasky
On Wednesday, November 9, 2016 at 1:10:34 PM UTC-8, BartC wrote: > On 09/11/2016 19:44, j...@i...edu wrote: > Good point, I use Ubuntu under Windows. It should be child's play, > except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. > > 'pip' doesn't work; it needs to be

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Serhiy can you apply the non-typing.py part of typing-clear-caches.patch? The diff I applied only has the typing.py part (because I've done this upstream first). -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: #28651 opened for the general problem with empty __slots__ and gc failures. -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d920bfa5a71a by Guido van Rossum in branch '3.5': Issue #28649: typing-clear-caches.patch https://hg.python.org/cpython/rev/d920bfa5a71a New changeset bd2ec9965f47 by Guido van Rossum in branch '3.6': Issue #28649: typing-clear-caches.patch

[issue28649] refleak in typing.py

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d790078797bd by Guido van Rossum in branch '3.5': Issue #28649: fix-typing-test-v2.diff https://hg.python.org/cpython/rev/d790078797bd New changeset 43be7891b1f5 by Guido van Rossum in branch '3.6': Issue #28649: fix-typing-test-v2.diff (3.5->3.6)

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 09/11/2016 19:44, jlada...@itu.edu wrote: On Wednesday, November 9, 2016 at 5:03:30 AM UTC-8, BartC wrote: On 05/11/2016 17:10, Mr. Wrobel wrote: 1. What I have found is modified python interpreter - pypy - http://pypy.org that does not require any different approach to develop your code.

[issue28556] typing.py upgrades

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9c0df5f51baa by Guido van Rossum in branch '3.5': Issue #28556: More typing.py updates from upstream. https://hg.python.org/cpython/rev/9c0df5f51baa New changeset 9e65bc305a24 by Guido van Rossum in branch '3.6': Issue #28556: More typing.py

is modulefinder.ModuleFinder working at all?

2016-11-09 Thread Wolfgang Maier
Hi, I just used the stdlib's modulefinder.ModuleFinder (intended to find modules used by a script) for the first time in my life and it just doesn't seem to work like documented at all. Not sure what is going on, but if I try the usage example from

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 03bbee2b0d28 by Steve Dower in branch '3.6': Issue #19717: Makes Path.resolve() succeed on paths that do not exist (patch by Vajrasky Kok) https://hg.python.org/cpython/rev/03bbee2b0d28 New changeset 445415e402be by Steve Dower in branch

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Steve Dower
Steve Dower added the comment: Applied. I changed the default for the parameter and updated the docs, but the rest is as in the patch. -- assignee: -> steve.dower resolution: -> fixed stage: -> commit review ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- Removed message: http://bugs.python.org/msg280422 ___ Python tracker ___

[issue28652] Make loop methods reject socket kinds they do not support.

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 85022978d900 by Yury Selivanov in branch '3.5': Issue #28652: Make loop methods reject socket kinds they do not support. https://hg.python.org/cpython/rev/85022978d900 New changeset 1273f1a3ddf7 by Yury Selivanov in branch '3.6': Merge 3.5 (issue

[issue28652] Make loop methods reject socket kinds they do not support.

2016-11-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28652] Make loop methods reject socket kinds they do not support.

2016-11-09 Thread Yury Selivanov
New submission from Yury Selivanov: Proxy for https://github.com/python/asyncio/pull/453 -- assignee: yselivanov components: asyncio messages: 280448 nosy: gvanrossum, yselivanov priority: normal severity: normal stage: resolved status: open title: Make loop methods reject socket kinds

Re: How to handle errors?

2016-11-09 Thread Bev in TX
On UNIX type systems, the Python installer creates multiple links to the actual Python executable. For example in Python 3.5: python - link to python3.5 python3 - link to python3.5 python3.5 - actual executable Unless your script specifically requires version 3.5, then it is better to use

RE: data interpolation

2016-11-09 Thread Deborah Swanson
On Thursday, November 03, 2016 3:08 AM, Heli wrote: > I have a question about data interpolation using python. I have a big > ascii file containg data in the following format and around 200M > points. > > id, xcoordinate, ycoordinate, zcoordinate > > then I have a second file containing data

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread jladasky
On Wednesday, November 9, 2016 at 5:03:30 AM UTC-8, BartC wrote: > On 05/11/2016 17:10, Mr. Wrobel wrote: > > > 1. What I have found is modified python interpreter - pypy - > > http://pypy.org that does not require any different approach to develop > > your code. > > > > 2. And: Gpu based

Re: Python rules!

2016-11-09 Thread jladasky
On Wednesday, November 9, 2016 at 4:32:15 AM UTC-8, Rustom Mody wrote: > https://twitter.com/UdellGames/status/788690145822306304 It took me a minute to see it. That's insane! -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me cythonize a python routine!

2016-11-09 Thread BartC
On 05/11/2016 04:11, DFS wrote: It reads in a text file of the Bible, and counts the Top 20 most common words. http://www.truth.info/download/bible.htm import time; start=time.clock() import sys, string from collections import Counter #read

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Here is the corrected patch to avoid crash. -- Added file: http://bugs.python.org/file45416/fix-typing-test-v2.diff ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Serhiy's patch typing-clear-caches.patch looks good, we should apply it (fixing the code style a little bit). -- ___ Python tracker

[issue28651] Make objects with empty __slots__ GC types

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: So this patch has no impact on typing.py. Moreover, it's incomplete and fails test_gc tests, which can be fixed but not in 3.6. -- versions: -Python 3.6 ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury, _tp_cache should be the only one (of course most generic classes have > _abc_cache since GenericMeta inherits from ABCMeta) Then there is at least one more bug not related to lru_cache (or any kind of cache in typing). And it's not

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: > It fixes 96% of refleaks. In typing.py? Or generally? -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: FYI I've opened https://github.com/python/typing/issues/323 to track this upstream. -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury, _tp_cache should be the only one (of course most generic classes have _abc_cache since GenericMeta inherits from ABCMeta) -- ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Does that patch fix the refleak completely or only partially? It fixes 96% of refleaks. -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Does that patch fix the refleak completely or only partially? I tried to empty the cache in test_typing.BaseTestCase.setUp and tearDown; this doesn't fix all refleaks. Do we have some other caches in typing.py? --

  1   2   >