Re: Goto (Posting On Python-List Prohibited)

2017-12-29 Thread Rustom Mody
On Saturday, December 30, 2017 at 8:35:27 AM UTC+5:30, Lawrence D’Oliveiro wrote: > On Saturday, December 30, 2017 at 12:12:23 PM UTC+13, bartc wrote: > > Looking at 14 million lines of Linux kernel sources, which are in C, > > over 100,000 of them use 'goto'. About one every 120 lines. > > That

Goto

2017-12-29 Thread Mikhail V
MRAB wrote: > It's OK for code that's close to the metal, but in high-level code? No. > Python has managed for >25 years without it, and I've yet to see a > convincing use-case. "convincing" is a broad term I think, especially for syntax proposals ;) I think often one wish to use it just to avo

How to create a python extension module from a shared library?

2017-12-29 Thread Etienne Robillard
Hi all, I would like to extend uWSGI by creating a CPython extension module for the libuwsgi.so shared library included in the distribution. My goal is to use this automatically generated CPython module for extending uWSGI. I have summarized my current approach here: https://mail.python.or

Re: Goto (Posting On Python-List Prohibited)

2017-12-29 Thread MRAB
On 2017-12-29 23:12, bartc wrote: On 29/12/2017 21:55, Lawrence D’Oliveiro wrote: On Saturday, December 30, 2017 at 9:03:50 AM UTC+13, bartc wrote: Why most newer, higher level languages don't, I don't know. Perhaps because the people who design them want to make programming harder? I don’t u

Re: Goto (Posting On Python-List Prohibited)

2017-12-29 Thread Skip Montanaro
Looking at 14 million lines of Linux kernel sources, which are in C, over 100,000 of them use 'goto'. About one every 120 lines. Isn't C's goto statement restricted to the current function? I imagine setjmp and longjmp calls might be more insidious. Skip -- https://mail.python.org/mailman/listi

Re: Goto (Posting On Python-List Prohibited)

2017-12-29 Thread bartc
On 29/12/2017 21:55, Lawrence D’Oliveiro wrote: On Saturday, December 30, 2017 at 9:03:50 AM UTC+13, bartc wrote: Why most newer, higher level languages don't, I don't know. Perhaps because the people who design them want to make programming harder? I don’t use gotos in C code. Why should it b

Re: Goto

2017-12-29 Thread bartc
On 29/12/2017 21:56, Stefan Ram wrote: Chris Angelico writes: On Sat, Dec 30, 2017 at 8:03 AM, D'Arcy Cain wrote: On 12/29/2017 02:25 PM, Chris Angelico wrote: PHP also added goto to a later version. Ahh, great choice of example. "It's okay - PHP does it." I thought that that was a reason

Re: Goto

2017-12-29 Thread Chris Angelico
On Sat, Dec 30, 2017 at 8:03 AM, D'Arcy Cain wrote: > On 12/29/2017 02:25 PM, Chris Angelico wrote: >>> PHP also added goto to a later version. >> >> Ahh, great choice of example. "It's okay - PHP does it." > > I thought that that was a reason to not do it. Often, yeah. Hence my comment that "hey

Re: Goto

2017-12-29 Thread D'Arcy Cain
On 12/29/2017 02:25 PM, Chris Angelico wrote: >> PHP also added goto to a later version. > > Ahh, great choice of example. "It's okay - PHP does it." I thought that that was a reason to not do it. -- D'Arcy J.M. Cain Vybe Networks Inc. http://www.VybeNetworks.com/ IM:da...@vex.net VoIP: sip:da.

Re: Goto

2017-12-29 Thread bartc
On 29/12/2017 20:25, Chris Angelico wrote: On Sat, Dec 30, 2017 at 7:03 AM, bartc wrote: On 29/12/2017 18:55, MarkA wrote: On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote: How to use goto in python? --- This email has been checked for viruses by AVG. http://www.avg.com Rather than ask h

Re: Goto

2017-12-29 Thread Chris Angelico
On Sat, Dec 30, 2017 at 7:03 AM, bartc wrote: > On 29/12/2017 18:55, MarkA wrote: >> >> On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote: >> >>> How to use goto in python? >>> >>> --- >>> This email has been checked for viruses by AVG. >>> http://www.avg.com >> >> >> Rather than ask how to use an u

Re: Goto

2017-12-29 Thread bartc
On 29/12/2017 18:55, MarkA wrote: On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote: How to use goto in python? --- This email has been checked for viruses by AVG. http://www.avg.com Rather than ask how to use an unavailable statement (GOTO), why not investigate why no modern languages use it?

