> You might try `py-spy`.
That worked well, I started trying to get more data from the profile
output with the stats module but didn't quite get there.
Thank you everyone,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
I am trying to track down a slow script startup time. I have executed the
script using `python -m cProfile -o profile /path/script.py` and read through
the results, but the largest culprit only shows various built-ins.
I expected this given the implementation, but I was hoping to get some
finer de
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote:
> Greetings list,
>
> Let's say i created a package named miaw
>
> miaw also has a cli command called miaw
>
> miaw prints files and folders in the directory it is called in
>
> except that when miaw is used, it prints the files and folders i
On 27/10/2021 12.29, Stefan Ram wrote:
> dn writes:
>> On 27/10/2021 11.16, Stefan Ram wrote:
>>> The Mental Game of Python - Raymond Hettinger (PyBay 2019)
>>> | "The computer gives us words that do ### things.
> ...
>> Alternately, if your question was to identify the mumbled word, it is
>> (se
On 25/09/2021 11.00, Chris Angelico wrote:
> Invented because there weren't enough markup languages, so we needed another?
Anything You Can Do I Can Do Better
https://www.youtube.com/watch?v=_UB1YAsPD6U
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list
Officially April-Fools Day is over (here), but...
On 01/04/2021 19.25, Chris Angelico wrote:
> On Thu, Apr 1, 2021 at 3:36 PM dn via Python-list
> wrote:
>>
>> On 01/04/2021 13.54, Chris Angelico wrote:
>>> Real and imaginary are the same thing, just rotated a quarter turn
>>
>> In which dim
> I couldn't find any information on how to implement logging in a library that
> doesn't know the name of the application that uses it. How is that done?
Hello,
That's not how it works, it is the opposite. You need to know the name of its
logger,
and since you imported it, you do.
Logging is hi
I have some code that makes use of the typing module.
This code creates several instances of objects it creates
from a library that has some issues.
For example, I have multiple list comps that iterate properties
of those instance and the type checker fails with:
Expected type 'collections.It
On 14/01/2021 15.25, boB Stepp wrote:
> On Wed, Jan 13, 2021 at 7:28 PM Chris Angelico wrote:
>
>> I love how "I think" is allowed to trump decades of usability research.
I'm just pleased that @Chris has found love!
(not detracting from the point though)
> Can you recommend a good reference fo
On 07/01/2021 22.44, Dario Dario wrote:
> Sir, I am one of the user of your python program, that is after completion
> of installation I got some statement like "you got code execution problem
> ". I don't know how to rectify this problem.so please help me to rectify
> this problem .
> You send me
I've started writing some asyncio code in lieu of using threads and
managing concurrency and primitives manually.
Having spent a lot of time using c#'s async implementation, I am struggling
to see an elegant pattern for implementing cancellation. With the necessity
for the loop (that of which I un
> If you have windows 10 can you use Windows Subsystem for Linux (WSL)
> to install one of the Linux distros and use that?
Interesting idea, sadly I am too far past the deadline on this to go through
the red tape needed to get that in place.
Thanks,
jlc
--
https://mail.python.org/mailman/listi
Anyone ever used pexpect with tooling like kadmin and have
insight into how to manage interacting with it?
After setting up debug logging, I was able to adjust the expect
usage to get the input and output logs to at least appear correct
when setting a password for a principal, however even with a
> Installed on this Slackware-14.2/x86_64 workstation with python-3.9.1 are:
> python-setuptools-22.0.5-x86_64-1
I just ran into this recently, I don't recall the actual source but it was the
version
of setuptools having been so old. Your version is from Jun 3, 2016...
Update it, that was what w
> Invalid character found in method name [{}POST]. HTTP method names must be
> tokens.
/snip
> I could see in from wireshark dumps it looked like - {}POST
> HTTP/1.1
The error message and your own debugging indicate the error.
Your method *name* is {}POST, you have somehow included two
brac
On 31/07/2020 16:48, R Pasco wrote:
Thanks for your extensive info. Its too bad this isn't published in the
python winreg/_winreg modules' info.
Ray Pasco
Welcome to the world of documentation!
Perhaps you have 'discovered' something, or maybe you're using the tool
in an unusual way, or mayb
I need off this list please. I don’t even have this.
On Wed, Jun 3, 2020 at 11:30 PM Albert Chin <
python-l...@mlists.thewrittenword.com> wrote:
> On Wed, Jun 03, 2020 at 08:11:17PM -0400, Dennis Lee Bieber wrote:
> > On Tue, 2 Jun 2020 12:26:16 -0500, Albert Chin
> > de
I have some json encoded input for nodemailer
(https://nodemailer.com/message/embedded-images)
where the path key is a string value which contains the base64 encoded data
such as:
{
html: 'Embedded image: ',
attachments: [{
filename: 'image.png',
path: 'data:image/png;bas
On 6/04/20 10:35 AM, Malcolm Greene wrote:
Is there a difference between the following 2 ways to launch a console-less
script under Windows?
python
I am looking to replace a home built solution which allows a program
to derive a series of variable values through configuration or policy.
The existing facility allows dependences so one of the requested variables
can depend on another, they are ordered and computed. It also allows
callbacks so c
Please help me with this.
squares =input("\nSquares: ")
print(float((squares) *float(.15)) *(1.3))
Cant print answer.
print(float((squares) * float(.15)) *(1.3))
TypeError: can't multiply sequence by non-int of type 'float'
Thx
L Smit
--
https://mail.python.or
Hi
New to programming.
Please can u help me. I have python 3.7 installed on linux peppermint 10
and pyinstaller 3.6 but dont know how to run pyinstaller or how to
install it on the correct diectory.
Thx
L Smit
--
https://mail.python.org/mailman/listinfo/python-list
input.
I understand that there is probably hundreds of these programs but to
teach myself i want to wright my own program and then i can update it
when needed.
Thx
L Smit
--
https://mail.python.org/mailman/listinfo/python-list
On 23/10/19 8:51 PM, joseph pareti wrote:
I am experimnenting with this (reproducer) code:
pattern_eur= ['Total amount']
mylines = []# Declare an empty list.
with open ('tmp0.txt', 'rt') as myfile: # Open tmp.txt for reading text.
for myline in myfile:
On 7/10/19 4:11 AM, Alexander Vergun wrote:
Hello all,
I am coding a voice assistant under Python 3.7, Windows 7. I am using
PYcharm and libraries such as PYSimpleGUI, mouse, keyboard etc.
Everything works except for the mouse control and probably keyboard, the
problem is following, when I ru
On 7/10/19 4:11 AM, Alexander Vergun wrote:
I am coding a voice assistant under Python 3.7, Windows 7. I am using
PYcharm and libraries such as PYSimpleGUI, mouse, keyboard etc.
Everything works except for the mouse control and probably keyboard, the
problem is following, when I run the script
Hi All,
Please ignore it, I was able to figure out it.
for dev in devlist:
print (dev.name, dev.id)
--
Thanks & Regards
Mohan L
On Fri, Sep 27, 2019 at 8:41 PM Mohan L wrote:
> Hi All,
>
> I am using get_devices_list method from this module:
> https://github.com/
:
devicename1 10
devicename2 11
devicename3 12
I spend quit some time still not able to figure out how to parse. Can some
one through some light on how to phrase it.
--
Thanks & Regards
Mohan L
--
https://mail.python.org/mailman/listinfo/python-list
-Original Message-
From: Barry Scott
Sent: Tuesday, July 16, 2019 11:53 AM
To: Joseph L. Casale
Cc: python-list@python.org
Subject: Re: Class initialization with multiple inheritance
> And here is the MRO for LeftAndRight.
>
> >>> import m
> LeftAndRight.__ini
I am trying to find explicit documentation on the initialization logic for a
Base class when multiple exist. For the example in the documentation at
https://docs.python.org/3/tutorial/classes.html#multiple-inheritance,
if Base1 and Base2 both themselves inherited from the same base class,
only Base
Hi,
Is it possible to associate combinations of types for a given signature, for
example:
T = TypeVar('T', Foo, Bar, Baz)
S = TypeVar('S', FooState, BarState, BazState)
closure = 'populated dynamically'
def foo(factory: Callable[[List[T], str], None], state: S) -> List[T]:
results = []
> -Original Message-
> From: Python-list bounces+jcasale=activenetwerx@python.org> On Behalf Of Simon
> Connah
> Sent: Thursday, March 14, 2019 3:03 AM
> To: Python
> Subject: asyncio Question
>
> Hi,
>
> Hopefully this isn't a stupid question. For the record I am using Python
> 3.7
-Original Message-
From: Python-list On Behalf Of Rhodri
James
Sent: Friday, September 21, 2018 11:39 AM
To: python-list@python.org
Subject: Re: Serializing complex objects
> Depending on what exactly your situation is, you may be able to use the
> pickle module (in the standard library)
I need to serialize a deep graph only for the purposes of visualizing it to
observe primitive data types on properties throughout the hierarchy.
In my scenario, I cannot attach a debugger to the process which would
be most useful. Using json is not the easiest as I need to chase endless
custom seri
-Original Message-
From: Python-list On Behalf Of Skip
Montanaro
Sent: Wednesday, August 15, 2018 3:26 PM
To: Python
Subject: lxml namespace as an attribute
> Much of XML makes no sense to me. Namespaces are one thing. If I'm
> parsing a document where namespaces are defined at the top
From: Brian Gibbemeyer
Sent: Tuesday, April 24, 2018 12:36 PM
To: Joseph L. Casale
Cc: python-list@python.org
Subject: RE: Issue with python365.chm on window 7
> I right clicked on the file, no option to unblock.
Sorry, choose properties, then unblock.
--
https://mail.python.org/mail
-Original Message-
From: Python-list On Behalf Of Brian
Gibbemeyer
Sent: Tuesday, April 24, 2018 11:01 AM
To: Ethan Furman
Cc: python-list@python.org
Subject: Re: Issue with python365.chm on window 7
> The file at
> https://www.python.org/ftp/python/3.6.4/python364.chm
>
> Loads up into
From: Python-list on
behalf of Irv Kalb
Sent: Monday, April 16, 2018 10:03 AM
To: python-list@python.org
Subject: Instance variables question
> class PartyAnimal():
> x = 0
>
> def party(self):
> self.x = self.x + 1
> print('So far', self.x)
Your not accessing the
-Original Message-
From: Python-list On Behalf Of MRAB
Sent: Friday, April 13, 2018 12:05 PM
To: python-list@python.org
Subject: Re: Python regex pattern from array of hex chars
> Use re.escape:
>
> regex = re.compile('[^{}]+'.format(re.escape(''.join(c for c in
> character_class
Br
I have an array of hex chars which designate required characters.
and one happens to be \x5C or "\". What foo is required to build the
pattern to exclude all but:
regex = re.compile('[^{}]+'.format(''.join(c for c in character_class)))
I would use that in a re.sub to collapse and replace all but
-Original Message-
From: Python-list On Behalf Of joseph
pareti
Sent: Sunday, March 25, 2018 10:15 AM
To: python-list@python.org
Subject: issues when buidling python3.* on centos 7
> The following may give a clue because of inconsistent python versions:
>
> [joepareti54@xxx ~]$ python -V
From: Python-list on
behalf of Rob Gaddi
Sent: Thursday, March 15, 2018 12:47 PM
To: python-list@python.org
Subject: Re: Context manager on method call from class
> from contextlib import contextmanager.
>
> Then you just use the @contextmanager decorator on a function, have it
> set up,
I have a class which implements a context manager, its __init__
has a signature and the __enter__ returns an instance of the
class.
Along with several methods which implement functionality on
the instance, I have one method which itself must open a context
manager against a call on an instance att
On Thu, Oct 5, 2017 at 17:07 Fetchinson . via Python-list <
python-list@python.org> wrote:
> Hi folks,
>
> I have a rather simple program which cycles through a bunch of files,
> does some operation on them, and then quits. There are 500 files
> involved and each operation takes about 5-10 MB of m
-Original Message-
From: Python-list [mailto:python-list-
bounces+jcasale=activenetwerx@python.org] On Behalf Of Ian Kelly
Sent: Tuesday, May 30, 2017 8:12 AM
To: Python
Subject: Re: Python DB API - commit() v. execute("commit transaction")?
> There's no difference I'm aware of in the
> > I have a string which is returned by a C extension.
> >
> > mystring = '(1,2,3)'
> >
> > HOW can I read the numbers in python ?
>
> re.findall seems the safest and easiest solution:
>
> >>> re.findall(r'(\d+)', '(1, 2, 3)')
> ['1', '2', '3']
> >>> map(int, re.findall(r'(\d+)', '(1, 2, 3)'))
>
-Original Message-
From: Python-list [mailto:python-list-
bounces+jcasale=activenetwerx@python.org] On Behalf Of Malik Rumi
Sent: Friday, April 14, 2017 9:12 AM
To: python-list@python.org
Subject: Regular Expressions, Speed, Python, and NFA
> I am running some tests using the site rege
On 1/8/2017, Steven D'Aprano wrote:
> Suppose you have an expensive calculation that gets used two or
> more times in a loop. The obvious way to avoid calculating it
> twice in an ordinary loop is with a temporary variable:
>
> result = []
> for x in data:
> tmp = expensive_calculation(x)
>
On 1/18/2017, Peter Otten wrote:
> with partite.txt looking like this
>
> > 74' Kessie'
> > 90' + 4' D'alessandro
> > 51' Mchedlidze
> > 54' Banega
> > 56' Icardi
> > 65' Icardi
> > 14' Sau
>
>
> Assuming you want to perform a numerical sort on the numbers before the '
> you can just apply sor
On 3/1/2017, Sayth Renshaw wrote:
> How can I flatten just a specific sublist of each list in a list of lists?
>
> So if I had this data
>
>
> [ ['46295', 'Montauk', '3', '60', '85', ['19', '5', '1', '0 $277790.00']],
> ['46295', 'Dark Eyes', '5', '59', '83', ['6', '4', '1', '0 $105625.00
On 3/7/2017, Sayth Renshaw wrote:
> I have got this dictionary comprehension and it
> works but how can I do it better?
>
> from collections import Counter
>
> def find_it(seq):
> counts = dict(Counter(seq))
> a = [(k, v) for k,v in counts.items() if v % 3 == 0]
> return a[0][0]
>
> C# hardly seems any better than Java to me as far as a language goes.
Which sounds pretty good to me, they are both high performance, mature
and rich languages.
> Being forced into working with classes even when they are not
> appropriate is jarring.
And 100% irrelevant, it doesn't prevent you
> Python still has my heart, but .NET Core tempts me. One great thing of
> coding in C# would be no GIL.
Seriously, check out the benchmarks at https://github.com/aspnet/benchmarks.
I think aside from the obvious, you'll find the Razor engine and the overall
library
to be a pleasure to work with
> What do you mean by "both platforms"? Python scripts already run on
> three major operating systems (Win/Lin/Mac) and a good number of
> less-popular OSes; a well-written Python script will run in four major
> Pythons (CPython, PyPy, Jython, IronPython) and a number of others;
> and all manner of
> What .NET APIs are anticipated to be released that aren't on the
> official CLI list now:
> https://en.wikipedia.org/wiki/List_of_CLI_languages#Current_Languages,
> and/or, are .NET supported languages expected to expand beyond the CLI
> list?
I think this (and the last point) misinterprets the
> .NET is a library that can be used from many languages, including Python.
No.
.NET Core (what the OP asked about which is not .NET) is a cross-platform
framework. Obviously Python and .NET differ in runtime semantics with
respect to the original source code, however they are now roughly equiva
> Trying to sniff Ethernet packets, I do this:
>
>s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
>
> but it results in this:
>
> $ sudo python3 sniff_survey.py
> Traceback (most recent call last):
> File "sniff_survey.py", line 118, in
> s = socket
> while True:
>for client in clients:
> stats = ThreadStats()
> stats.start()
> p = Process(target=getWhispererLogsDirSize, args=(client,queue,))
> jobs.append(p)
> p.start()
> p.join()
You start one client then join before starting the next...
Start them all an
> And this is coming up a lot. This is something that should already be
> on all supported versions of Windows if Windows updates are done, right?
No, it's not an update. You install the runtime *if* you need it.
> but maybe it's time that the
> Python installer bundles the redistributable inst
> Just downloaded Python 3.6.0 2016-12-23 and PyCharm. Tried to run the "Hello
> World" program and got the following message:
> "Process finished with exit code 1073741515 (0xC135)"
> I am using Windows 8.1 on an HP ENVY Touchsmart Notebook (64-bit OS,
> x64-based processor).
If you track
> So you are saying that nuget-ing .Net core would be a workable pre-requisite
> for
> Rx on mono?
Microsoft open sourced .net a while ago. With that came the movement to
bring .net to other platforms.
https://en.wikipedia.org/wiki/.NET_Framework#.NET_Core
As its currently being heavily develop
> One more question: Do you know if (and how much) of these things would work
> in Linux/C# (ie mono)?
Mono, I forgot what that is when .net core debuted:)
Looks like the .net Rx guys have a port,
https://github.com/Reactive-Extensions/Rx.NET/issues/148
A package for .net core is up on nuget.
> Thanks Joseph
> Trouble is there is stew of technologies/languages…
> (meta)-stewed with more abstract concepts, eg push vs pull,
> Enumerable-Observable
> duality, continuous vs discrete time
> The last causing its own share of confusion with “functional reactive
> programming” (FRP) meaning s
>> There is the recent flurry around the new async additions to python
>
> I meant to add: “… which I dont pretend to understand…”
Try these links on for size:
https://msdn.microsoft.com/en-us/library/hh242982(v=vs.103).aspx which links to
https://msdn.microsoft.com/en-us/library/hh242983(v=vs.10
> Try these links on for size:
>
> https://msdn.microsoft.com/en-us/library/hh242982(v=vs.103).aspx which links
> to
> https://msdn.microsoft.com/en-us/library/hh242983(v=vs.103).aspx near the end.
These two SO threads have a variation of pretty good explanations:
http://stackoverflow.com/questi
On 10/27/2016 11:05 PM, Michael Torrie wrote:
> On 10/27/2016 04:07 AM, Terry Reedy wrote:
>> As I and others have said, those keyboard functions are not available on
>> text terminals. I predict that keyboard functions that so not work on
>> all systems will never become built-ins. But some ar
Looks like the shipped implementation doesn't give access to all the discrete
copies
of tls for us in a case where a context manager needs to perform any cleanup.
Does
something exists where I can leverage this feature or do I need to roll my own?
Thanks,
jlc
--
https://mail.python.org/mailman
Im running windows 7 pro, 64 bit. I downloaded 3.5.2 64 bit and when I try to
run I get the error message api-ms-win-crt-runtime-l1-1-0.dll is missing. I
loaded that file and still will not run.
suggestions?
thanks
--
https://mail.python.org/mailman/listinfo/python-list
> Interesting. Generally, I allocate cursors exactly at the same time as I open
> transactions;
> not sure if this works with the mysql connector, but with psycopg2
> (PostgreSQL), my code looks like this:
>
> with conn, conn.cursor() as cur:
> cur.execute(...)
> ... = cur.fetchall()
>
>
> Perhaps you simplified too much, but changes between the select and the
> update could be lost. I think you need at least three states:
>
> 1 mark rows where baz is null (by setting baz to some value other than NULL
> or 42, 24, say: set baz = 24 where baz is NULL)
> 2 show marked rows (select
I have some code that I am testing on Windows without c extensions which
runs on a RHEL server with c extensions. In a simplified test case as follows:
connection = mysql.connector.connect(...)
cursor = connection.cursor(cursor_class=MySQLCursorDict)
while True:
cursor.execute('SELECT foo,biz
When I debug in C++, I see the reference count of a PyObject is 1. I don't
know where is referencing this object. How can I find out where is
referencing this object?
2016-09-27 15:47 GMT+08:00 dl l :
> Thanks for reply. Is there any function in C to get the reference objects
> of
Thanks. That's helpful. I did not notice the note.
2016-09-27 19:24 GMT+08:00 Ned Batchelder :
> On Tuesday, September 27, 2016 at 3:54:01 AM UTC-4, dl l wrote:
> > What is the difference between PyImport_AddModule and PyImport_Import?
> >
> > When need to use PyImpo
What is the difference between PyImport_AddModule and PyImport_Import?
When need to use PyImport_AddModule?
When need to use PyImport_Import?
--
https://mail.python.org/mailman/listinfo/python-list
Thanks for reply. Is there any function in C to get the reference objects
of a object? I want to debug where are referencing the object.
2016-09-27 15:01 GMT+08:00 dieter :
> dl l writes:
> > I want to check the references of an object. Any way to get the
> references
> >
I want to check the references of an object. Any way to get the references
of an object with Python C API? Like: gc.get_referrs(), is there similar
API in C lib?
--
https://mail.python.org/mailman/listinfo/python-list
=
2016-09-21 13:09 GMT+08:00 dieter :
> dl l writes:
> > I found the problem is resolved if call PyGC_Collect() after
> > PyDict_DelItemString(). Is it expected to call PyGC_Collect() here for
> > Python 3.5 which is not needed for Python 3.3?
>
> Usually, Python use
Thank you all for the help.
I found the problem is resolved if call PyGC_Collect() after
PyDict_DelItemString(). Is it expected to call PyGC_Collect() here for
Python 3.5 which is not needed for Python 3.3?
2016-09-20 16:01 GMT+08:00 Chris Angelico :
> On Tue, Sep 20, 2016 at 4:19 PM, d
equires my customers to update their python scripts. That
may make them unhappy :(. Is there a workaround in my code C++ side to call
Python C APIs to resolve the memory leak issue?
2016-09-20 13:49 GMT+08:00 Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info>:
> On Monday 19 Septembe
Thanks for the replay.
I run this script as __main__ module, this module is removed from
sys.modules, and the ref count becomes 0.
2016-09-20 0:00 GMT+08:00 Chris Angelico :
> On Mon, Sep 19, 2016 at 4:47 PM, dl l wrote:
> > I have a app loading python35.dll. Use python API PyImport_
Hi,
I have a app loading python35.dll. Use python API PyImport_AddModule
to run a py file. And use PyDict_DelItemString to delete the module.
There is a global vailable in the py file. The global variable is not
destroyed when calling PyDict_DelItemString to delete the module. That
cause the memor
> Or any other libraries that can be recommended?
I'd recommend Spyne, code and docs are good, but more importantly the
lead dev is responsive and very helpful. Can't speak highly enough about him...
http://spyne.io/
hth,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
> Not sure if this fits the bill, or makes sense here, but I came cross
> "docopt" which touts itself as a "Command-line interface description
> language". I used it in a project and it seems to be pretty easy to use
> as well as elegant. It stores the arguments & values as a dictionary,
> keyed by
I have some code where sys.argv is sliced up and manually fed to discrete
argparse
instances each with a single subparser. The reason the discrete parsers all
having a
single subparser was to make handling the input simpler, the first arg in the
slice
could be left in.
This has become unmaintai
Hi All,
I am using the bellow script to watch directories. Using 20 seconds to
aggregate together a larger chunk of events and enabled coalescing of
events.
I wanted to send an email notification with content of logfile after 15
mins on any change. The idea is I want to send only one mail for ch
> I generally avoid c_void_p because its lenient from_param method
> (called to convert arguments) doesn't provide much type safety. If a
> bug causes an incorrect argument to be passed, I prefer getting an
> immediate ctypes.ArgumentError rather than a segfault or data
> corruption. For example, w
I have CDLL function I use to get a pointer, several other functions happily
accept this
pointer which is really a long when passed to ctypes.c_void_p. However, only
one with
same type def in the prototype overflows. Docs suggest c_void_p takes an int
but that
is not what the first call returns,
> If a method call on any instance defines the return value for
> all instances, then this method likely should be a class method --
> and use a class attribute to store the result -- something like this:
>
> class C(object):
>
> _cache = {}
>
> @classmethod
> def f(cls, ...):
>
> One solution is to use descriptor protocol on the class, which means
> using a metaclass. I'm not sure it's the best option, but it is an
> option.
I will look at that, I wonder if however I am not over complicating it:
class Foo:
_bar = None
@property
def expensive(self):
i
> I think Joseph is using "static" in the Java sense of being associated with
> the class rather than an instance. (In Java, members of classes must be
> known at compile-time.)
Yup, so a single value on the class itself, not instance specific.
> But what you can do is have the property refer to
With non static properties, you can use a decorator that overwrites the
method on the instance with an attribute containing the methods return
effectively caching it.
What technique for a static property can be used to accomplish what the
descriptor protocol does?
I need to cache the results of a
> It's still not clear to me specifically what you're trying to do. It
> would really help if you would describe the problem in more detail.
> Here's what I think you're trying to do:
>
> 1) Submit a task to a ThreadPoolExecutor and get back a future.
>
> 2) When the task is complete, submit anot
On Thur, Feb 17, 2016 at 9:24 AM, Ian Kelly wrote:
>> What is the pattern for chaining execution of tasks with ThreadPoolExecutor?
>> Callbacks is not an adequate facility as each task I have will generate new
>> output.
>
> Can you specify in more detail what your use case is?
>
> If you don't m
What is the pattern for chaining execution of tasks with ThreadPoolExecutor?
Callbacks is not an adequate facility as each task I have will generate new
output.
Thanks,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
I can't download Python and I need it for class. Any suggestions?
Ingram Jansen
Banner ID: 830742998
--
https://mail.python.org/mailman/listinfo/python-list
> If you're not already familiar with collections.namedtuple, have a
> look at it, as it sounds like just naming the fields may be all that
> you need. You can also subclass it further to add methods if desired.
Yeah, all the types in these collections are named tuples... The collection
itself isn
I need to return a collection of various types, since python doesn't
have the terse facility of extension methods like C#, subclassing tuple
and adding a method seems like a terse way to accommodate this.
However, if the method returns one element of the collection, how can
one enable introspectio
> Like that?
>
> >>> class M2(enum.EnumMeta):
>... def __contains__(self, value):
>... print(value, "? never", sep="")
>... return False
>...
> >>> Colors.__class__
>
> >>> Colors.red in Colors
> checking Colors.red
> True
> >>> Colors.__class__ = M2
> >>> Colors.red in Colors
import enum
class M(enum.EnumMeta):
>... def __contains__(self, value):
>... print("checking", value)
>... return super().__contains__(value)
>...
class Colors(enum.Enum, metaclass=M):
>... red = 1
>... green = 2
>... blue = 3
>...
Colors.red in C
Is it possible to override __contains__ from the meta class in the derived class
with the Enum type?
Thanks,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
1 - 100 of 618 matches
Mail list logo