Re: ctypes Usage Note

2016-08-01 Thread Lawrence D’Oliveiro
On Tuesday, August 2, 2016 at 5:18:14 PM UTC+12, eryk sun wrote: > I recommend using ctypes.CDLL instead. ctypes.cdll is pretty much > pointless on Unix systems (and a potential problem on Windows due to > cached function pointers). It also doesn't allow passing the mode, > handle, and use_errno p

Re: ctypes Usage Note

2016-08-01 Thread eryk sun
On Tue, Aug 2, 2016 at 1:41 AM, Lawrence D’Oliveiro wrote: > > Don’t do that. Do this instead: > > libc = ctypes.cdll.LoadLibrary("libc.so.6") I recommend using ctypes.CDLL instead. ctypes.cdll is pretty much pointless on Unix systems (and a potential problem on Windows due to cached function

Re: `exec`-based routine crashes app upon migration from 3.4.3 to python 3.5.2.

2016-08-01 Thread eryk sun
On Tue, Aug 2, 2016 at 1:45 AM, Lawrence D’Oliveiro wrote: > On Friday, July 29, 2016 at 6:25:51 AM UTC+12, Enjoys Math wrote: > >> exec('obj = ' + objType + '(self)', None, _locals) >> obj = _locals['obj'] > > Why? Why not just > > obj = objType(self) I think

Re: usage of functools.partial in in parallelism

2016-08-01 Thread Steven D'Aprano
On Tuesday 02 August 2016 13:14, Michael Torrie wrote: > On 08/01/2016 01:13 AM, Michael Selik wrote: >> You might benefit from watching the talk "Stop Writing Classes" >> https://www.youtube.com/watch?v=o9pEzgHorH0 > > Great talk! Thanks for posting that. It is a great talk, but for a counter-

Re: usage of functools.partial in in parallelism

2016-08-01 Thread Michael Torrie
On 08/01/2016 01:13 AM, Michael Selik wrote: > You might benefit from watching the talk "Stop Writing Classes" > https://www.youtube.com/watch?v=o9pEzgHorH0 Great talk! Thanks for posting that. -- https://mail.python.org/mailman/listinfo/python-list

Re: `exec`-based routine crashes app upon migration from 3.4.3 to python 3.5.2.

2016-08-01 Thread Lawrence D’Oliveiro
On Friday, July 29, 2016 at 6:25:51 AM UTC+12, Enjoys Math wrote: > exec('obj = ' + objType + '(self)', None, _locals) > obj = _locals['obj'] Why? Why not just obj = objType(self) ? -- https://mail.python.org/mailman/listinfo/python-list

ctypes Usage Note

2016-08-01 Thread Lawrence D’Oliveiro
Sometimes people load a library with ctypes like this: libc = ctypes.cdll.LoadLibrary("libc.so") Don’t do that. Do this instead: libc = ctypes.cdll.LoadLibrary("libc.so.6") What’s the difference? The difference is that the unversioned library comes from the “development” package, while

Re: python and open office

2016-08-01 Thread Lawrence D’Oliveiro
On Thursday, July 28, 2016 at 4:29:34 AM UTC+12, Crane Ugly wrote: > I try to create some scripts that will help me to open and manipulate > OpenOffice documents. Have you looked at odfpy ? -- https://mail.python.org/mailman/listinfo/python-list

Re: use import *

2016-08-01 Thread Lawrence D’Oliveiro
On Tuesday, August 2, 2016 at 3:32:11 AM UTC+12, Ganesh Pal wrote: > is it a good programming practice to use import * ? No. Think of the module you’re importing as a can, and each of the names it defines as a worm. So you when you do “from «module» import *”, it’s like emptying all the worms

Re: Is it possible to draw a BUTTON?

2016-08-01 Thread Rick Johnson
On Thursday, July 28, 2016 at 11:32:19 PM UTC-5, huey.y...@gmail.com wrote: > Yes, Rick's code works great. Well, could you go a little > further? No, i think we've gone far enough. Just FYI, Rick doesn't do homework for free *OR* for a fee. Now, it's time for *YOU* to step u.! If you want more he

Re: Why not allow empty code blocks?

2016-08-01 Thread bartc
On Monday, 1 August 2016 11:12:30 UTC+1, Steven D'Aprano wrote: > On Monday 01 August 2016 18:05, bart4...@gmail.com wrote: > No offense intended Bart, but for all we know every single one of your > benchmarks are faked, your interpreters are buggy pieces of garbage, and for > all your self-pro

Re: Using valid emails

2016-08-01 Thread D'Arcy J.M. Cain
On Mon, 1 Aug 2016 12:38:27 -0600 Michael Torrie wrote: > That's not something I would ever want, nor I suspect people who are > participating in a lot of e-mail lists. To each his own. Exactly my point. Make the general case something that allows each person to control their own experience. >

Re: Using valid emails

2016-08-01 Thread Marko Rauhamaa
Chris Angelico : > Unfortunately, a lot of domains don't have SPF records, or have very > convoluted ones (check out gmail.com's SPF for instance). That's their problem. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-08-01 Thread Marko Rauhamaa
Gordon Levi : > In contrast, your valid email address will become the target of many > spam emails even if you manage to block them. It will also be used as > the source of spam so somebody at vex.net may be fooled into believing > that they are receiving a proper email. Spammers aren't going to c

