Re: type annotation vs working code

2023-10-04 Thread dn via Python-list

On 04/10/2023 19.41, Chris Angelico via Python-list wrote:

On Wed, 4 Oct 2023 at 15:27, dn via Python-list  wrote:

- should the class have been called either;

  class SomethingSingleton():

or a Singleton() class defined, which is then sub-classed, ie

  class Something( Singleton ):

in order to better communicate the coder's intent to the reader?


TBH, I don't think it's right to have a Singleton class which is
subclassed by a bunch of different singletons. They aren't really
subclasses of the same class. I could imagine Singleton being a
metaclass, perhaps, but otherwise, they're not really similar to each
other.


I'm with you on this - should have made Singleton() an ABC.

Yes, would only be a skeleton around which concrete singleton classes 
could be built.


Like you, I v.rarely use them - but which means that the ABC is useful 
because it would save me from having to remember the curly-bits 
all-over-again...


--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list


Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-04 Thread Pau Vilchez via Python-list
   Hello Python Team,

    

   I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my
   computer. I have tried deleting the Appdata folder then repairing and then
   uninstalling but it still persists in the remove/add program function in
   windows 10. I am just trying to reinstall it because I didn’t add it to
   the path correctly, any help is greatly appreciated.

    

   Very Respectfully,

    

   Pau Vilchez

    
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-04 Thread Roland Müller via Python-list


On 25.9.2023 19.58, Pau Vilchez via Python-list wrote:

Hello Python Team,

 


I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my
computer. I have tried deleting the Appdata folder then repairing and then
uninstalling but it still persists in the remove/add program function in
windows 10. I am just trying to reinstall it because I didn’t add it to
the path correctly, any help is greatly appreciated.

This is a Windows issue and not actually Python -specific. It may happen 
to every program you install.


If something is installed by the normal way using the W10 installer it 
should be removable too. If not there should be some error.


 


Very Respectfully,

 


Pau Vilchez

 

--
https://mail.python.org/mailman/listinfo/python-list


Re: type annotation vs working code

2023-10-04 Thread Karsten Hilbert via Python-list
Am Wed, Oct 04, 2023 at 05:25:04PM +1300 schrieb dn via Python-list:

> The first question when dealing with the Singleton Pattern is what to do when 
> more than
> one instantiation is attempted:
>
> - silently return the first instance

This, in my case.

> and so, returning to the matter of 'readability':
>
> - the name "Borg" de-railed comprehension
>
> - _instances:dict = {} implied the tracking of more than one

Child classes, yes, each being a Singleton.

> or a Singleton() class defined, which is then sub-classed, ie
>
> class Something( Singleton ):

Could have been but the legacy codebase came with Borg ...

> - from there, plenty of 'templates' exist for Singletons,

...  which was taken from the Web ages ago.

> - this article (https://python-patterns.guide/gang-of-four/singleton/)

Reading.

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B
-- 
https://mail.python.org/mailman/listinfo/python-list