Re: Kind Remainder: How do Practitioners Approach towards Requirements Engineering?

2022-02-08 Thread Avi Gross via Python-list
? -Original Message- From: ETEM ÇETİN TOPTANİ To: python-list@python.org Sent: Tue, Feb 8, 2022 3:52 am Subject: Kind Remainder: How do Practitioners Approach towards Requirements Engineering? Dear Sir or Madam, We prepared a short survey to understand practitioners’ perspectives towards the

Re: Can't get iterator in the C API

2022-02-09 Thread Jen Kris via Python-list
Thank you for clarifying that.  Now on to getting the iterator from the method.  Jen Feb 8, 2022, 18:10 by pyt...@mrabarnett.plus.com: > On 2022-02-09 01:12, Jen Kris via Python-list wrote: > >> I am using the Python C API to load the Gutenberg corpus from the nltk >> l

C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
lib/x86_64-linux-gnu/libpython3.8.so.1.0 My guess is the problem is in Py_BuildValue, which returns a pointer but it may not be constructed correctly.  I also tried it with "O" and it doesn't segfault but it returns 0x0.  I'm new to using the C API.  Thanks for any help.  Jen -- https://mail.python.org/mailman/listinfo/python-list

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
/vrut/python/ext/buildValue.html, PyBuildValue "builds a tuple only if its format string contains two or more format units" and that doc contains examples.  Feb 9, 2022, 16:52 by songofaca...@gmail.com: > On Thu, Feb 10, 2022 at 9:42 AM Jen Kris via Python-list > wrote: >

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
_Call accept tuple, not str. > > > https://docs.python.org/3/c-api/call.html#c.PyObject_Call > >> >> Feb 9, 2022, 16:52 by songofaca...@gmail.com: >> >> On Thu, Feb 10, 2022 at 9:42 AM Jen Kris via Python-list >> wrote: >> >> >> I have everythi

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
ple/amliu/vrut/python/ext/buildValue.html, >> PyBuildValue "builds a tuple only if its format string contains two or more >> format units" and that doc contains examples. >> >> >> Yes, and PyObject_Call accept tuple, not str. >> >> >> ht

Re: Best way to check if there is internet?

