Re: py2exe, program has stoped working!?

2018-11-22 Thread konsyme
On Sunday, April 13, 2008 at 4:52:06 PM UTC+3, skan...@yahoo.se wrote: > so i used py2exe and i have the build and the dist-folders. > > in the distfolder there is a Calculator.exe file. > > when i run it it just says "Calculator.exe has stopped working" in a > popup but the program itself never

Need help for python on my pc.

2018-11-22 Thread Sourav Banik
Hello Python team, I'm using python 3.7(32 bit) for several months on my same laptop (x64 processor). I worked on some django project very swiftly without any problem. But for a few days I am facing a serious problem. My python files are not showing properly by the file manager. It is just showing

Re: Python-remove duplicate output

2018-11-22 Thread Bob Gailer
On Nov 22, 2018 8:50 AM, wrote: > > On Thursday, November 22, 2018 at 12:10:28 AM UTC+1, drvuc...@gmail.com wrote: > > How to remove duplicate lines and store output into one ine > > > >reservations = ec.describe_instances().get('Reservations', []) > > > >for reservation in reservations: >

Re: Python-remove duplicate output

2018-11-22 Thread marco . nawijn
On Thursday, November 22, 2018 at 12:10:28 AM UTC+1, drvuc...@gmail.com wrote: > How to remove duplicate lines and store output into one ine > >reservations = ec.describe_instances().get('Reservations', []) > >for reservation in reservations: > for instance in reservation['Instan

Re: Question about implementing immutability

2018-11-22 Thread Iwo Herka
czw., 22 lis 2018 o 11:14 Thomas Jollans napisał(a): > [..] this allows other classes' __init__s to set attributes. Fair point. > I might try setting a self._fixed flag at the end of init and do a check > > if getattr(self, '_fixed', False): > raise TypeError(f"'{type(self)}' is immutable")

Re: Question about implementing immutability

2018-11-22 Thread Thomas Jollans
On 2018-11-21 17:45, Iwo Herka wrote: > Hello, > > Let's say I want to implement immutability for user-defined class. > More precisely, a class that can be modified only in its (or its > super-class') __init__ method. My initial idea was to do it the > following fashion: > > def __setattr__(s

Re: Question about implementing immutability

2018-11-22 Thread Iwo Herka
czw., 22 lis 2018 o 10:53 Thomas Jollans napisał(a): > If you're tempted to go down that route and can require Python 3.7, use > dataclasses! I'm aware of them, thanks. :) Dataclasses are great for certain use-cases; I was just wondering how hard would it be to implement something approximating g

Re: Question about implementing immutability

2018-11-22 Thread Thomas Jollans
On 2018-11-21 21:36, Calvin Spealman wrote: > If you want to create your own immutable class, maybe inherit from a > namedtuple? If you're tempted to go down that route and can require Python 3.7, use dataclasses! > > On Wed, Nov 21, 2018 at 11:45 AM Iwo Herka wrote: > >> Hello, >> >> Let's s

Re: Question about implementing immutability

2018-11-22 Thread Iwo Herka
Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: > If an instance of your class contains a list, and you change one > of the elements of that list, then the instance's __setattr__ > never comes into play: I think that's within the bounds of what is understood as "immutable" in Python. Tuple

Re: Odd truth result with in and ==

2018-11-22 Thread Chris Angelico
On Thu, Nov 22, 2018 at 7:51 PM Thomas Jollans wrote: > > On 21/11/2018 20:18, Python wrote: > > $ python3 > > Python 3.5.2 (default, Nov 23 2017, 16:37:01) > > [GCC 5.4.0 20160609] on linux > > Type "help", "copyright", "credits" or "license" for more information. > 1 in [1,2,3] == True > >

Re: Odd truth result with in and ==

2018-11-22 Thread Thomas Jollans
On 21/11/2018 20:18, Python wrote: > $ python3 > Python 3.5.2 (default, Nov 23 2017, 16:37:01) > [GCC 5.4.0 20160609] on linux > Type "help", "copyright", "credits" or "license" for more information. 1 in [1,2,3] == True > False 1 in ([1,2,3] == True) > Traceback (most recent call last):