[issue13501] Make libedit support more generic; port readline / libedit to FreeBSD

2016-03-21 Thread Martin Panter
Martin Panter added the comment: Patch v3 is an update taking into account Ned’s comments, and my own now deeper understanding: * Reworked the --with-readline handling. Suggested options are --with-readline=editline, and --without-readline. The current behaviour (use -lreadline if possible)

[issue17167] python man page contains $Date$ in page footer

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset ed85850499bd by Benjamin Peterson in branch '3.4': remove useless $ keyword (closes #17167) https://hg.python.org/cpython/rev/ed85850499bd New changeset 86355b610d7c by Benjamin Peterson in branch '2.7': remove useless $ keyword (closes #17167)

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-21 Thread Steven D'Aprano
On Tuesday 22 March 2016 15:14, Karthik Reddy wrote: > Hi Experts, > > I am trying to post on facebook and google plus page from my > application. I am using facebook-sdk an d I am able to post using local > machine but I am not able to post from dev server. > > Can Anyone Please help me on

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Steve Dower
Steve Dower added the comment: I used the python35.dll in the embeddable install, along with the python35.zip included in there. I linked against python.h and python35.lib from a full install, but put the resulting exe in the directory with the embeddable install so it uses that instead of

Re: Convert list to another form but providing same information

2016-03-21 Thread Steven D'Aprano
On Tuesday 22 March 2016 11:31, Ben Bacarisse wrote: > Ian Kelly writes: > >> On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse >> wrote: >>> For experts here: why can't I write a lambda that has a statement in it >>> (actually I wanted two: lambda l,

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Zachary Ware
Zachary Ware added the comment: I am also unable to reproduce. I've attached the exact code I used, and built it with: cl /I "C:\Program Files\Python35\include" embtest.c /link /libpath:"C:\Program Files\Python35\libs" Output is the expected result of 'import ctypes;print(dir(ctypes))'.

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-21 Thread Mark Lawrence
On 22/03/2016 04:14, Karthik Reddy wrote: Hi Experts, I am trying to post on facebook and google plus page from my application. I am using facebook-sdk an d I am able to post using local machine but I am not able to post from dev server. Can Anyone Please help me on this. Thanks, Karthik

GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-21 Thread Karthik Reddy
Hi Experts, I am trying to post on facebook and google plus page from my application. I am using facebook-sdk an d I am able to post using local machine but I am not able to post from dev server. Can Anyone Please help me on this. Thanks, Karthik --

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Simon
Simon added the comment: I have tried with the zip file in both the exe alongside the zip and not alongside it, (mine was not). And I get the same error in both cases. I am using Windows 10, VS2015. I compile the Python35.dll directly and my config is default, I don't change anything

Re: Copy To Clipboard Highlighted Text From Text Widget

2016-03-21 Thread Chris Angelico
On Tue, Mar 22, 2016 at 2:36 PM, Wildman via Python-list wrote: > Thanks. I changed the code as you (and MRAB) suggested. > > def copy_clipboard(self): > try: > text2copy = self.text.get(tk.SEL_FIRST, tk.SEL_LAST) > except tk.TclError: > text2copy

Re: Copy To Clipboard Highlighted Text From Text Widget

2016-03-21 Thread Wildman via Python-list
On Tue, 22 Mar 2016 12:47:11 +1100, Chris Angelico wrote: > On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list > wrote: >> I have a gui that has text widget and I want to be able to >> copy to the clipboard the text that is highlighted or the >> text widget's

Re: Copy To Clipboard Highlighted Text From Text Widget

2016-03-21 Thread Wildman via Python-list
On Tue, 22 Mar 2016 02:01:53 +, MRAB wrote: > On 2016-03-22 01:47, Chris Angelico wrote: >> On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list >> wrote: >>> I have a gui that has text widget and I want to be able to >>> copy to the clipboard the text that is

Re: crash while using PyCharm / Python3

2016-03-21 Thread Jonathan N. Little
Adam wrote: Sure glad I did not reinstall Ubuntu. Whew!! Unless you really-really-really screw things up, you usually do not have to. Linux is not Windows ;-) Even if you had to, with /home on its own partition a reinstall would not have been an issue, you just have to choose the