Re: Using valid emails

2016-08-01 Thread Michael Torrie
On 08/01/2016 10:32 AM, D'Arcy J.M. Cain wrote: > On Sun, 31 Jul 2016 14:01:26 -0600 > Michael Torrie wrote: >>> So I have to examine every address I reply to or deal with the >>> bounce message later. Way to move your spam problem to someone >>> else. >> >> I've never had this problem. I use

Using valid emails

2016-08-01 Thread D'Arcy J.M. Cain
On Sun, 31 Jul 2016 14:01:26 -0600 Michael Torrie wrote: > > So I have to examine every address I reply to or deal with the > > bounce message later. Way to move your spam problem to someone > > else. > > I've never had this problem. I use the mailing list side of things > and I reply to the

Re: Using valid emails

2016-08-01 Thread D'Arcy J.M. Cain
On Tue, 2 Aug 2016 02:22:50 +1000 Chris Angelico wrote: > > I'm a little insulted that you think that I would ever allow > > someone to send mail to Vex.Net pretending to be from Vex.Net. > > That's just too easy to detect and block. Try it. > > vex.net. 10800 IN TXT "v=spf1 mx -all" > vex.net

Re: use import *

2016-08-01 Thread Thomas 'PointedEars' Lahn
Ganesh Pal wrote: > is it a good programming practice to use [from … ] import * ? No; but it is not as harmful as one would think either. > if answer is "NO " then are there situation where you are forced to use > impo

Re: SOAP and Zeep