2022-02-09 Thread Avi Gross via Python-list
nhangeer about <https://compileralchemy.github.io/> | blog <https://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
if (pSents == > NULL) return NULL`) > Then Python show the exception and traceback for you. > > -- > Inada Naoki > -- https://mail.python.org/mailman/listinfo/python-list

Re: Global VS Local Subroutines

2022-02-10 Thread Rob Cliffe via Python-list
things. But of course, performance is not the only consideration, as per Chris Angelico's answer. Best wishes Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread Jen Kris via Python-list
turn NULL (e.g. `if (pSents == > NULL) return NULL`) > Then Python show the exception and traceback for you. > > -- > Inada Naoki > -- https://mail.python.org/mailman/listinfo/python-list

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread Jen Kris via Python-list
erday.  Thanks much for your help. Jen Feb 9, 2022, 18:43 by pyt...@mrabarnett.plus.com: > On 2022-02-10 01:37, Jen Kris via Python-list wrote: > >> I'm using Python 3.8 so I tried your second choice: >> >> pSents = PyObject_CallFunctionObjArgs(pSentMod, pListItem); >

Re: C API PyObject_Call segfaults with string

2022-02-10 Thread Jen Kris via Python-list
Thank you for that suggestion.  It allowed me to replace six lines of code with one.  :) Feb 10, 2022, 12:43 by pyt...@mrabarnett.plus.com: > On 2022-02-10 20:00, Jen Kris via Python-list wrote: > >> With the help of PyErr_Print() I have it solved.  Here is the final code

Re: Global VS Local Subroutines

2022-02-10 Thread Rob Cliffe via Python-list
which circumstances. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to solve the given problem?

2022-02-10 Thread Avi Gross via Python-list
: NArshad To: python-list@python.org Sent: Thu, Feb 10, 2022 1:40 am Subject: How to solve the given problem? Assume that there is a pattern of feeding for a special fish in a day (10 hours a day) as below:                               150    100    30    30    30    20    20    10    5    5

C API - How to return a Dictionary as a Dictionary type

2022-02-14 Thread Jen Kris via Python-list
dictionary type, enclosed with curly braces.  I found PyObject_GenericGetDict (https://docs.python.org/3.8/c-api/object.html) but I haven't found any documentation or explanation of how it works.  Is PyObject_GenericGetDict what I need, or is there another way to do it? Thanks, Jen -- https://mail.python.org/mailman/listinfo/python-list

Re: C API - How to return a Dictionary as a Dictionary type

2022-02-14 Thread Jen Kris via Python-list
Yes, that works.  This is my first day with C API dictionaries.  Now that you've explained it, it makes perfect sense.  Thanks much.  Jen Feb 14, 2022, 17:24 by ros...@gmail.com: > On Tue, 15 Feb 2022 at 12:07, Jen Kris via Python-list > wrote: > >> >> I created a

Re: Long running process - how to speed up?

2022-02-19 Thread Avi Gross via Python-list
sleeping at the same time may be worse! I note badly defined questions get horrible answers. Mine included. -Original Message- From: Alan Gauld To: python-list@python.org Sent: Sat, Feb 19, 2022 7:33 am Subject: Fwd: Re: Long running process - how to speed up? On 19/02/2022 11:28, Shaozhong

Re: Why does not Python accept functions with no names?

2022-02-20 Thread Avi Gross via Python-list
://www.pythonkitchen.com> github <https://github.com/Abdur-RahmaanJ> Mauritius -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: Long running process - how to speed up?

2022-02-20 Thread Avi Gross via Python-list
Wichmann Cc: python-list@python.org Sent: Sun, Feb 20, 2022 1:05 pm Subject: Re: Long running process - how to speed up? On Sat, 19 Feb 2022 at 19:44, Mats Wichmann wrote: > On 2/19/22 05:09, Shaozhong SHI wrote: > > Can it be divided into several processes? > > Regards, > > Da

Re: Why does not Python accept functions with no names?

2022-02-20 Thread Avi Gross via Python-list
be able to make many such pseudo-anonymous functions, in the end, there can only be one. -Original Message- From: Greg Ewing To: python-list@python.org Sent: Sun, Feb 20, 2022 5:17 pm Subject: Re: Why does not Python accept functions with no names? On 21/02/22 6:27 am, Abdur-Rahmaan

Re: Why does not Python accept functions with no names?

2022-02-21 Thread Avi Gross via Python-list
the user that in case they actually wanted a real function, it is now mxyzptlk666 ... -Original Message----- From: Eryk Sun To: python-list@python.org Sent: Mon, Feb 21, 2022 2:35 am Subject: Re: Why does not Python accept functions with no names? On 2/20/22, Greg Ewing wrote: > > BTW,

Re: One-liner to merge lists?

2022-02-22 Thread Avi Gross via Python-list
7;, 'ccc'], ['fff', 'ggg']] As shown the list comprehension itself is not returning anything of value and need not be assigned to anything. But it then generally is set to autoprint and that can be supressed by assigning the value to _ or anything you can ignore. I

Re: Best way to check if there is internet?

2022-02-22 Thread Avi Gross via Python-list
e we start. Of course, it can change in the seconds that follow. But it's too much pure logic at work. -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list

Re: One-liner to merge lists?

2022-02-22 Thread Avi Gross via Python-list
27;, 'ggg', 666, 'e', 'u', 'a', 'o', 'i'] The quest for a one-liner sometimes forgets that a typical function call is also a one-liner, with the work hidden elsewhere, often in a module written in python or mainly in C and so on. I suspect m

Re: Long running process - how to speed up?

2022-02-23 Thread Robert Latest via Python-list
Shaozhong SHI wrote: > Can it be divided into several processes? I'd do it like this: from time import sleep from threading import Thread t = Thread(target=lambda: sleep(1)) t.run() # do your work here t.wait() -- https://mail.python.org/mailman/listinfo/python-list

Coding help

2022-02-23 Thread Richard Pullin via Python-list
, Richard -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-23 Thread Robert Latest via Python-list
we check for the ability to do it > before we start. Nothing wrong with checking before. > Of course, it can change in the seconds that follow. But it's too much pure > logic at work. No. It's the correct way of doing it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to check if there is internet?

2022-02-23 Thread Robert Latest via Python-list
tion. > So it detected that there is or there is no internet ... Your application obviously needs to make a certain network connection. Why don't you just check if the connection can be made? Why would you care if it's via cable or Wifi? -- https://mail.python.org/mailman/listinfo/python-list

Threading question .. am I doing this right?

2022-02-24 Thread Robert Latest via Python-list
ache.append() because _update() can ever only run in one thread at a time. But maybe I'm overlooking something. -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading question .. am I doing this right?

2022-02-25 Thread Robert Latest via Python-list
se, so that some screens displayed error messages for a minute or two. Nobody cares but my pride was piqued and the error logs filled up. I've had my proposed solution running for a few days now without errors. For me that's enough but I wanted to ask you guys if I made some logical mistakes. -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading question .. am I doing this right?

2022-02-25 Thread Robert Latest via Python-list
a future update. I don't think that's a problem. If it turns out to be one I'll create a copy of the data while I hold the lock and pass that back. > -- https://mail.python.org/mailman/listinfo/python-list

Re: C is it always faster than nump?

2022-02-25 Thread Avi Gross via Python-list
C. It may well be optimized in some places but there are constraints that may well make it hard to optimize compared to some other implementation without those constraints. In particular, it interfaces with standard Python data structures at times such as when initializing from a Python List,

Re: C is it always faster than nump?

2022-02-25 Thread Avi Gross via Python-list
used by so many languages cannot be made part of python such as a vector/array that holds exactly one kind of data structure and not force use of things like a list when that is more than is needed? -Original Message- From: Grant Edwards To: python-list@python.org Sent: Fri, Feb 25, 20

Re: C is it always faster than nump?

2022-02-25 Thread Avi Gross via Python-list
other scientific and machine learning modules. Of course not everyone needs or even wants this. Many simply use base Python techniques even if they are low for larger amounts of data. -- https://mail.python.org/mailman/listinfo/python-list

Re: C is it always faster than nump?

2022-02-25 Thread Avi Gross via Python-list
g on the same language, Python? -Original Message----- From: Chris Angelico To: python-list@python.org Sent: Fri, Feb 25, 2022 2:58 pm Subject: Re: C is it always faster than nump? On Sat, 26 Feb 2022 at 06:44, Avi Gross via Python-list wrote: > > I agree with Richard. > > Some people m

Re: C is it always faster than nump?

2022-02-25 Thread Avi Gross via Python-list
problems. -Original Message- From: Chris Angelico To: python-list@python.org Sent: Fri, Feb 25, 2022 11:16 pm Subject: Re: C is it always faster than nump? On Sat, 26 Feb 2022 at 14:35, Avi Gross via Python-list wrote: > But with numpy and more available anyway, it may not be necessary

Re: Best way to check if there is internet?

2022-02-26 Thread Robert Latest via Python-list
Chris Angelico wrote: > Every language learns from every other. Except Visual Basic, which didn't learn anything from anywhere, and all that can be learned from it is how not to do it. Ugh. -- https://mail.python.org/mailman/listinfo/python-list

Getting Syslog working on OSX Monterey

2022-02-27 Thread Philip Bloom via Python-list
)-338-1439 <786-338-1439> [image: LinkedIn] <https://www.linkedin.com/company/applovin> [image: Twitter] <https://twitter.com/AppLovin> [image: Facebook] <https://facebook.com/AppLovin> [image: Instagram] <https://www.instagram.com/applovin/> [image: AppLovin] <https://www.applovin.com/> -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting Syslog working on OSX Monterey

2022-02-27 Thread Philip Bloom via Python-list
;? [CA= Sender appName] file /var/log/appName/appName.log > > > >My end goal is really to get just a working python logging -> > >var/log/appname/appname.log again so glad to just be pointed in the right > >direction if way off base. > > > -- > Wulfra

Re: Threading question .. am I doing this right?

2022-02-28 Thread Robert Latest via Python-list
- https://mail.python.org/mailman/listinfo/python-list

Re: SQLAlchemy: JSON vs. PickleType vs. raw string for serialised data

2022-02-28 Thread Robert Latest via Python-list
o JSON or String. I've done exactly this. Since my data was strictly ASCII I decided to go for JSON. But in the end you're the only one who can decide this because only you know the data. That's why you won't find any hard and fast rule for this. -- https://mail.python.org/mailman/listinfo/python-list

Re: SQLAlchemy: JSON vs. PickleType vs. raw string for serialised data

2022-03-01 Thread Robert Latest via Python-list
acters in utf8mb4 character set. -- https://mail.python.org/mailman/listinfo/python-list

Re: All permutations from 2 lists

2022-03-01 Thread Rob Cliffe via Python-list
t;us-east-2"), ("Windows", "us-east-1"), "Windows", "us-east-2')] The lists can be different lengths or can be 0 length. Tried a few different things with itertools but have not got just what I need. TIA! -- https://mail.python.org/mailman/listinfo/python-list

Re: All permutations from 2 lists

2022-03-02 Thread Avi Gross via Python-list
ind for future questions. -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting Syslog working on OSX Monterey

2022-03-02 Thread Philip Bloom via Python-list
ld expect as the default if you are using the C > API. > > What you do not see used in the SyslogHandler() is the import syslog > and hence its nor using openlog() etc from syslog API. > > Barry > > > > >hp > > > > -- > > _ | Peter J. Holz

Re: All permutations from 2 lists

2022-03-03 Thread Rob Cliffe via Python-list
On 03/03/2022 14:07, Larry Martell wrote: On Wed, Mar 2, 2022 at 9:42 PM Avi Gross via Python-list wrote: Larry, i waited patiently to see what others will write and perhaps see if you explain better what you need. You seem to gleefully swat down anything offered. So I am not tempted to

Re: All permutations from 2 lists

2022-03-03 Thread Avi Gross via Python-list
It is clear that was not quite your real need. -Original Message- From: Larry Martell To: Avi Gross Cc: python-list@python.org Sent: Thu, Mar 3, 2022 9:07 am Subject: Re: All permutations from 2 lists On Wed, Mar 2, 2022 at 9:42 PM Avi Gross via Python-list wrote: > >

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
rator), and then -- if there are any elements -- processing the first element separately before the for-loop, which means duplicating the loop body. You can see the whole thing gets really ugly really quickly... What are your thoughts? Do you agree? Or am I just not Dutch enough...? -- https://mail.python.org/mailman/listinfo/python-list

Re: Timezone jokes (was: All permutations from 2 lists)

2022-03-03 Thread Avi Gross via Python-list
: Chris Angelico To: python-list@python.org Sent: Thu, Mar 3, 2022 12:40 pm Subject: Re: Timezone jokes (was: All permutations from 2 lists) On Fri, 4 Mar 2022 at 03:29, Tim Chase wrote: > > On 2022-03-03 06:27, Grant Edwards wrote: > > On 2022-03-03, Chris Angelico wrote: > > &

Re: Getting Syslog working on OSX Monterey

2022-03-03 Thread Philip Bloom via Python-list
listener on localhost:514. There are no deamons >> listening on port 514 on my Fedora systems or mac OS. >> >> That is not what you would expect as the default if you are using the C >> API. >> >> What you do not see used in the SyslogHandler() is the impor

Re: Behavior of the for-else construct

2022-03-03 Thread Jon Ribbens via Python-list
ng "Re: replacing `else` with `then` in `for` and `try`". I'm not sure any particular conclusion was reached though except that some people think 'else' is more intuitive and some people think 'then' would be more intuitive. -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-03 Thread Avi Gross via Python-list
age must be added to sparingly and with so many requests, perhaps only a few non bug-fixes can seriously be considered. -Original Message- From: Akkana Peck To: python-list@python.org Sent: Thu, Mar 3, 2022 5:33 pm Subject: Re: Behavior of the for-else construct computermaster360 writes

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
Cliffe On 03/03/2022 23:07, Avi Gross via Python-list wrote: The drumbeat I keep hearing is that some people hear/see the same word as implying something else. ELSE is ambiguous in the context it is used. And naturally, since nobody desperately wants to use non-reserved keywords, nobody seems

Re: Behavior of the for-else construct

2022-03-03 Thread Avi Gross via Python-list
g keyboards is a challenge. Back to the topic, I was thinking wickedly of a way to extend the FOR loop with existing keywords while sounding a tad ominous is not with an ELSE but a FOR ... OR ELSE ... -Original Message- From: Rob Cliffe via Python-list To: python-list@python.org Sent:

Re: Behavior of the for-else construct

2022-03-03 Thread Avi Gross via Python-list
n NEVERTHELESS. -Original Message- From: Chris Angelico To: python-list@python.org Sent: Thu, Mar 3, 2022 7:34 pm Subject: Re: Behavior of the for-else construct On Fri, 4 Mar 2022 at 10:09, Avi Gross via Python-list wrote: > > The drumbeat I keep hearing is that some people h

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
On 04/03/2022 00:34, Chris Angelico wrote: On Fri, 4 Mar 2022 at 10:09, Avi Gross via Python-list wrote: The drumbeat I keep hearing is that some people hear/see the same word as implying something else. ELSE is ambiguous in the context it is used. What I'm hearing is that ther

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
On 04/03/2022 00:38, Avi Gross via Python-list wrote: Rob, I regularly code with lots of comments like the one you describe, or mark the end of a region that started on an earlier screen such as a deeply nested construct. So do I (and not just in Python).  It's good practice. I hav

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
On 04/03/2022 00:43, Chris Angelico wrote: On Fri, 4 Mar 2022 at 11:14, Rob Cliffe via Python-list wrote: I find it so hard to remember what `for ... else` means that on the very few occasions I have used it, I ALWAYS put a comment alongside/below the `else` to remind myself (and anyone

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
On 04/03/2022 01:44, Ethan Furman wrote: On 3/3/22 5:32 PM, Rob Cliffe via Python-list wrote: > There are three types of programmer: those that can count, and those that can't. Actually, there are 10 types of programmer:  those that can count in binary, and those that can't.

Re: Behavior of the for-else construct

2022-03-03 Thread Rob Cliffe via Python-list
#x27;if a break occurred', then at least only one debtor is killed, as an example to the others, and no Exception will occur in the unlikely event of "debtors" being empty. Happy fund-raising! Rob Cliffe There's something in this. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-03 Thread Avi Gross via Python-list
hen you die and it simplifies. -Original Message- From: Rob Cliffe via Python-list To: python-list@python.org Sent: Thu, Mar 3, 2022 8:41 pm Subject: Re: Behavior of the for-else construct On 04/03/2022 00:38, Avi Gross via Python-list wrote: > Rob, > > I regularly code with l

Re: Behavior of the for-else construct

2022-03-03 Thread Avi Gross via Python-list
an ELSE dangling. -Original Message- From: Jach Feng To: python-list@python.org Sent: Thu, Mar 3, 2022 9:22 pm Subject: Re: Behavior of the for-else construct I never feel confused by "else" because I always think it in "break...else", not "for...else".

Re: Behavior of the for-else construct

2022-03-04 Thread Avi Gross via Python-list
as discussed, you could do an IF statement to check if closet is empty but for iterators, it gets ... -Original Message- From: Dieter Maurer To: Rob Cliffe Cc: python-list@python.org Sent: Fri, Mar 4, 2022 2:12 am Subject: Re: Behavior of the for-else construct Rob Cliffe wrote at 2022-3

Re: Behavior of the for-else construct

2022-03-04 Thread Avi Gross via Python-list
t be. I am not one of those that find the current implementation to be the wrong one and will happily use it when I have code that can be done well that way. I am just discussing the issue and wider ones. Languages have an amazing variety of designs that fascinate me. -Original Message

Re: Behavior of the for-else construct

2022-03-04 Thread Avi Gross via Python-list
ye==4 after the loop. The above loop would leave it as aye==None which keeps it from being undefined. To decide if the loop ran at all would thus require further code such as: if aye == None: ... Which leads me right back to wondering why the sentinel approach is so bad! -Origi

Re: Behavior of the for-else construct

2022-03-04 Thread Avi Gross via Python-list
lows something like: result = for ... That might return 0 or None if it was part of the language but it is not. Avi (my current first name) -Original Message- From: Om Joshi To: Avi Gross Cc: python-list Sent: Fri, Mar 4, 2022 3:04 pm Subject: Re: Behavior of the for-else constru

Re: Behavior of the for-else construct

2022-03-04 Thread Rob Cliffe via Python-list
On 04/03/2022 20:52, Avi Gross via Python-list wrote: I have an observation about exception handling in general. Some people use exceptions, including ones they create and throw, for a similar idea. You might for example try to use an exception if your first attempt fails that specifies

Re: Behavior of the for-else construct

2022-03-04 Thread Avi Gross via Python-list
situations where almost all programs are found in the first component of PATH, perhaps the exception approach is not horrible. It may even at times be done with less coding effort than other alternatives. Not my preferred way, of course. -Original Message- From: Rob Cliffe via Python-list

Re: Behavior of the for-else construct

2022-03-04 Thread Avi Gross via Python-list
ing code hard for anyone else to deal with so yes, I would not rewrite key components or do something like make new function names that point to existing standard functions and only use the new (often not pronounceable) names. -Original Message- From: Peter J. Holzer To: pyt

Re: Behavior of the for-else construct

2022-03-05 Thread Rob Cliffe via Python-list
On 05/03/2022 01:15, Cameron Simpson wrote: I sort of wish it had both "used break" and "did not use break" branches, a bit like try/except/else. And "zero iterations". Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-05 Thread Avi Gross via Python-list
my part of this endless conversation may have gone a bit beyond far enough and I await some new topics. -Original Message- From: Rob Cliffe via Python-list To: python-list@python.org Sent: Sat, Mar 5, 2022 7:15 am Subject: Re: Behavior of the for-else construct On 05/03/2022 01:15, Camer

Re: Behavior of the for-else construct

2022-03-05 Thread Avi Gross via Python-list
To: python-list@python.org Sent: Sat, Mar 5, 2022 1:39 pm Subject: Re: Behavior of the for-else construct On 04/03/2022 18.11, Peter J. Holzer wrote: > On 2022-03-04 23:47:09 +, Avi Gross via Python-list wrote: >> I am not sure a reply is needed, Peter, and what you say is true. But

Help: Unable to find IDLE folder inside the Python Lib folder

2022-03-05 Thread Deji Olofinboba via Python-list
IDLE; still the IDLE is still missing. Please. explain to me how I can retrieve the python IDLE. Thank You,   Deji Olofinboba  -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-05 Thread Avi Gross via Python-list
and other languages to undergrads ;-) -Original Message- From: Dennis Lee Bieber To: python-list@python.org Sent: Sat, Mar 5, 2022 7:00 pm Subject: Re: Behavior of the for-else construct On Sat, 5 Mar 2022 21:40:08 + (UTC), Avi Gross declaimed the following: >I am not sure how we end

Re: Behavior of the for-else construct

2022-03-06 Thread Avi Gross via Python-list
orrect, it has a proper spelling. But following that reasoning, why does anyone give an email address of john.sm...@gmail.com or jane...@yahoo.com instead of ...? -----Original Message- From: Peter J. Holzer To: python-list@python.org Sent: Sun, Mar 6, 2022 12:48 pm Subject: Re: Behavior

C API PyObject_CallFunctionObjArgs returns incorrect result

2022-03-06 Thread Jen Kris via Python-list
, \',\', "\'Emma", "\'", \',\', "\'by", "\'", \',\', "\'Jane", "\'", \',\', "\'Austen", "\'", \',\', "\'1816", "\'", \',\', "\'", \']\', "\'", \']\']' I also tried this with PyObject_CallMethodObjArgs and PyObject_Call without success.  Thanks for any help on this.  Jen -- https://mail.python.org/mailman/listinfo/python-list

Re: C API PyObject_CallFunctionObjArgs returns incorrect result

2022-03-07 Thread Jen Kris via Python-list
the same way as ‘’.join, and if not then (2) how can I strip characters from a string object in the C API?  Thanks. Mar 6, 2022, 17:42 by pyt...@mrabarnett.plus.com: > On 2022-03-07 00:32, Jen Kris via Python-list wrote: > >> I am using the C API in Python 3.8 with the nltk

Re: C API PyObject_CallFunctionObjArgs returns incorrect result

2022-03-07 Thread Jen Kris via Python-list
The PyObject str_sentence is a string representation of a list.  I need to convert the list to a string like "".join because that's what the library call takes.  Mar 7, 2022, 09:09 by ros...@gmail.com: > On Tue, 8 Mar 2022 at 04:06, Jen Kris via Python-list > wrote: &g

Re: C API PyObject_CallFunctionObjArgs returns incorrect result

2022-03-07 Thread Jen Kris via Python-list
e way as ‘’.join, and if not then (2) how >> can I strip characters from a string object in the C API? >> > Your Python code is joining the list with a space as the separator. > > The equivalent using the C API is: > >     PyObject* separator; >     PyObject*

Problem slicing a list with the C API

2022-03-12 Thread Jen Kris via Python-list
ideas. Jen -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem slicing a list with the C API

2022-03-12 Thread Jen Kris via Python-list
s.com: > On 2022-03-12 21:24, Jen Kris via Python-list wrote: > >> I have a C API project where I have to slice a list into two parts.   >> Unfortunately the documentation on the slice objects is not clear enough for >> me to understand how to do this, and I haven’t found e

Re: Problem slicing a list with the C API

2022-03-12 Thread Jen Kris via Python-list
pDictData, despite the name, is a list of 2-tuples where each 2-tuple is a dictionary object and a string.  Mar 12, 2022, 13:41 by ros...@gmail.com: > On Sun, 13 Mar 2022 at 08:25, Jen Kris via Python-list > wrote: > >> PyObject* slice = PySlice_New(PyLong_FromLong(0)

Re: Problem slicing a list with the C API

2022-03-12 Thread Jen Kris via Python-list
;s a borked one, kaboom). > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem slicing a list with the C API

2022-03-12 Thread Jen Kris via Python-list
e sequence API. In Python, you can > write extend() as +=, indicating that you're adding something onto the > end: > >>>> x = ["spam", "ham"] >>>> x += (1, 2) >>>> x >>>> > ['spam', 'ham', 1, 2] > > This corresponds to PySequence_InPlaceConcat, so if that's the > behaviour you want, that would be the easiest way to do it. > > Based on your other comments, I would suspect that appending the > tuples is probably what you want here? > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: for convenience

2022-03-21 Thread Avi Gross via Python-list
as its own quirks and we have adjusted our thinking multiple times by the time welearned Python. What Paul suggests is just a convenience is more than that. It is a variablebinding with many ramifications. -Original Message- From: Chris Angelico To: python-list@python.org Sent: Mon, Ma

convenience

2022-03-22 Thread Avi Gross via Python-list
carefully. Regular users may easily make mistakes for the sake of convenience. So I wonder if some pythonic methods fit into convenience modes or can veer into dangerous modes. Spelling things out in full detail may be annoying but generally safer. -- https://mail.python.org/mailman/listinfo/python-list

Re: for convenience

2022-03-22 Thread Avi Gross via Python-list
n arbitrary data structure and have to say first.next.next.next.next ... Also noted is your use of a direct pointer had positive and also negative ramifications to consider. It is not a synonym just for convenience. -Original Message----- From: Paul St George To: python-list@python.org S

Re: convenience

2022-03-22 Thread Avi Gross via Python-list
suggestion that unless you know the code well and can be sure you won't corrupt things, this kind of convenient access has possible dangers. -Original Message- From: Greg Ewing To: python-list@python.org Sent: Tue, Mar 22, 2022 7:12 pm Subject: Re: convenience On 23/03/22 7:00 am, Avi

Pyto Implementation - GROWING TREND

2022-03-24 Thread Steeve Kerou via Python-list
utube.com/watch?v=Eoh7FVR_QcM&list=PLipSv-7x4nWdPTwpZ0pDoOnGhhg3vboh5 Have a look, Learn Python With Pytohttps://www.youtube.com/channel/uccmxvj1uadepa1ekqqwxz4galan.vec...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: for convenience

2022-03-24 Thread Avi Gross via Python-list
se it is what it is so get over it! -Original Message- From: Paul St George To: python-list@python.org Sent: Thu, Mar 24, 2022 6:31 am Subject: Re: for convenience On 22/03/2022 18.04, dn wrote: > and thank you - it is refreshing, if not enervating, to receive feedback &

Re: for convenience

2022-03-24 Thread Avi Gross via Python-list
sure, you could write code that reads fileA.py and outputs fileB.py and only run fileB through the interpreter. Yes, instead of making versions which have all kinds of text written in various languages, you could just have the python code read in various files at run time or other techniques. -

Re: for convenience

2022-03-24 Thread Avi Gross via Python-list
xample, which I sometimes use in my programming, literally jumps out of the initial language. -Original Message- From: Chris Angelico To: python-list@python.org Sent: Thu, Mar 24, 2022 1:37 pm Subject: Re: for convenience On Fri, 25 Mar 2022 at 04:15, Avi Gross via Python-list wrote: &g

Re: for convenience

2022-03-24 Thread Avi Gross via Python-list
for a programming class and it definitely would have been much easier to do in Python. -Original Message- From: Chris Angelico To: python-list@python.org Sent: Thu, Mar 24, 2022 7:57 pm Subject: Re: for convenience On Fri, 25 Mar 2022 at 10:44, Avi Gross wrote: > But would it

Re: How to detect an undefined method?

2022-03-27 Thread Kirill Ratkin via Python-list
) logger.addHandler(handler) num = randrange(0,1000) if num == 0: logger.err("got zero") else: logger.info(f'got a positive integer: {num}') if __name__ == "__main__": main() -- https://mail.python.org/mailman/listinfo/python-list

Re: How to detect an undefined method?

2022-03-27 Thread Kirill Ratkin via Python-list
me somebody has a codebase of 15T lines of Python code. How do you want to apply your method? But perhaps I overlook things. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to detect an undefined method?

2022-03-27 Thread Avi Gross via Python-list
t has that method before trying to invoke it, or you can handle exceptions generated if it doesn't. -Original Message- From: Kirill Ratkin via Python-list To: python-list@python.org Sent: Sun, Mar 27, 2022 2:29 pm Subject: Re: How to detect an undefined method? I just started to

Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-03-28 Thread Cecil Westerhof via Python-list
ntu for servers is that Ubuntu wants to be up to date. So Ubuntu starts very close to Debian security wise, but will shift rapidly. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: calling a function asynchronously

2022-03-30 Thread Kirill Ratkin via Python-list
; > asyncio.run(long()) > print('after asyncio.run') > > The final print does not come out until after long() completes. > > Is there any way to do this? > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: calling a function asynchronously

2022-03-30 Thread Kirill Ratkin via Python-list
19:10, Larry Martell пишет: import asyncio import time async def long(): for i in range(100): time.sleep(10) asyncio.run(long()) print('after asyncio.run') -- https://mail.python.org/mailman/listinfo/python-list

Re: calling a function asynchronously

2022-03-30 Thread Kirill Ratkin via Python-list
Hi 30.03.2022 21:44, Larry Martell пишет: On Wed, Mar 30, 2022 at 2:40 PM Kirill Ratkin via Python-list wrote: Hi again, I changed a bit your example and it works as you expected I hope. import asyncio async def long(): for i in range(100): await asyncio.sleep(10

<    26   27   28   29   30   31   32   33   34   35   >