Re: crash while using PyCharm / Python3

2016-03-21 Thread Jonathan N. Little
Adam wrote: "Adam" wrote in message news:ncprqb$tl9$1...@news.albasani.net... "Jonathan N. Little" wrote in message news:ncpjj0$7ug$1...@dont-email.me... Adam wrote: There ought to be a way to just reinstall the graphics subsystem rather than an

[issue15699] PEP 3121, 384 Refactoring applied to readline module

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset b5279feb22f1 by Martin Panter in branch '3.5': Issue #15699: Reunite comment with variable https://hg.python.org/cpython/rev/b5279feb22f1 New changeset 5c6a5b3bb6eb by Martin Panter in branch 'default': Issue #15699: Merge readline fixup from 3.5

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
On 22/03/2016 00:49, BartC wrote: I was surprised at one time that slices don't create 'views', but I've since implemented view-slices and I can appreciate the problems.) Why, the docs are quite clear on how Python works? Of course you can always use memoryviews

Re: Copy To Clipboard Highlighted Text From Text Widget

2016-03-21 Thread MRAB
On 2016-03-22 01:47, Chris Angelico wrote: On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list wrote: I have a gui that has text widget and I want to be able to copy to the clipboard the text that is highlighted or the text widget's entire contents if no text is

Re: Copy To Clipboard Highlighted Text From Text Widget

2016-03-21 Thread Chris Angelico
On Tue, Mar 22, 2016 at 12:24 PM, Wildman via Python-list wrote: > I have a gui that has text widget and I want to be able to > copy to the clipboard the text that is highlighted or the > text widget's entire contents if no text is highlighted. Fortunately your code

Re: Convert list to another form but providing same information

2016-03-21 Thread Paul Rubin
Maurice writes: > I have a list such [6,19,19,21,21,21] > Therefore the resulting list should be: > [0,0,0,0,0,0,1,0,0,0...,2,0,3,0...0] Rather than a sparse list you'd typically want a dictionary (untested): from collections import defaultdict the_list =

Copy To Clipboard Highlighted Text From Text Widget

2016-03-21 Thread Wildman via Python-list
I have a gui that has text widget and I want to be able to copy to the clipboard the text that is highlighted or the text widget's entire contents if no text is highlighted. This line of code works for the highlighted text: text2copy = self.text.get(tk.SEL_FIRST, tk.SEL_LAST) However, this

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Steven D'Aprano
On Tue, 22 Mar 2016 06:43 am, BartC wrote: > This code was adapted from a program that used: > > readstrfile(filename) > > which either returned the contents of the file as a string, or 0. What an interesting function. And I don't mean that in a good way. So if it returns 0, how do you

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 22/03/2016 00:42, Mark Lawrence wrote: On 22/03/2016 00:18, BartC wrote: On 21/03/2016 23:50, Terry Reedy wrote: On 3/21/2016 8:43 AM, BartC wrote: This tests highlights the benefits of an O(1) switch statement. So why are you not taking advantage of Python's O(1) dict lookup? I've

Re: Convert list to another form but providing same information

2016-03-21 Thread Chris Angelico
On Tue, Mar 22, 2016 at 11:31 AM, Ben Bacarisse wrote: > However, the explanation ("because Python’s syntactic framework can't > handle statements nested inside expressions") seemed, at first, to be > saying you can't because you can't! But the term "syntactic framework" >

[issue26607] Rename a parameter in the function PyFile_FromFile

