Re: Re: Context manager able to write to the caller's namespace

2018-01-18 Thread Chris Angelico
On Fri, Jan 19, 2018 at 5:00 PM, wrote: > Hello, > > Thank you for your mail. I will answer as fast as possible. If you're going to subscribe to a mailing list, PLEASE disable your autoresponder. Otherwise, messages like this will get marked as Spam, and your legit mail will end up getting tarr

Re: Context manager able to write to the caller's namespace

2018-01-18 Thread Steven D'Aprano
On Fri, 19 Jan 2018 16:49:49 +1100, Chris Angelico wrote: [...] > 1) Context manager was called from global scope, and needs access to > globals() or locals() as returned in the caller A! /facepalm Of course the caller can just pass locals() to the context manager. Why didn't I think o

Re: Context manager able to write to the caller's namespace

2018-01-18 Thread Chris Angelico
On Fri, Jan 19, 2018 at 3:48 PM, Steven D'Aprano wrote: > I want to define a context manager in one module: > > # a.py > def CM: > def __enter__(self): > return self > def __exit__(self, *args): > pass > > > Then call it from another module: > > # b.py > import a > with a.C

Re: How to use asyncore with SSL?

2018-01-18 Thread Marko Rauhamaa
Grant Edwards : > I've been trying to use the secure smtpd module from > https://github.com/bcoe/secure-smtpd, but the SSL support seems to be > fundamentally broken. That module simply wraps a socket and then > expects to use it in the normal way via asyncore. > > Of course that fails the first

Anaconda installation problem

2018-01-18 Thread Jingshen Tai (jingshen)
Hi, When I was installing windows Anaconda 3 64 bit, there is a pop up window saying that the 'python program is closing'. I ignored it and continued the installation. When the Anaconda Prompt is launched, I have this error popped at the top (refer to attached doc.) Does that mean that the b

Context manager able to write to the caller's namespace

2018-01-18 Thread Steven D'Aprano
I'm looking for a solution, or at least hints, to this problem. I want to define a context manager in one module: # a.py def CM: def __enter__(self): return self def __exit__(self, *args): pass Then call it from another module: # b.py import a with a.CM() as spam:

Re: Very strange issues with collections.Mapping

2018-01-18 Thread Steven D'Aprano
On Thu, 18 Jan 2018 16:37:18 -0500, Jason Swails wrote: > The root cause of the issue comes down to the following check returning > true: > > isinstance([], collections.Mapping) I re-iterate Chris' suggestion that you check that the instance is an actual list, not a subclass. Can you grep the

Re: Where are the moderators?

2018-01-18 Thread Steven D'Aprano
On Fri, 19 Jan 2018 00:43:36 +, MRAB wrote: > If you're viewing via Google Groups, then complain about the spam to > Google. Alternatively, and just as effectively, you could repeatedly hit yourself on the head with a ball-peen hammer. That will be just as effective at filtering the spam, b

Re: Where are the moderators?

2018-01-18 Thread Skip Montanaro
>> Simply point your email client at news.gmane.org and take your pick from >> hundreds of Python lists and thousands of other technical lists that are >> all spam free. >> >> > Actually, this link is broken. But, gmane.org (without the news prefix) > does work. Neither works for me. The news link

Re: Where are the moderators?

2018-01-18 Thread Bob van der Poel
On Thu, Jan 18, 2018 at 4:28 PM, wrote: > On Thursday, January 18, 2018 at 10:38:18 PM UTC, Mike Driscoll wrote: > > Hi, > > > > What happened to the moderators? I have always liked this forum, but > there's so much spam now. Is there a way to become a moderator so this can > be cleaned up? > > >

Re: Very strange issues with collections.Mapping

2018-01-18 Thread Dan Stromberg
Probably not what you want to hear, but this might be a good place for an SSCCE. On Thu, Jan 18, 2018 at 1:37 PM, Jason Swails wrote: > Hello! > > I am running into a very perplexing issue that is very rare, but creeps up > and is crashing my app. > > The root cause of the issue comes down to the

Re: Where are the moderators?

2018-01-18 Thread MRAB
On 2018-01-18 22:38, Mike Driscoll wrote: Hi, What happened to the moderators? I have always liked this forum, but there's so much spam now. Is there a way to become a moderator so this can be cleaned up? How are you viewing the list? If you're viewing via Google Groups, then complain about

Re: Where are the moderators?

2018-01-18 Thread breamoreboy
On Thursday, January 18, 2018 at 10:38:18 PM UTC, Mike Driscoll wrote: > Hi, > > What happened to the moderators? I have always liked this forum, but there's > so much spam now. Is there a way to become a moderator so this can be cleaned > up? > > Thanks, > Mike Simply point your email client

How to use asyncore with SSL?

2018-01-18 Thread Grant Edwards
I've been trying to use the secure smtpd module from https://github.com/bcoe/secure-smtpd, but the SSL support seems to be fundamentally broken. That module simply wraps a socket and then expects to use it in the normal way via asyncore. Of course that fails the first time an ssl-wrapped-socket's

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-18 Thread duncan smith
On 17/01/18 14:29, leutrim.kal...@gmail.com wrote: > > Hello everyone, > > I am implementing a time-dependent Recommender System which applies BPR > (Bayesian Personalized Ranking), where Stochastic Gradient Ascent is used to > learn the parameters of the model. Such that, one iteration involv

Re: Where are the moderators?

2018-01-18 Thread Skip Montanaro
> What happened to the moderators? I have always liked this forum, but there's > so much spam now. Is there a way to become a moderator so this can be cleaned > up? Just to emphasize what Paul said, the only moderators I'm aware of are those who moderate python-list@python.org. A bidirectional g

Re: Where are the moderators?

2018-01-18 Thread Paul Moore
On 18 January 2018 at 22:38, Mike Driscoll wrote: > Hi, > > What happened to the moderators? I have always liked this forum, but there's > so much spam now. Is there a way to become a moderator so this can be cleaned > up? > > Thanks, > Mike You seem to be using the Google Groups interface. The

Where are the moderators?

2018-01-18 Thread Mike Driscoll
Hi, What happened to the moderators? I have always liked this forum, but there's so much spam now. Is there a way to become a moderator so this can be cleaned up? Thanks, Mike -- https://mail.python.org/mailman/listinfo/python-list

Re: Very strange issues with collections.Mapping

2018-01-18 Thread Chris Angelico
On Fri, Jan 19, 2018 at 8:37 AM, Jason Swails wrote: > The root cause of the issue comes down to the following check returning > true: > > isinstance([], collections.Mapping) > > Obviously you can get this behavior if you register `list` as a subclass of > the Mapping ABC, but I'm not doing that.

Very strange issues with collections.Mapping

2018-01-18 Thread Jason Swails
Hello! I am running into a very perplexing issue that is very rare, but creeps up and is crashing my app. The root cause of the issue comes down to the following check returning true: isinstance([], collections.Mapping) Obviously you can get this behavior if you register `list` as a subclass of

Re: documentation on read.encode

2018-01-18 Thread Larry Martell
On Thu, Jan 18, 2018 at 12:47 AM, Steven D'Aprano wrote: > On Wed, 17 Jan 2018 16:54:37 -0500, Larry Martell wrote: > >> The code that was receiving the >> PNG was not reading and writing the file as binary. Strangely that >> worked on Linux but not on Windows. > > Nothing strange about it -- on U