Re: Running asyncio.run() more than once

2023-03-14 Thread gst
Le mardi 14 mars 2023 à 02:32:23 UTC-4, Clint Olsen a écrit : > We have an application that involves submitting hundreds to thousands of jobs > to a shared computing resource, and we're using asyncio to do so because it > is far less overhead than threading or multiprocessing for the bookkeeping

Question About When Objects Are Destroyed

2017-08-04 Thread gst
'two' is a so called constant or literal value .. (of that function). Why not attach it, as a const value/object, to the function itself ? So that a new string object has not to be created each time the function is called. Because anyway strings are immutable. So what would be the point to

Re: Dynamically replacing an objects __class__; is it safe?

2017-03-15 Thread gst
Hi, You can subclass M2 from M1 and override only what you need. Regards, -- https://mail.python.org/mailman/listinfo/python-list

Re: asyncio does not always show the full traceback

2017-03-03 Thread gst
Le mercredi 1 mars 2017 09:25:48 UTC-5, Frank Millman a écrit : > "Frank Millman" wrote in message news:o93vs2$smi$1...@blaine.gmane.org... SNIP > > If you run this as is, it works. > > I added '1/0' at various points, to force an exception. > > If I put it in main() or in aenum(), I do

Re: PTH files: Abs paths not working as expected. Symlinks needed?

2017-02-15 Thread gst
Le mercredi 15 février 2017 10:34:42 UTC-5, Steve D'Aprano a écrit : > On Wed, 15 Feb 2017 11:42 pm, poseidon wrote: > > > Yes, removed it (symlink still there) and it still works. But then, what > > are pth files for? > > > Good question. I don't actually know anyone that uses pth files, so

Re: logger.info / logger.error with logger.addHandler - how to split streams?

2016-12-26 Thread gst
Le lundi 26 décembre 2016 10:34:48 UTC-5, Alec Taylor a écrit : > So I'm putting .info in one StringIO and .error in another StringIO. > > How do I stop them from both being put into both? > > Code: http://ideone.com/Nj6Asz Hi, it's doable with filter on the handlers: def

Re: Just starting to learn Python, and encounter a problem

2016-07-23 Thread gst
Heuh case 2 : "String1" or "String2" Evaluates to "String1" ? -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-05-19 Thread gst
I know this does not bring anything valuable but: Definitively agree with your mental model !! 'then' and only "then" is the best keyword in the situation which is on the table right now. it totally fix the confusing "else" actual mess (for at least 2 reasons). Python 4.0 ? My son will thank

Re: 0 equals False, was Re: (unknown)

2016-03-23 Thread gst
Le mercredi 23 mars 2016 04:52:02 UTC-4, Peter Otten a écrit : > Nick Eubank wrote: > > > Hello All, > > > > > > Found an odd behavior I'd never known about today, not sure if it's a bug > > or known. Python 3.4.4 (anaconda). > > True, False, 0, 1 can all be used as dictionary keys. > > > >

Sometimes bottle takes a lot of time

2015-08-21 Thread gst
What if you try with all the SQLite code commented ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Passing new fields to an object

2015-06-12 Thread gst
. What is the best way to achieve this? Thanks in the __init__, simply do: self.__dict__.update(**parms) regards, gst. -- https://mail.python.org/mailman/listinfo/python-list

Re: encoding name mappings in codecs.py with email/charset.py

2014-12-14 Thread gst
' old = email.charset.Charset.__str__ def patched(self): r = old(self) if r.startswith('iso'): return 'iso-' + r[3:] return r email.charset.Charset.__str__ = patched str(c) 'iso-8859-7' regards, gst. -- https://mail.python.org/mailman

Re: encoding name mappings in codecs.py with email/charset.py

2014-12-14 Thread gst
Le dimanche 14 décembre 2014 14:10:22 UTC-5, Stefanos Karasavvidis a écrit : thanks for replying gst. I've thought already of patching the Charset class, but hoped for a cleaner solution. This ALIASES dict has already all the iso names *with* a dash. So it must get striped somewhere

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-28 Thread gst
Le jeudi 27 décembre 2012 21:01:16 UTC+1, mogul a écrit : 'Aloha! holà ! I'm new to python, got 10-20 years perl and C experience, all gained on unix alike machines hacking happily in vi, and later on in vim. About same than me, though I had not to use/work with perl for new projects,

Re: Py330b1, un café crème sucré

2012-06-27 Thread gst
On 27 juin, 22:48, Karim kliat...@gmail.com wrote: Euhhh, j'ai pas tout suivi. C'est quoi la feinte? Perso je suis pas sûr qu'il y en ait une. Je dirais que l'OP a peut-être eu un grand besoin de café crème sucré et a voulu partager son plaisir avec d'autres, why not ;) regards, gst

Re: why () is () and [] is [] work in other way?

2012-04-21 Thread gst
Le samedi 21 avril 2012 10:46:39 UTC+2, Alexander Blinne a écrit : Am 21.04.2012 05:25, schrieb Rotwang: This happens only because the first [] gets destroyed after evaluation of id([]). The second [] then by accident gets the same id as the first one had. a = [] b = [] id(a) ==

Re: First python project : Tuner

2012-01-17 Thread gst
On 17 jan, 15:16, Jérôme jer...@jolimont.fr wrote: Hi all. hi, just my 2 cents: you have quite lot of such test: if self._index is 0: I think it's better to compare with equality against 0 (or other needed value) ; that is: if self._index == 0: otherwise your code looks very nice to me,

Re: use of __new__ to permit dynamic completion within (any?) IDE ?

2010-12-08 Thread gst
On 8 déc, 11:45, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Tue, 07 Dec 2010 07:52:06 -0800, gst wrote: Hi, But in my IDE I want the completion to also work from within the lower level module when it's refering to the object passed from the upper level

Re: use of __new__ to permit dynamic completion within (any?) IDE ?

2010-12-08 Thread gst
On 8 déc, 14:09, Steve Holden st...@holdenweb.com wrote: If you'd told us which IDE you were using we might have offered better advice, but you seem to want to keep that a secret (my IDE tells us nothing). sorry it was totally bottom of my first message : note: I'm using Eclipse 3.5.2 with

Re: use of __new__ to permit dynamic completion within (any?) IDE ?

2010-12-08 Thread gst
On 8 déc, 15:51, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Hi, gst wrote: nb: so this hack is only relevant during dev ; once the project would be finished the hack could be removed (i.e : in class2 init I would directly do : self.object1 = object1) Expect some bugs

Re: use of __new__ to permit dynamic completion within (any?) IDE ?

2010-12-08 Thread gst
On 8 déc, 16:20, gst g.sta...@gmail.com wrote: On 8 déc, 15:51, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Hi, gst wrote: nb: so this hack is only relevant during dev ; once the project would be finished the hack could be removed (i.e : in class2 init I would directly do

Re: use of __new__ to permit dynamic completion within (any?) IDE ?

2010-12-08 Thread gst
On 8 déc, 16:20, gst g.sta...@gmail.com wrote: even with the assert(self is _self) in the if _self: condition in the new and/or  init methods of the class1 ? damn : in the init method only of course.. -- http://mail.python.org/mailman/listinfo/python-list

use of __new__ to permit dynamic completion within (any?) IDE ?

2010-12-07 Thread gst
Hi, I met a situation where I was passing an object created in/with an upper level module class to a lower level module class' instance in one of its __init__ argument and saving a ref of the upper object in that lower level class' new instance. But in my IDE I want the completion to also work