Op 2018-07-29, Terry Reedy schreef :
> multiprocessing module uses 'spawn' rather than 'fork' on Windows and it
> has an option to use 'spawn' even on *nix. I presume the latter refers
> to posix_spawn. You might want to check the multiprocessing code to see
> what *it* is doing 'under the co
Op 2018-07-25, Ian Kelly schreef :
> Is there a reason for using singledispatch here rather than a simpler and
> more readable "if color is None" check?
Yes, the other 20 cases I didn't show.
And extensibility.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2018-07-24, Chris Angelico schreef :
> On Wed, Jul 25, 2018 at 9:18 AM, Rob Gaddi
> wrote:
>> On 07/24/2018 01:07 PM, Chris Angelico wrote:
>> I suppose one valid usage would be this sort of thing:
>>
>> fn = {
>> int: dispatchInt,
>> str: dispatchStr,
>> list: dispatchList,
>> t
Op 2018-07-24, John Ladasky schreef :
> I believe that I now have tensorflow 1.8 installed twice on my system,
> once for each user. If anyone can share how to convince pip to behave
> like Synaptic, I would appreciate it. Thanks.
I would recommend against using pip to install packages into the
Op 2018-07-16, Larry Martell schreef :
> I had some code that did this:
>
> meas_regex = '_M\d+_'
> meas_re = re.compile(meas_regex)
>
> if meas_re.search(filename):
> stuff1()
> else:
> stuff2()
>
> I then had to change it to this:
>
> if meas_re.search(filename):
> if 'MeasDisplay' in
Op 2017-10-23, Thomas Jollans schreef :
> You might wait in a thread
> and somehow (no idea what the best way to do this is in tkinter) pass a
> message to the GUI thread when it's done.
AFAIK, this is a real problem in Tkinter on Windows.
On Posix you can use the self-pipe trick.
But on Windows,
Op 2017-10-23, Thomas Jollans schreef :
> On 24/10/17 00:16, Dick Holmes wrote:
>> I am trying to use tkinter on a FreeBSD system but the installed
>> versions of Python (2.7 and 3.6) don't have thinter configured. I tried
>> to download the source (no binaries available for FreeBSD).
What versi
Op 2017-10-06, Christopher Reimer schreef :
> So I got tox and tox-docker installed. When I went to install Docker
> for Windows, it wouldn't work because Hyper-V wasn't available on
> Windows 10 Home. After paying Microsoft $99 for the privilege, I got
> Windows 10 Pro installed and Docker starte
Op 2017-10-05, Thomas Nyberg schreef :
> Btw if anyone knows a better way to handle this sort of thing, I'm all
> ears. Given my current implementation I could use any compression that
> works with stdin/stdout as long as I could sort out the waiting on the
> subprocess. In fact, bzip2 is probably
Op 2017-10-04, Paul Moore schreef :
> On 4 October 2017 at 16:08, Steve D'Aprano wrote:
>> On Wed, 4 Oct 2017 08:19 pm, Thomas Nyberg wrote:
>>
>>> Hello,
>>>
>>> I was wondering if anyone here knew of any python libraries with
>>> interfaces similar to the bzip2 module which is also multithreaded
Op 2017-10-05, Ben Finney schreef :
> Christopher Reimer writes:
>
>> How do I determine the lowest version of Python to [declare that my
>> code supports]?
>
> You can determine that by installing all the Python versions you want to
> try, and running your code's unit test suite on each of them.
Op 2017-10-01, Bill schreef :
> Steve D'Aprano wrote:
>>
>> [1] Technically, the interpreter knows nothing about properties. What
>> it cares about is *descriptors*. Properties are just one kind of
>> descriptor, as are methods. But I'm intentionally not talking about
>> the gory details of descrip
Op 2017-10-01, Bill schreef :
> I watched an example on YouTube where someone wrote a simple descriptor
> ("@Time_it) to output the amount of time that it took ordinary functions
> to complete.To be honest, I AM interested in descriptors.
Are you sure you are not confusing deSCRIPTtors and
Op 2017-09-30, Marko Rauhamaa schreef :
> Robert L. is only trolling. He uses fake technical comments to spread
> white supremacy in his signatures.
My apologies.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-27, Robert L. schreef :
>> > (defun myloop (initial final increment)
>> > (loop for i = initial then (+ i increment)
>> > while (< i final)
>> > do (print i)
>> > finally (let ((i final)) (print i
>> >
> In Python?
myloop = lambda *args: print("{}{}".forma
Op 2017-09-27, Robert L. schreef :
> (sequence-fold + 0 #(2 3 4))
> ===>
> 9
>
> In Python?
>>> sum([2, 3, 4])
9
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-26, Stefan Ram schreef :
> What happened? I woke up today in parens mood. So I typed:
>
> import( operator )
>
> Python told me that I should type:
>
> import operator
>
> . Fine, Python conditioned me to omit the parens.
> So now I was in noparens mood. So I typed:
>
> help ope
Op 2017-09-25, Stefan Ram schreef :
> So, is there some mechanism in Python that can bind a method
> to an object so that the caller does not have to specify the
> object in the call?
>
> If so, how is this mechanism called?
>
Others have already explained the details how functions become
Op 2017-09-23, Rick Johnson schreef :
> These pissing contests over how values are passed in Python
> are totally irrelevant. What does it matter? Nothing will be
> gained or lost by arguing over which is true, or not. Unless
> the distinction is preventing you from doing something that
> you'd lik
Op 2017-09-22, Pavol Lisy schreef :
> On 9/19/17, leam hall wrote:
>> I'm working on designing the classes, sub-classes, and relationships in my
>> code. What is a good visual way to represent it so it can be stored in git
>> and shared on the list without large images or attachments?
>>
>> Thanks
Op 2017-09-22, Irmen de Jong schreef :
> On 09/22/2017 08:34 PM, Stephan Houben wrote:
>
>> I was vaguely tempted to offer the Mingw-w64 (GCC) Python as an
>> alternative, since it doesn't rely on any optionally-installed Microsoft
>> DLLs and so avoids this issue. But
Op 2017-09-22, Thomas Jollans schreef :
> Just to make the implication explicit:
>
from math import nan
nan is nan
> True
nan == nan
> False
nan != nan
> True
To add to the fun:
>>> nan is nan
True
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-21, Thomas Jollans schreef :
> On 2017-09-19 20:21, Stefan Ram wrote:
>> I do not use UTF-8
>>
>
> Why on earth not?!
Even *More* Older Man Yells at UTF-8?
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-20, Irmen de Jong schreef :
> The only thing I can think of is that it asks windows update to
> install said KB update but that it depends on something else that
> isn't installed or that the user running the installation doesn't have
> the rights to install windows updates. (I suspect s
Op 2017-09-19, Steven D'Aprano schreef :
> There is a significant chunk of the Python community for whom "just pip
> install it" is not easy, legal or even possible. For them, if its not in
> the standard library, it might as well not even exist.
But numpy *is* in the standard library, provided
Op 2017-09-12, Jona Azizaj schreef :
> It looks very nice, thanks for sharing :)
print(insertionSort)
It's even Python3-compliant!
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-12, Tim Golden schreef :
> I agree. Except for the unusual case where someone's mistakenly chosen
> to use, eg, Python 2.4 because they're using an old text book which
> mentions it as the current version, most people are using the version
> which suits them for one reason or another
Op 2017-09-12, Thomas Jollans schreef :
> This isn't the first time I've someone with this issue here. It's
> probably putting off plenty of potential new users who don't make as
> much effort to find a solution. I can't say I understand the ins and
> outs of installing things on Windows... is ther
Op 2017-09-12, Thomas Jollans schreef :
> I'm not sure actually. Maybe someone else here can help. I have a hunch
> that on Windows the memory might not be shared in the same way that it
> would on Linux/Unix, since Windows simply doesn't have the same process
> forking capabilities as Unix.
`mul
Op 2017-09-12, gerlando.fala...@gmail.com schreef :
> Notice however how I'd have to create those Arrays dynamically in the
> producer thread. Would I then be able to pass them to the consumer by
> putting a reference in a queue?
Yes.
> I wouldn't want them to be pickled at all in that case, of
Op 2017-09-11, Antoon Pardon schreef :
> When one wants to combine multithreading and gui programming
> all sorts of issues arise. So I wonder how one might combine
> multiprocessing with gui programming.
>
> gui libraries typically have some registration mechanisme,
> where you can register a call
Op 2017-09-10, Marko Rauhamaa schreef :
> Stephan Houben :
>
>> Would we not eventually want a file object to deliver its lines
>> asynchronously (with non-blocking reads under the hood) if
>> iterated over with "async for", while preserving the current
>
Op 2017-09-10, Rick Johnson schreef :
> It seems to me the best solution is for the TCL/Tk folks to
> provide a configuration utility that stores user preferences
> in the registry, or some other OS provided mechanism, as to
> have these settings reset on every invocation of the
> application would
Op 2017-09-10, Marko Rauhamaa schreef :
> Stephan Houben :
>>
>> Why not bundle the Python interpreter with your application?
>> It seems to work for Windows developers...
>
> I've seen that done for Python and other technologies. It is an
> expensive route to t
Op 2017-09-10, Marko Rauhamaa schreef :
> As an application developer, I can't make the customers depend on EPEL.
> It's Python2 until the distro comes with Python3.
Why not bundle the Python interpreter with your application?
It seems to work for Windows developers...
Stephan
--
https://mail.py
Op 2017-09-10, Chris Angelico schreef :
> Want to make something iterable? Define __iter__. Want to make it
> async-iterable (with "async for")? Define __aiter__. It's a bit clunky
> if you want the same object to be iterable both ways, but I don't know
> of any real-world situations where that's t
Op 2017-09-08, Stefan Ram schreef :
> OTOH, there are those killjoys who complain about
> "too many parentheses" in programs written in the
> "simple language".
Which is clearly nonsense since it is easy to show that any working
program in said simple language contains *precisely enough* par
Op 2017-09-08, logonve...@gmail.com schreef :
> On Saturday, June 18, 2011 at 2:23:10 AM UTC+5:30, SherjilOzair wrote:
>> There are basically two ways to go about this.
>> One is, to append the new value, and then sort the list.
>> Another is to traverse the list, and insert the new value at the
>>
Op 2017-09-06, Rick Johnson schreef :
> One of the nice (current) features of Tkinter menus (that i
> sometimes miss on my windows box!) is the ability to "tear-
> off" a menu cascade and use it as a sort of "pseudo tool
> bar".
I was under the impression that Tk also supported tear-off
menus un
Hi all,
I am a bit mystified about the rationale of the cancellation
behaviour of asyncio.gather.
Case 1:
"If the outer Future is cancelled, all children (that have not completed
yet) are also cancelled."
Case 2:
"If any child is cancelled, this is treated as if it raised
CancelledE
Op 2017-08-17, Rustom Mody schreef :
> On Thursday, August 17, 2017 at 6:49:19 AM UTC+5:30, Mok-Kong Shen wrote:
>> Am 17.08.2017 um 02:41 schrieb Steve D'Aprano:
>> > By reference and by value are not the only two conventions.
>> >
>> > Perhaps if you go back to the 1950s you might be able to arg
Op 2017-08-29, Irmen de Jong schreef :
> I'll have a look at https://www.tcl.tk/man/tcl8.6/TkCmd/keysyms.htm
> but I don't have high hopes because I already tried empirically to
> figure out the distinguishing attributes of the keypress event object,
> on various platforms (Mac OS, Linux, Windows)
Op 2017-09-02, Pavol Lisy schreef :
> But problem is that if somebody like to have stable API it has to be
> changed to "do what the Unicode consortium said (at X.Y. )" :/
It is even more exciting. Presumably a reason to have case-insentivity
is to be compatible with existing popular case-inse
Op 2017-08-23, Ben Finney schreef :
> Could you be convinced to instead do::
>
> import functools
> import itertools
>
> generate_id = functools.partial(next, itertools.count())
I certainly could be, but I was so far unaware of the desirability to do so.
Stephan
--
https://mail.pytho
Op 2017-08-22, Ian Kelly schreef :
> Careful! Python's dunder methods are reserved for use by Python.
> They're exposed so that we can override them. Calling them directly is
> generally considered bad style. And in this case specifically, it's
> not equivalent.
Mmm, you are correct. That's kind
Op 2017-08-11, Paul Rubin schreef :
> I don't think we need this since we have itertools.takewhile:
>
> from operator import gt
> from functools import partial
> from itertools import takewhile
>
> [x + 1 for x in takewhile(partial(gt,5), (0,1,2,999,3,4))]
>
No need for partial and gt.
Op 2017-08-16, Steve D'Aprano schreef :
> Are there language implementations which evaluate the result of map()
> (or its equivalent) in some order other than the obvious left-to-right
> first-to-last sequential order? Is that order guaranteed by the
> language, or is it an implementation detail?
>
Hi Ganesh,
Op 2017-07-27, Ganesh Pal schreef :
> I have a list with say 7 elements say if I need to unpack first 3
> elements in the list and pass it an argument to the new fuction, here is
> my elementary code
One way to do exactly what you request here is:
new_function(*my_list[:3])
Expla
48 matches
Mail list logo