Re: PyWin32 installer question

2017-12-29 Thread Terry Reedy
On 12/29/2017 11:38 AM, Paul Moore wrote: On 29 December 2017 at 16:04, Skip Montanaro wrote: Thanks. I'll shoot Thomas Heller an email... Actually, make that Christopher Toth. Seems he's the current maintainer. If you get no joy there, then in a week or two, when I next get access to a sy

Re: Goto

2017-12-29 Thread MarkA
On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote: > How to use goto in python? > > --- > This email has been checked for viruses by AVG. > http://www.avg.com Rather than ask how to use an unavailable statement (GOTO), why not investigate why no modern languages use it? -- MarkA You can safely

Re: Goto

2017-12-29 Thread Chris Angelico
On Sat, Dec 30, 2017 at 4:13 AM, bartc wrote: > If you want to translate code from one language to another, and the source > language uses gotos, or uses control structures not available in the target > language, then gotos would be very useful in the latter. > As has already been said in this th

Re: Python goto

2017-12-29 Thread Grant Edwards
On 2017-12-28, Skip Montanaro wrote: > Though it appears some wag has used function decorators to implement > goto statements: > > https://pypi.python.org/pypi/goto-statement/1.1 > > Rather clever, it seems. That's brilliant! Not that I'd look kindly on anybody who used it on project I ended up

Re: Goto

2017-12-29 Thread bartc
On 29/12/2017 09:52, alister wrote: On Thu, 28 Dec 2017 18:54:31 -0800, breamoreboy wrote: On Thursday, December 28, 2017 at 7:40:14 PM UTC, alister wrote: On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote: How to use goto in python? --- This email has been checked for viruses by AVG. http://

Re: PyWin32 installer question

2017-12-29 Thread Paul Moore
On 29 December 2017 at 16:04, Skip Montanaro wrote: >> Thanks. I'll shoot Thomas Heller an email... > > > Actually, make that Christopher Toth. Seems he's the current maintainer. If you get no joy there, then in a week or two, when I next get access to a system with a Python 2.x build environment

Re: PyWin32 installer question

2017-12-29 Thread Skip Montanaro
> Thanks. I'll shoot Thomas Heller an email... Actually, make that Christopher Toth. Seems he's the current maintainer. -- https://mail.python.org/mailman/listinfo/python-list

Re: PyWin32 installer question

2017-12-29 Thread Skip Montanaro
> That's not an architecture-independent file. The Wheel spec gives all > the details, but "cp27" (as opposed to "py27") means it's CPython only > (which usually means it's got a C extension) and "win32" is 32-bit > only ("win_amd64" is the tag for 64-bit Windows). So the problem is > that the py2e

Re: GUI user input to function

2017-12-29 Thread Nico Vogeli
Am Donnerstag, 28. Dezember 2017 14:00:14 UTC+1 schrieb Chris Angelico: > On Thu, Dec 28, 2017 at 11:06 PM, Nico Vogeli wrote: > > Am Donnerstag, 28. Dezember 2017 12:59:24 UTC+1 schrieb Chris Angelico: > >> On Thu, Dec 28, 2017 at 8:38 PM, Nico Vogeli wrote: > >> > Withs test, this return a corr

Re: Goto

2017-12-29 Thread mm0fmf
On 28/12/2017 22:38, Tim Chase wrote: On 2017-12-29 08:42, Ben Finney wrote: Duram writes: How to use goto in python? Step 0: what is goto in Python? Step 1: that's not something that exists in Python. So why are you asking how to use something that doesn't exist? so quick to shoot down

Re: Goto

2017-12-29 Thread alister via Python-list
On Thu, 28 Dec 2017 18:54:31 -0800, breamoreboy wrote: > On Thursday, December 28, 2017 at 7:40:14 PM UTC, alister wrote: >> On Thu, 28 Dec 2017 00:58:48 -0200, Duram wrote: >> >> > How to use goto in python? >> > >> > --- >> > This email has been checked for viruses by AVG. >> > http://www.avg.

Creation of a metaclass for dataclass.

2017-12-29 Thread Kirill Balunov
I'm studying the meta-programming topic in Python, and as an exercise I'm trying to make a somewhat simplified version of dataclass. My goal in this exercise is to make the difference between annotated variables and usual ones to be as much transparent as possible. So I come with this code to obtai