2016-03-21 Thread Mansour Moufid
New submission from Mansour Moufid: Hi, The last parameter of the function PyFile_FromFile is named 'close', but is a pointer to a function with the prototype of the 'fclose' function in libc. The mismatch causes confusion for some static analysis tools. This patch renames the parameter to

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 21/03/2016 23:20, Dennis Lee Bieber wrote: On Mon, 21 Mar 2016 17:31:21 +, BartC declaimed the following: I wasn't going to post it but here it is anyway: http://pastebin.com/FLbWSdpT (I've added some spaces for your benefit. This also builds a histogram of names so

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
On 22/03/2016 00:18, BartC wrote: On 21/03/2016 23:50, Terry Reedy wrote: On 3/21/2016 8:43 AM, BartC wrote: This tests highlights the benefits of an O(1) switch statement. So why are you not taking advantage of Python's O(1) dict lookup? I've already reported using a list lookup which is

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Adam" wrote in message news:ncpev8$51d$1...@news.albasani.net... > > "Dirk T. Verbeek" wrote in message > news:56f03080$0$5924$e4fe5...@news.xs4all.nl... >> Op 21-03-16 om 17:51 schreef Adam: >>> "Adam" wrote in message >>>

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Adam" wrote in message news:ncprqb$tl9$1...@news.albasani.net... > > "Jonathan N. Little" wrote in message > news:ncpjj0$7ug$1...@dont-email.me... >> Adam wrote: >>> There ought to be a way to just reinstall the graphics subsystem rather >>> than >>>

Re: Convert list to another form but providing same information

2016-03-21 Thread Ben Bacarisse
Ian Kelly writes: > On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse wrote: >> For experts here: why can't I write a lambda that has a statement in it >> (actually I wanted two: lambda l, i: l[i] += 1; return l)? > >

Re: creating multiple python Django projects in Windows environment