2016-08-01 Thread Nicolas Évrard
* Ethan Furman [2016-07-29 19:54 +0200]: Greetings! I may have a need in the immediate future to work with SOAP and WSDL services, and a quick search turned up Zeep (http://docs.python-zeep.org/en/latest/) -- does anyone have any experience with it? Or any other libraries that can be recommende

Re: use import *

2016-08-01 Thread Chris Angelico
On Tue, Aug 2, 2016 at 1:31 AM, Ganesh Pal wrote: > I am a Linux user on python 2,6 . I have a very simple question > > I was going the zen of python by Tim peters and found an example that > demonstrates Explicit is better than implicit > > """Load the cat, dog, and mouse models so we can edit i

Re: Can math.atan2 return INF?

2016-08-01 Thread Ian Kelly
On Sun, Jul 31, 2016 at 10:05 PM, Rustom Mody wrote: > All starts with the disorder in the middle-east and a whole lot of arbitrary > lines > drawn there > [Going backward in time] > - A line drawn in space called ‘Israel’ > - Based on a line drawn in time called the ‘Exodus of Moses’ I'm no exp

Re: Using valid emails

2016-08-01 Thread Chris Angelico
On Tue, Aug 2, 2016 at 2:05 AM, D'Arcy J.M. Cain wrote: >> probably your SMTP server, will tell you. In contrast, your valid >> email address will become the target of many spam emails even if you >> manage to block them. It will also be used as the source of spam so >> somebody at vex.net may be

Using valid emails

2016-08-01 Thread D'Arcy J.M. Cain
Time to change the subject. On Tue, 02 Aug 2016 01:30:47 +1000 Gordon Levi wrote: > "D'Arcy J.M. Cain" wrote: > >: Host or domain name not found. Name service > >error for name=address.invalid type=: Host not found > > > >So I have to examine every address I reply to or deal with the bounce

Re: use import *

2016-08-01 Thread Ian Kelly
On Mon, Aug 1, 2016 at 9:31 AM, Ganesh Pal wrote: > Hi Team , > > I am a Linux user on python 2,6 . I have a very simple question > > I was going the zen of python by Tim peters and found an example that > demonstrates Explicit is better than implicit > > """Load the cat, dog, and mouse models so

Re: Why not allow empty code blocks?

2016-08-01 Thread Gordon Levi
"D'Arcy J.M. Cain" wrote: >On Sun, 31 Jul 2016 11:53:47 -0400 >"D'Arcy J.M. Cain" wrote: >> On Mon, 01 Aug 2016 00:25:58 +1000 >> On the other hand I have no throwaway accounts. Every address I use >> is a primary one. I have all sorts of methods to block spam. None of >> those methods involv

use import *

2016-08-01 Thread Ganesh Pal
Hi Team , I am a Linux user on python 2,6 . I have a very simple question I was going the zen of python by Tim peters and found an example that demonstrates Explicit is better than implicit """Load the cat, dog, and mouse models so we can edit instances of them.""" def load(): from menageri

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 10:50:20 UTC+1, alister wrote: > Actually the more you make these claims the more I think you are > suffering from NIH (Not Invented Here) syndrome. That's not surprising. I started out developing hardware such as microprocessor boards and video displays. My languages

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 11:12:30 UTC+1, Steven D'Aprano wrote: > On Monday 01 August 2016 18:05, bart4...@gmail.com wrote: > > > You think that my nearly 30 years' experience of designing interpreted > > languages and writing fast bytecode interpreters doesn't make my opinions > > have any more

Re: Why not allow empty code blocks?

2016-08-01 Thread Steven D'Aprano
On Monday 01 August 2016 18:05, bart4...@gmail.com wrote: > You think that my nearly 30 years' experience of designing interpreted > languages and writing fast bytecode interpreters doesn't make my opinions > have any more merit, that's fine. If you are the only one who has ever seen or used the

Re: Why not allow empty code blocks?

2016-08-01 Thread alister
On Mon, 01 Aug 2016 01:05:53 -0700, bart4858 wrote: > On Monday, 1 August 2016 01:33:37 UTC+1, Chris Angelico wrote: >> On Mon, Aug 1, 2016 at 10:21 AM, wrote: > >> > However I do 'drive' as I've been programming for decades. And I can >> > have an opinion about a model of car that I don't nor

Re: Why not allow empty code blocks?

2016-08-01 Thread alister
On Mon, 01 Aug 2016 09:49:46 +1000, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 9:43 AM, wrote: >> On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: >> >>> That said, I wish he'd stop posting his arguments here on this list as >>> he clearly doesn't use Python for anything, and h

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 01:33:37 UTC+1, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 10:21 AM, wrote: > > However I do 'drive' as I've been programming for decades. And I can have > > an opinion about a model of car that I don't normally drive. An opinion > > which you might well not get f

Re: Why not allow empty code blocks?

2016-08-01 Thread bart4858
On Monday, 1 August 2016 01:22:02 UTC+1, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 10:11 AM, wrote: > > (128MB or 128KB? In the 1980s we were all running in 64KB to 640KB of > > memory. 128MB might be what a well-endowed mainframe might have had!) > > Yes, and we didn't have Python then.

Re: usage of functools.partial in in parallelism

2016-08-01 Thread Michael Selik
On Sun, Jul 31, 2016 at 5:47 AM Sivan Greenberg wrote: > That's exactly the answer I was looking for. Thanks. > > I got used too much I guess to solving problems the OOP way, e.g. my code > wraps the session.get invocation with a class to pack together the > arguments and data and also took care