2016-03-21 Thread ivan77
> > Hmm, that depends how you want to structure things. If the different > applications are conceptually different, you can keep them completely > separate by making them separate Django projects; that would give you > the flexibility to put them onto independent URLs, post the source > code to

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Terry Reedy
On 3/21/2016 1:12 PM, BartC wrote: Given that 99.9998% of input byte data is ASCII, and 99.% of characters (in this data), is it unreasonable to concentrate on that 0..127 range? No. And if you take the approach of mapping the whole ascii set, you should use a lookup sequence rather

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 21/03/2016 23:50, Terry Reedy wrote: On 3/21/2016 8:43 AM, BartC wrote: This tests highlights the benefits of an O(1) switch statement. So why are you not taking advantage of Python's O(1) dict lookup? I've already reported using a list lookup which is also O(1), and it didn't really

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread nickeubank
nickeubank added the comment: Seems like existence of a method in the stdlib (or at least in the pathlib part of the stdlib) suggests issues with text encoding can be overcome. IMHO I would suggest most people have no idea about that method (I've been doing python for years and this has

Re: Static caching property

2016-03-21 Thread Chris Angelico
On Tue, Mar 22, 2016 at 11:05 AM, Steven D'Aprano wrote: > But my favourite is to combine them: > > > class Desc: > def __get__(self, obj, type): > sentinel = object() # guaranteed to be unique > value = getattr(type, _cached_value, sentinel) > if

Re: Convert list to another form but providing same information

2016-03-21 Thread Steven D'Aprano
On Tue, 22 Mar 2016 05:26 am, Maurice wrote: > I have a list such [6,19,19,21,21,21] (FYI this is the item of a certain > key in the dictionary) > > And I need to convert it to a list of 32 elements (meaning days of the > month however first element ie index 0 or day zero has no meaning - >

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Terry Reedy
On 3/21/2016 8:34 AM, BartC wrote: On 21/03/2016 02:21, Terry Reedy wrote: On 3/20/2016 9:15 PM, BartC wrote: http://pastebin.com/dtM8WnFZ This is a test of a character-at-a-time task in Python; I disagree. It tests of C code re-written in ludicrously crippled Python. No use of the re

Re: Static caching property

2016-03-21 Thread Steven D'Aprano
On Tue, 22 Mar 2016 04:48 am, Ian Kelly wrote: > You don't actually need a metaclass for this: > class Desc: > ... def __get__(self, obj, type=None): > ... if not type._cached_value: > ... type._cached_value = compute_value(type) > ... return

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Terry Reedy
On 3/21/2016 8:43 AM, BartC wrote: This tests highlights the benefits of an O(1) switch statement. So why are you not taking advantage of Python's O(1) dict lookup? -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

[issue25251] Unknown MS Compiler version 1900

2016-03-21 Thread Jonathan Hanba
Jonathan Hanba added the comment: I just ran across this bug in Python 3.5.1 while trying to build pycrypto using MinGW. I patched the cygwincompiler.py with the attached patch.diff file, and that got me part of the way there. With the additions made by patch.diff, the MinGW linker then

Re: creating multiple python Django projects in Windows environment

2016-03-21 Thread Chris Angelico
On Tue, Mar 22, 2016 at 8:02 AM, jogaserbia wrote: > On Saturday, March 19, 2016 at 3:16:53 AM UTC-4, Chris Angelico wrote: >> On Sat, Mar 19, 2016 at 6:04 AM, jogaserbia wrote: >> > Can someone please give me ideas on what I should read about (or pay >> > someone

[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-03-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- hgrepos: +335 ___ Python tracker ___ ___

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: About memory alignment, _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P() macro uses pointer dereference. It may be replaced with _Py_HASHTABLE_ENTRY_READ_DATA() to use memcpy() and avoid memory alignment issue. -- ___ Python

[issue23749] asyncio missing wrap_socket (starttls)

2016-03-21 Thread Robert Siemer
Changes by Robert Siemer : -- nosy: +siemer ___ Python tracker ___ ___

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Hum, an assertion fails in set_reentrant(), helper function to set a TLS (Thread Local Storage), but I'm unable to reproduce the bug on my Fedora 23 (AMD64). http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/3316/steps/test/logs/stdio

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Jonathan N. Little" wrote in message news:ncpjj0$7ug$1...@dont-email.me... > Adam wrote: >> There ought to be a way to just reinstall the graphics subsystem rather >> than >> an all-or-none installation approach. > > Yes you can. Did it for a borked install of the nVidia

[issue26606] logging.baseConfig is missing the encoding parameter

2016-03-21 Thread Jānis Šlapiņš
New submission from Jānis Šlapiņš: Hi! Log files are only saved using the system default encoding. On Windows, this means that the current ANSI code page is used. This may lead to a disaster (exceptions may be thrown due to unmappable characters) if you want to log particular text strings in a

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 98a1c8cb882f by Victor Stinner in branch 'default': Issue #26588: Fix compilation warning on Windows https://hg.python.org/cpython/rev/98a1c8cb882f -- ___ Python tracker

[ANN] SciPy 2016: call for papers deadlines approaching

2016-03-21 Thread Prabhu Ramachandran
Dear all, This is a gentle reminder about the approaching deadlines for the SciPy 2016 conference. Mar 21: Tutorial Proposals Due Mar 25: Talk and Poster Proposals Due Please submit your tutorials and talks at http://scipy2016.scipy.org . SciPy 2016, the Fifteenth Annual Conference on Python

ANN: DiskCache 1.6.3 Released

2016-03-21 Thread Grant Jenks
Announcing the release of DiskCache version 1.6.3 What is DiskCache? [DiskCache][1] is an Apache2 licensed disk and file backed cache library, written in pure-Python, and compatible with Django. By leveraging a rock-solid database library and memory-mapped files, cache performance can match

PyCA/cryptography 1.3.1 released

2016-03-21 Thread Paul Kehrer
PyCA/cryptography 1.3.1 was just released to PyPI. This is a minor bugfix release that fixes the following: * Fixed a bug that caused an AttributeError when using mock to patch some cryptography modules. -Paul Kehrer (reaperhulk) --

Re: need help With understanding

2016-03-21 Thread Peter Pearson
On Mon, 21 Mar 2016 11:18:57 +, mohamed mohamud wrote: > hey im new at Learning Python, and i have an issue which i would like > som help With. > > i have currently installed Python, and im Reading this book which > tells me i have to have IDLE, but i cant find it on my computer. do i > need

Re: multiprocessing, pool, queue length

2016-03-21 Thread Ian Kelly
On Mon, Mar 21, 2016 at 1:46 PM, Michael Welle wrote: > Wait on the result means to set a multiprocessing.Event if one of the > consumers finds the sentinel task and wait for it on the producer? Hmm, > that might be better than incrementing a counter. But still, it couples >

Re: creating multiple python Django projects in Windows environment

2016-03-21 Thread jogaserbia
On Saturday, March 19, 2016 at 3:16:53 AM UTC-4, Chris Angelico wrote: > On Sat, Mar 19, 2016 at 6:04 AM, jogaserbia wrote: > > Can someone please give me ideas on what I should read about (or pay > > someone to do) that would enable me to create a basis on which multiple > > Python (web and

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset aca4e9af1ca6 by Victor Stinner in branch 'default': hashtable.h now supports keys of any size https://hg.python.org/cpython/rev/aca4e9af1ca6 -- nosy: +python-dev ___ Python tracker

Re: Why do you use python?

2016-03-21 Thread Larry Martell
On Mon, Mar 21, 2016 at 4:26 PM, wrote: > On Monday, 21 March 2016 04:13:45 UTC, Chris Angelico wrote: >> On Mon, Mar 21, 2016 at 2:59 PM, wrote: >> > instead, to be efficient, it is best to combine tools to solve problems >> > that contain

Re: monkey patching __code__

2016-03-21 Thread Matt Wheeler
On 20 March 2016 at 16:46, Sven R. Kunze wrote: > On 19.03.2016 00:58, Matt Wheeler wrote: >> >> I know you have a working solution now with updating the code & >> defaults of the function, but what about just injecting your function >> into the modules that had already imported

Re: Why do you use python?

2016-03-21 Thread mbg1708
On Monday, 21 March 2016 04:13:45 UTC, Chris Angelico wrote: > On Mon, Mar 21, 2016 at 2:59 PM, wrote: > > instead, to be efficient, it is best to combine tools to solve problems > > that contain complexities where there is nothing available off the shelve > > that does

[issue26598] Embbedable zip does not import modules in (zip)subdirectory

2016-03-21 Thread Steve Dower
Steve Dower added the comment: I can't reproduce this - I used almost exactly your code and it worked fine. The one change I made was to use either L"python35.zip" alone (as my exe was alongside the zip) or a full path to the zip file. Both of these worked. If the zip file is not found,

[issue17446] doctest test finder doesnt find line numbers of properties

2016-03-21 Thread Michael Cuthbert
Michael Cuthbert added the comment: Here's a rather obscure bug that I was able to catch before we put this into action: doctests inside the __doc__ for namedtuples (and perhaps all namedtuples?) are instances of property, have .fget, but do not have .fget.__code__. Thus one more check is

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Ned Batchelder
On Monday, March 21, 2016 at 3:43:40 PM UTC-4, BartC wrote: > > This code was adapted from a program that used: > > readstrfile(filename) > > which either returned the contents of the file as a string, or 0. > > That's all. My Python version was thrown together as I don't know if >

Re: Convert list to another form but providing same information

2016-03-21 Thread Ian Kelly
On Mon, Mar 21, 2016 at 2:12 PM, Ian Kelly wrote: > On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse wrote: >> For experts here: why can't I write a lambda that has a statement in it >> (actually I wanted two: lambda l, i: l[i] += 1; return l)? > >

Re: Convert list to another form but providing same information

2016-03-21 Thread Ian Kelly
On Mon, Mar 21, 2016 at 2:03 PM, Ben Bacarisse wrote: > For experts here: why can't I write a lambda that has a statement in it > (actually I wanted two: lambda l, i: l[i] += 1; return l)?

Re: Convert list to another form but providing same information

2016-03-21 Thread Ben Bacarisse
Maurice writes: > Hello, hope everything is okay. I think someone might have dealt with > a similar issue I'm having. > > Basically I wanna do the following: > > I have a list such [6,19,19,21,21,21] (FYI this is the item of a >certain key in the dictionary) > >

Re: crash while using PyCharm / Python3

2016-03-21 Thread Jonathan N. Little
Adam wrote: There ought to be a way to just reinstall the graphics subsystem rather than an all-or-none installation approach. Yes you can. Did it for a borked install of the nVidia driver. reference this:

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
On 21/03/2016 19:43, BartC wrote: On 21/03/2016 02:02, Mark Lawrence wrote: On 21/03/2016 01:35, Chris Angelico wrote: On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence wrote: I got to line 22, saw the bare except, and promptly gave up. Oh, keep going, Mark. It gets

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 21/03/2016 02:02, Mark Lawrence wrote: On 21/03/2016 01:35, Chris Angelico wrote: On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence wrote: I got to line 22, saw the bare except, and promptly gave up. Oh, keep going, Mark. It gets better. def readstrfile(file):

Re: Convert list to another form but providing same information

2016-03-21 Thread Mark Lawrence
On 21/03/2016 18:30, Maurice wrote: Just figured why: If I type this on the kernel: weirdList = [[0]*3]*5 weirdList Out[257]: [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]] weirdList[0][0] = 1 weirdList Out[259]: [[1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0]] All first

Re: Convert list to another form but providing same information

2016-03-21 Thread Peter Otten
Maurice wrote: > Hello, hope everything is okay. I think someone might have dealt with a > similar issue I'm having. > > Basically I wanna do the following: > > I have a list such [6,19,19,21,21,21] (FYI this is the item of a certain > key in the dictionary) > > And I need to convert it to a

Re: Convert list to another form but providing same information

2016-03-21 Thread Mark Lawrence
On 21/03/2016 18:26, Maurice wrote: Hello, hope everything is okay. I think someone might have dealt with a similar issue I'm having. Basically I wanna do the following: I have a list such [6,19,19,21,21,21] (FYI this is the item of a certain key in the dictionary) And I need to convert it

Re: multiprocessing, pool, queue length

2016-03-21 Thread Ian Kelly
On Mon, Mar 21, 2016 at 4:25 AM, Michael Welle wrote: > Hello, > > I use a multiprocessing pool. My producer calls pool.map_async() > to fill the pool's job queue. It can do that quite fast, while the > consumer processes need much more time to empty the job queue. Since the >

Re: WConio won't install in Python 3.4

2016-03-21 Thread Mark Lawrence
On 21/03/2016 18:11, David Lemper wrote: Recently returned to Python after four years. Installed version 3.4.4 and attempted to install WConio in my Windows 8.1 system Gonnerman's website has WConio-1.5.1.win32-py3.3.exe & WConio-1.5.1.win32-py3.5.exe , but no py3.4 ( ? ) Tried to

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Dirk T. Verbeek" wrote in message news:56f03080$0$5924$e4fe5...@news.xs4all.nl... > Op 21-03-16 om 17:51 schreef Adam: >> "Adam" wrote in message >> news:ncikss$tks$1...@news.albasani.net... >>> >>> Host OS:Ubuntu Desktop 14.04 LTS / Unity >>> >>>

Re: Convert list to another form but providing same information

2016-03-21 Thread Maurice
Just figured why: If I type this on the kernel: weirdList = [[0]*3]*5 weirdList Out[257]: [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]] weirdList[0][0] = 1 weirdList Out[259]: [[1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0], [1, 0, 0]] All first elements of the sublists also changes. I

Convert list to another form but providing same information

2016-03-21 Thread Maurice
Hello, hope everything is okay. I think someone might have dealt with a similar issue I'm having. Basically I wanna do the following: I have a list such [6,19,19,21,21,21] (FYI this is the item of a certain key in the dictionary) And I need to convert it to a list of 32 elements (meaning days

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Dirk T. Verbeek" wrote in message news:56f03080$0$5924$e4fe5...@news.xs4all.nl... > Op 21-03-16 om 17:51 schreef Adam: >> "Adam" wrote in message >> news:ncikss$tks$1...@news.albasani.net... >>> >>> Host OS:Ubuntu Desktop 14.04 LTS / Unity >>> >>>

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Mark Lawrence
On 21/03/2016 17:31, BartC wrote: (While I here, something that came up yesterday: why hasn't Python fixed the bug it seems to have inherited from C, where: a << b + c is evaluated as 'a << (b+c)'? That cost me half an hour to sort out! << and >> scale numbers just like * and /, so should

WConio won't install in Python 3.4

2016-03-21 Thread David Lemper
Recently returned to Python after four years. Installed version 3.4.4 and attempted to install WConio in my Windows 8.1 system Gonnerman's website has WConio-1.5.1.win32-py3.3.exe & WConio-1.5.1.win32-py3.5.exe , but no py3.4 ( ? ) Tried to install each of the above. Both failed giving

[issue26588] _tracemalloc: add support for multiple address spaces (domains)

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Hum, the patch is really too hard to review. So I extract to the "key_size" part: hashtable_key_size.patch. I added new macros to get the key, wrapper to memcpy() with an assert to check the key size in debug mode. -- Added file:

Re: empty clause of for loops

2016-03-21 Thread Rob Gaddi
Sven R. Kunze wrote: > On 16.03.2016 16:02, Tim Chase wrote: >> On 2016-03-16 15:29, Sven R. Kunze wrote: >>> I would re-use the "for-else" for this. Everything I thought I >>> could make use of the "-else" clause, I was disappointed I couldn't. >> Hmm...this must be a mind-set thing. I use the

Re: Why do you use python?

2016-03-21 Thread sohcahtoa82
On Saturday, October 31, 2009 at 12:11:02 AM UTC-7, sk wrote: > What would be your answer if this question is asked to you in an > interview? > > a modified version might be: > "Where would you use python over C/C++/Java?" > > (because my resume says I know C/C++/Java)? I use Python when speed

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Adam" wrote in message news:ncp8r1$ofd$1...@news.albasani.net... > > "Adam" wrote in message > news:ncikss$tks$1...@news.albasani.net... >> >> Host OS:Ubuntu Desktop 14.04 LTS / Unity >> >> System crashed while using PyCharm / Python3. >> Booting

Re: Static caching property

2016-03-21 Thread Ian Kelly
On Mon, Mar 21, 2016 at 10:54 AM, Chris Angelico wrote: > On Tue, Mar 22, 2016 at 3:49 AM, Joseph L. Casale > wrote: >> Right, but _private refers to an api call that is expensive and may not even >> be accessed, >> so while I may new up three

Re: Static caching property

2016-03-21 Thread Ethan Furman
On 03/21/2016 10:03 AM, Joseph L. Casale wrote: One solution is to use descriptor protocol on the class, which means using a metaclass. I'm not sure it's the best option, but it is an option. I will look at that, I wonder if however I am not over complicating it: class Foo: _bar = None

Re: Static caching property

2016-03-21 Thread Ian Kelly
On Mon, Mar 21, 2016 at 10:36 AM, Steven D'Aprano wrote: > On Tue, 22 Mar 2016 03:15 am, Ian Kelly wrote: >> Why not do the same thing but using a class attribute instead of an >> instance attribute? > > Properties don't work when called from a class: Properties specifically

Re: crash while using PyCharm / Python3

2016-03-21 Thread Dirk T. Verbeek
Op 21-03-16 om 17:51 schreef Adam: "Adam" wrote in message news:ncikss$tks$1...@news.albasani.net... Host OS:Ubuntu Desktop 14.04 LTS / Unity System crashed while using PyCharm / Python3. Booting takes forever and stuck at the purple screen with the Ubuntu logo and

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 21/03/2016 12:34, BartC wrote: On 21/03/2016 02:21, Terry Reedy wrote: Of course you can. But you cannot write in a crippled Python subset and fairly claim that the result represents idiomatic Python code. For Python I would have used a table of 0..255 functions, indexed by the ord()

Re: Scipy2016: call for proposals

2016-03-21 Thread Nelle Varoquaux
I'm terribly sorry about this second email. The deadline for submitting talks and posters for scipy 2016 is this friday (friday 25th), and not next friday (april fools day). Thanks, Nelle On 21 March 2016 at 15:32, Nelle Varoquaux wrote: > Dear all, > > This is a

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Such function already exists in the stdlib! But with different order of arguments. See pathlib.Path.write_text(). Personally I'm very skeptical about usefulness of similar functions in the stdlib. -- nosy: +serhiy.storchaka

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 21/03/2016 12:59, Chris Angelico wrote: On Mon, Mar 21, 2016 at 11:34 PM, BartC wrote: For Python I would have used a table of 0..255 functions, indexed by the ord() code of each character. So all 52 letter codes map to the same name-handling function. (No Dict is needed at

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: Oh. I wasn't aware of these pathlib methods. https://docs.python.org/dev/library/pathlib.html#pathlib.Path.write_bytes https://docs.python.org/dev/library/pathlib.html#pathlib.Path.write_text -- ___ Python tracker

Re: Static caching property

2016-03-21 Thread Joseph L. Casale
> One solution is to use descriptor protocol on the class, which means > using a metaclass. I'm not sure it's the best option, but it is an > option. I will look at that, I wonder if however I am not over complicating it: class Foo: _bar = None @property def expensive(self):

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread STINNER Victor
STINNER Victor added the comment: It's easy to implement such function in a module and upload such module to PyPI (ex: "to_file" module :-)). It's not easy to guess user expectations on such function: text encoding, buffering, etc. Adding a method to the builtin str type which writes into a

[issue26605] Feature request: string method `to_file`

2016-03-21 Thread nickeubank
New submission from nickeubank: As a social scientists trying to help other social scientists move from language like R, Stata, and Matlab into Python, one of the behaviors I've found unnecessarily difficult to explain is the "file.open()/file.close()" idiom (or, alternatively, context

Re: crash while using PyCharm / Python3

2016-03-21 Thread Adam
"Adam" wrote in message news:ncikss$tks$1...@news.albasani.net... > > Host OS:Ubuntu Desktop 14.04 LTS / Unity > > System crashed while using PyCharm / Python3. > Booting takes forever and stuck at the purple screen with > the Ubuntu logo and the five dots cycling. > How

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread BartC
On 21/03/2016 16:30, Steven D'Aprano wrote: On Mon, 21 Mar 2016 06:47 pm, Ben Finney wrote: Steven D'Aprano writes: On Monday 21 March 2016 13:11, Ben Finney wrote: Please, stop making assertions about Python code until you have learned Python. I

Re: Static caching property

2016-03-21 Thread Chris Angelico
On Tue, Mar 22, 2016 at 3:49 AM, Joseph L. Casale wrote: > Right, but _private refers to an api call that is expensive and may not even > be accessed, > so while I may new up three instances of Test across a, b and c, if none of > those end up > accessing var x, it

Re: Static caching property

2016-03-21 Thread Joseph L. Casale
> I think Joseph is using "static" in the Java sense of being associated with > the class rather than an instance. (In Java, members of classes must be > known at compile-time.) Yup, so a single value on the class itself, not instance specific. > But what you can do is have the property refer to

[issue26582] asyncio documentation links to wrong CancelledError

2016-03-21 Thread SilentGhost
SilentGhost added the comment: In fact most of the :exc: reference are pointing explicitly to concurrent.futures.CancelledError (and those that don't probably should). It is interesting that you weren't able to make use of that exception, because in Lib/asyncio/futures.py#L23 it's clearly

Re: Static caching property

2016-03-21 Thread Steven D'Aprano
On Tue, 22 Mar 2016 03:15 am, Ian Kelly wrote: > On Mon, Mar 21, 2016 at 9:38 AM, Joseph L. Casale > wrote: >> With non static properties, you can use a decorator that overwrites the >> method on the instance with an attribute containing the methods return >>

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Steven D'Aprano
On Mon, 21 Mar 2016 06:47 pm, Ben Finney wrote: > Steven D'Aprano writes: > >> On Monday 21 March 2016 13:11, Ben Finney wrote: >> > Please, stop making assertions about Python code until you have >> > learned Python. >> >> I don't see how "I don't have a

  1   2   >