there is insufficient
consensus as to what that actually means.
--
https://mail.python.org/mailman/listinfo/python-list
also defines a format for
durations (e.g. 'P4Y3M' for '4 years 3 months'), I don't think
I have ever seen it used in practice - not least because apparently
it doesn't define what it actually means. So there isn't one simple
standard agreed by everyone that is an obvious candidate for inclusion
in language standard libraries.
--
https://mail.python.org/mailman/listinfo/python-list
's all in their own slightly-different
little niches. There isn't one straightforward standard that makes all
or even most of them happy.
--
https://mail.python.org/mailman/listinfo/python-list
division
operation ;-)
--
https://mail.python.org/mailman/listinfo/python-list
.
Life is complicated. Then you die.
-Original Message-
From: Chris Angelico
To: [email protected]
Sent: Wed, Apr 20, 2022 3:49 pm
Subject: Re: Why no list as dict key?
On Thu, 21 Apr 2022 at 05:30, Sam Ezeh wrote:
>
> Repeating the above points, here is an example of what would
n.org/mailman/listinfo/python-list
nil
On Friday, April 22, 2022, 09:09:22 AM PDT, Sunil KR via Python-list
wrote:
I have some scripts that are old and won't work under python2 and at the same
time I am writing new scripts which will use python3. However, if python 2 and
3 cannot co-exist in a windows box it will
ddressed to him?
Best wishes
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
user can ignore
or not even catch.
-Original Message-
From: Chris Angelico
To: [email protected]
Sent: Fri, Apr 22, 2022 6:33 pm
Subject: Re: Style for docstring
On Sat, 23 Apr 2022 at 08:24, <[email protected]> wrote:
>
> On 2022-04-22 at 15:35:15 -050
d by either style but when
documenting what is, I prefer proper English (or any otherlanguage) in
communicating what it does for them.
As with many such things, if you work for a company or with groups of others,
it is wise to find out what is expected and do the same as much as reasonable.
.
-Original Message-
From: Michael F. Stemper
To: [email protected]
Sent: Sat, Apr 23, 2022 8:57 am
Subject: Re: Style for docstring
On 22/04/2022 21.58, Avi Gross wrote:
> Python does have a concept of "truthy" that includes meaning for not just the
> standard
, if I can make python 2 and 3
coexist on my system
> On 22 Apr 2022, at 17:10, Sunil KR via Python-list
wrote:
>
> I have some scripts that are old and won't work under python2 and at the
> same time I am writing new scripts which will use python3. However, if python
Dennis Lee Bieber AF6VN
[email protected] http://wlfraed.microdiversity.freeddns.org/
--
https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
lines of text with a fixed or maximum
width,then storing in some database format, perhaps indexed, may be a way to go.
A time stamped log file is a good example.
So which problem is really supposed to be solved for the original question?
-Original Message-----
From: Roel Schroeven
To: py
t;, "Return(s)": "Text",
"Optional-Note": "Text", "French version": DocStringFrench}
Too late to seriously change the language now!
-Original Message-
From: Michael F. Stemper
To: [email protected]
Sent: Sun, Apr 24, 2022 9:24 am
Subj
xercises> python hello.py*
*The system cannot find the path specified.*
*C:\Users\gd752>cd C:\google-python-exercises>*
*The syntax of the command is incorrect.*
I installed version 3.10. I am stuck and could use some help.
Thx,
[image: directory pic.png]
--
https://mail.python.org/m
items which are frobby and composes a
nangle of the items.
'''
I very much like the concise imperative opening sentence, sometimes 2
sentences. Then the elaboration if the function isn't trivially obvious.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
t;pythonic" as I've never seen anyone do that (that doesn't mean of
course that other people haven't seen it done!) Personally I only tend
to use print() for debugging output.
> 4. Does Python 3.x exhibit the same behaviour as Python 2.x in this respect?
Yes.
--
https://mail.python.org/mailman/listinfo/python-list
doing that.
Still, if you're feeling noble, you could start the work of making your
code Python 3 compatible.😁
Best wishes
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
https://wiki.python.org/moin/PythonBooks
-Original Message-
From: Patrick 0511
To: [email protected]
Sent: Wed, May 4, 2022 9:36 pm
Subject: Python/New/Learn
Hello, I'm completely new here and don't know anything about python. Can
someone tell me how best to start? So w
resources including videos and on-line courses.
If he wants simpler books, the web pages pointed here too:
https://wiki.python.org/moin/IntroductoryBooks
Next time, I won't try to be helpful and brief and just be silent.
-Original Message-
From: Chris Angelico
To: python
: [email protected]
Sent: Wed, May 4, 2022 11:21 pm
Subject: Re: Python/New/Learn
On Thu, 5 May 2022 at 13:14, Avi Gross wrote:
>
> Chris,
>
> It was an extremely open-ended question to a forum where
> most of the readers are more advanced, at least I think.
>
>
> My libr
calls asking if I want to sell my house
...
-Original Message-
From: Schachner, Joseph
To: Patrick 0511 ; [email protected]
Sent: Thu, May 5, 2022 12:04 pm
Subject: RE: Python/New/Learn
Buy the book "Python 101" and do the examples. When you're done with that buy
Original Message-
From: [email protected]
To: [email protected]
Sent: Fri, May 6, 2022 8:56 am
Subject: Re: Python/New/Learn
On 2022-05-05 at 16:51:49 -0700,
Grant Edwards wrote:
> On 2022-05-05, Mats Wichmann wrote:
>
> > Without having any data at all on it,
general purpose tool,
internationalization from ASCII has created a challenge for lots of such tools.
-Original Message-
From: Marco Sulla
To: Dennis Lee Bieber
Cc: [email protected]
Sent: Sat, May 7, 2022 9:21 am
Subject: Re: tail
On Sat, 7 May 2022 at 01:03, Dennis Lee Bieber wrote:
>
>
than how to stepwise make changes in a pipeline so reading from the beginning
to end was not an issue.
-Original Message-
From: Marco Sulla
To: Chris Angelico
Cc: [email protected]
Sent: Wed, May 11, 2022 5:27 pm
Subject: Re: tail
On Wed, 11 May 2022 at 22:09, Chris Angelico wrote
needed but for smaller
files, KISS.
-Original Message-
From: Dennis Lee Bieber
To: [email protected]
Sent: Wed, May 11, 2022 6:15 pm
Subject: Re: tail
On Thu, 12 May 2022 06:07:18 +1000, Chris Angelico
declaimed the following:
>I don't understand why this wants to b
rame with embedded spaces and other anomalies requiring
special handling.
So why you wonder where it is documented that variables cannot be what you feel
like is a bit puzzling!
-Original Message-
From: bryangan41
To: [email protected]
Sent: Fri, May 13, 2022 12:47 pm
Subject: .0 i
... ❽ ❽
-Original Message-----
From: Avi Gross via Python-list
To: [email protected]
Sent: Fri, May 13, 2022 6:02 pm
Subject: Re: .0 in name
Bryan,
As has been pointed out, it is very common in possibly all programming
languages to not allow digits at the start of many identifiers. It
dundering name like __init__
...
-Original Message-
From: dn
To: [email protected]
Sent: Sat, May 14, 2022 12:33 am
Subject: Re: .0 in name
This is not what @Avi menat by "silly variable names" but:
3D_position
2nd_floor_area
3M_PostIt_size
3rd_degree_po
#x27;x', 'y')
and sometimes
('x', 'y')
('y', 'x')
Can anyone explain why running identical code should result in
traversing a set in a different order?
Thanks
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
On 16/05/2022 04:13, Dan Stromberg wrote:
On Sun, May 15, 2022 at 8:01 PM Rob Cliffe via Python-list
wrote:
I was shocked to discover that when repeatedly running the following
program (condensed from a "real" program) under Python 3.8.3
for p in { ('x
Thanks, Paul. Question answered!
Rob Cliffe
On 16/05/2022 04:36, Paul Bryan wrote:
This may explain it:
https://stackoverflow.com/questions/27522626/hash-function-in-python-3-3-returns-different-results-between-sessions
On Mon, 2022-05-16 at 04:20 +0100, Rob Cliffe via Python-list wrote
/Python/nmap.py", line 1, in
> import nmap
>File "/home/gabriele/Documenti/Python/nmap.py", line 2, in
> nm.scan(hosts='192.168.205.0/24', arguments='-n -sP -PE
> -PA21,23,80,3389')
> NameError: name 'nm' is not defined
You
jip/python-gnupg/releases/
[5] https://docs.red-dove.com/python-gnupg/
--
https://mail.python.org/mailman/listinfo/python-list
get you up to speed, but then again, we often find out someone is
given a homework assignment ...
-Original Message-
From: Tola Oj
To: [email protected]
Sent: Mon, May 23, 2022 4:54 pm
Subject: oop issue
i just finished learning oop as a beginner and trying to practice with i
erefore cannot immediately reproduce the error
message.Can you help?
Howard Samuels
Are You Ready for Jesus to Come?
--
https://mail.python.org/mailman/listinfo/python-list
the original (perhaps with some normalization of case and whitespace, fine. If
not will they match if one or both have something to remove as a prefix such as
"02 ". And if you are comparing items where the same song is in two different
numeric sequences on different disks, ...
x27;, 8722: '-', 8216: "'",
8217: "'", 8220: '"', 8221: '"', 64256: 'ff', 160: ' ',
64260: 'ffl', 8198: ' ', 230: 'ae', 12288: ' ', 173: '',
497: 'DZ', 498: 'Dz', 499: 'dz', 64259: 'ffi', 8230: '...',
64257: 'fi', 64262: 'st'})
If you want to go further then the Unidecode package might be helpful:
https://pypi.org/project/Unidecode/
--
https://mail.python.org/mailman/listinfo/python-list
ther and how
the computer language called python, and perhaps some add-on modules, can be
used to solve each smaller need such as recognizing a pattern or replacing
text. It can do quite a bit but only when the specification of the problem is
exact.
-Original Message-
From: Dave
To: py
I note lots of people who come with what they
consider a good programming background have to adjust to aspects of languages
like python as what they know is in some ways wrong or inadequate in a new
environment.
-Original Message-----
From: Dave
To: [email protected]
Sent: Thu, Jun 9,
dal_array.py
>
>
> What steps to be take to resolve this issue?
>
> Regards,
>
> David
Hi David,
I am having this same issue. Where you ever able to resolve it?
Payton
--
https://mail.python.org/mailman/listinfo/python-list
books/courses.
I think I am now going to ignore messages from you for a while. Signal to noise
ratio ...
-Original Message-
From: Dave
To: [email protected]
Sent: Thu, Jun 9, 2022 6:43 am
Subject: Function to Print a nicely formatted Dictionary or List?
Hi,
Before I write my own
printed will happen to write over the same spots.
As to what tools you can use, there are many to choose from. You asked on a
Python list so you may want some of the Python Graphics utilities. In R, I
might use ggplot which lets me set a background layer then draw objects above
it at various
Dude, it's called CPython for a reason.
--
https://mail.python.org/mailman/listinfo/python-list
ssage-
From: Paulo da Silva
To: [email protected]
Sent: Mon, Jun 20, 2022 8:53 pm
Subject: Re: "CPython"
Às 20:01 de 20/06/22, Paulo da Silva escreveu:
> Às 18:19 de 20/06/22, Stefan Ram escreveu:
>> The same personality traits that make people react
>> to troll p
who kept improving C thought the ++ concept
was best removed!
-Original Message-
From: Greg Ewing
To: [email protected]
Sent: Tue, Jun 21, 2022 3:53 am
Subject: Re: "CPython"
On 21/06/22 2:56 pm, Paulo da Silva wrote:
> Let's say they reimplement "reference
?
-----Original Message-
From: David J W
To: [email protected]
Sent: Thu, Jun 23, 2022 10:29 am
Subject: Re: "CPython"
>> Let's say they reimplement "reference python" CPython in Rust. What is
>> better? Change the "reference python" CPyth
varied! LOL!
-Original Message-
From: David J W
To: Avi Gross
Cc: [email protected]
Sent: Fri, Jun 24, 2022 11:57 am
Subject: Re: "CPython"
The main motivation for a Python virtual machine in Rust is to strengthen my
knowledge with Rust which currently has some gnarly
ot; for more information.
>>> def f(): pass
... def g(): pass
File "", line 2
def g(): pass
^
SyntaxError: invalid syntax
>>>
Is there a good reason for this?
Thanks
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
re a good reason for this?
For some reason, the REPL can't cope with one-line blocks like that.
If you put a blank line after each one-block line then it will work.
--
https://mail.python.org/mailman/listinfo/python-list
On 26/06/2022 23:22, Jon Ribbens via Python-list wrote:
On 2022-06-26, Rob Cliffe wrote:
This 2-line program
def f(): pass
def g(): pass
runs silently (no Exception). But:
23:07:02 c:\>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32
bit (Intel)] on wi
Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
That worked. Many thanks Eryk.
Rob
On 30/06/2022 23:45, Eryk Sun wrote:
On 6/30/22, Rob Cliffe via Python-list wrote:
AKAIK it is not possible to give ctypes a bytearray object and persuade
it to give you a pointer to the actual array data, suitable for passing
to a DLL.
You're overlo
proceed step by step and see if any previous steps failed.
But what is possible is you got a file with .nii in middle of the name that
does not end in .gz, or is not in the format needed.
Good luck,
אבי גרוס
-Original Message-----
From: MRAB
To: [email protected]
Sent: Fri, Jul 8, 2022
ot;Difumo_names"].values()),
> figure=(9, 7), vmax=1, vmin=-1,
> title='Covariance')# The covariance can be found
> at estimator.covariance_
>
> # The covariance can be found at estimator.covariance_
> t2= nilearn.plot
ajip
[1] https://pypi.org/project/distlib/0.3.5/
[2] https://distlib.readthedocs.io/en/0.3.5/
[3] https://github.com/pypa/distlib/issues/new/choose
--
https://mail.python.org/mailman/listinfo/python-list
uijer
--
https://mail.python.org/mailman/listinfo/python-list
indication is that the second version would take about two
times as much time as the first. Is there a reason for this, or should
this not be happening?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python
Chris Angelico writes:
> On Wed, 27 Jul 2022 at 01:06, Cecil Westerhof via Python-list
> wrote:
>>
>> I need to get a random integer. At first I tried it with:
>> from secrets import randbelow
>> index = randbelow(len(to_try))
>>
>> This wo
Chris Angelico writes:
> On Wed, 27 Jul 2022 at 06:06, Cecil Westerhof via Python-list
> wrote:
>>
>> Chris Angelico writes:
>>
>> > On Wed, 27 Jul 2022 at 01:06, Cecil Westerhof via Python-list
>> > wrote:
>> >>
>> >> I need
Barry writes:
>> On 26 Jul 2022, at 16:07, Cecil Westerhof via Python-list
>> wrote:
>>
>> I need to get a random integer. At first I tried it with:
>>from secrets import randbelow
>>index = randbelow(len(to_try))
>>
>> This works perf
should not be used more as once.
This is the code I use:
# index = randbelow(len(to_try))
index = randrange(len(to_try))
found = permutation[to_try.pop(index)]
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> On Wed, 27 Jul 2022 at 08:18, Cecil Westerhof via Python-list
> wrote:
>>
>> Chris Angelico writes:
>>
>> > On Wed, 27 Jul 2022 at 06:06, Cecil Westerhof via Python-list
>> > wrote:
>> >>
>> >> Chris A
dbelow(len(to_try))
index = randrange(len(to_try))
found = permutation[to_try.pop(index)]
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
ition.
I had already switched to randrange. This went to 15 minutes from 21
minutes.
By removing the method lookup I could shave off another minute. So
certainly noteworthy. (Should have thought about it myself.)
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
In: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
ve OS install/extra install via OS repository
> download (Debian/Ubuntu: apt install xxx, where xxx is not the native OS
> Python)
Just the default Debian install.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
MRAB writes:
> On 27/07/2022 16:43, Cecil Westerhof via Python-list wrote:
>> "Michael F. Stemper" writes:
>>
>>> This is orthogonal to your question, but might be of some use to you:
>>>
>>> The combination of using len(to_try) as an
[email protected] writes:
> On 2022-07-27 at 17:48:47 +0200,
> Regarding "Re: More efficient code, but slower program,"
> Cecil Westerhof via Python-list wrote:
>
>> [email protected] (Stefan Ram) writes:
>>
>> > Cecil W
Roel Schroeven writes:
> Cecil Westerhof via Python-list schreef op 27/07/2022 om 17:43:
>> "Michael F. Stemper" writes:
>>
>> > This is orthogonal to your question, but might be of some use to you:
>> >
>> > The combination of using len(to_
ot be a lot more expensive? Especially because I do
>> not eat the whole list.
>>
> You won't know until you time it.
A first indication is that it doubles the needed time.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
is not needed
anymore?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
= timedelta(days=365)
>>print(year.max)
> 9 days, 23:59:59.99
>>print(year.max.min.max.resolution.max.min)
> -9 days, 0:00:00
Why do you think this is a bug?
--
https://mail.python.org/mailman/listinfo/python-list
s
an answer to a homework question. You'll have to work out the details
yourself.
--
Mladen Gogala
Database Consultant
https://dbwhisperer.wordpress.com
--
https://mail.python.org/mailman/listinfo/python-list
icrosoft\WindowsApps\python.exe"
4NT: (Sys) No access to the file.
"C:\Users\gvane\AppData\Local\Microsoft\WindowsApps\python.exe"
No matter what I do with this "App Alias" setting.
What a broken and confusing design this AppX design is.
--
--gv
--
https://mail.python.org/mailman/listinfo/python-list
https://pypi.org/project/chardet/
--
https://mail.python.org/mailman/listinfo/python-list
are supposed to be sent
using the same encoding as the page, so if you're sending the page
as "latin1" then you'll see that a fair amount I should think. If you
send it as "utf-8" then you'll get 100% utf-8 back.
--
https://mail.python.org/mailman/listinfo/python-list
On 2022-08-17, Barry wrote:
>> On 17 Aug 2022, at 18:30, Jon Ribbens via Python-list
>> wrote:
>> On 2022-08-17, Tobiah wrote:
>>> I get data from various sources; client emails, spreadsheets, and
>>> data from web applications. I find that I can do
>
put:
or:
in the section of your HTML document. The HTML "standard"
nowadays says that you are only allowed to use the "utf-8" encoding,
but if you use another encoding then browsers will generally use that
as both the encoding to use when reading the HTML file and the encoding
to use when submitting form data.
--
https://mail.python.org/mailman/listinfo/python-list
using. I think it's quite likely
it will use UTF-32 (i.e. fixed-width 32 bits per character).
> How does the browser know what sort of data it has in that text box?
It's a text box, so it knows it's text.
--
https://mail.python.org/mailman/listinfo/python-list
ng its href attribute. Fairly simple changes, but might alter
> the length of the file (eg changing "http://example.com/"; into
> "https://example.com/";). I'd like to do them intelligently rather than
> falling back on element.sourceline and element.sourcepos, but worst
> case, that's what I'll have to do (which would be fiddly).
I'm tempting the Wrath of Zalgo by saying it, but ... regexp?
--
https://mail.python.org/mailman/listinfo/python-list
o them in reverse order of line and offset I suppose) and
probably resorting to regexps anyway in order to find the part of the
tag you want to change ...
... or you could avoid all that faff and just do re.sub()?
--
https://mail.python.org/mailman/listinfo/python-list
rser" )
> for a in reference.find_all( "a" ):
> if a[ 'href' ]== 'http': a[ 'href' ]='https'
>
> print( bs4.BeautifulSoup( result, features="html.parser" )== reference )
Hmm, yes that seems like a pretty good idea.
--
https://mail.python.org/mailman/listinfo/python-list
On 2022-08-21, Chris Angelico wrote:
> On Sun, 21 Aug 2022 at 09:31, Jon Ribbens via Python-list
> wrote:
>> On 2022-08-20, Chris Angelico wrote:
>> > On Sun, 21 Aug 2022 at 03:27, Stefan Ram wrote:
>> >> [email protected] writes:
>> >
On 2022-08-21, Peter J. Holzer wrote:
> On 2022-08-20 21:51:41 -, Jon Ribbens via Python-list wrote:
>> On 2022-08-20, Stefan Ram wrote:
>> > Jon Ribbens writes:
>> >>... or you could avoid all that faff and just do re.sub()?
>
>> > source =
On 2022-08-21, Chris Angelico wrote:
> On Mon, 22 Aug 2022 at 05:43, Jon Ribbens via Python-list
> wrote:
>> On 2022-08-21, Chris Angelico wrote:
>> > On Sun, 21 Aug 2022 at 09:31, Jon Ribbens via Python-list
>> > wrote:
>> >> On 2022-08-20, Chris Angel
On 2022-08-22, Peter J. Holzer wrote:
> On 2022-08-22 00:45:56 -, Jon Ribbens via Python-list wrote:
>> With the offset though, BeautifulSoup made an arbitrary decision to
>> use ISO-8859-1 encoding and so when you chopped the bytestring at
>> that offset it only worked
[1] https://github.com/vsajip/python-gnupg
[2] https://pypi.org/project/python-gnupg/0.5.0
[3] https://github.com/vsajip/python-gnupg/issues
[4] https://github.com/vsajip/python-gnupg/releases/
[5] https://docs.red-dove.com/python-gnupg/
--
https://mail.python.org/mailman/listinfo/python-list
I like his writing a lot, but
he also only seems to have written only for the R language.
Thank you!
David Beazley
--
https://mail.python.org/mailman/listinfo/python-list
s/fields/__init__.py",
> line 1548, in pre_save return super().pre_save(model_instance, add)
> File
> "/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/fields/__init__.py",
> line 1411, in pre_save return super().pre_save(model_instance, add)
> File
> "/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/fields/__init__.py",
> line 905, in pre_save return getattr(model_instance, self.attname) File
> "/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/query_utils.py",
> line 178, in __get__ instance.refresh_from_db(fields=[field_name]) File
> "/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/base.py",
> line 741, in refresh_from_db db_instance = db_instance_qs.get() File
> "/var/django/liakoster.nl/blog-1/lib/python3.10/site-packages/django/db/models/query.py",
> line 650, in get raise self.model.DoesNotExist(
>
> Exception Type: DoesNotExist at /admin/blog/blog/add/
> Exception Value: blog matching query does not exist.
> --
> https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
l run time is
> down to about 50 seconds.
Downloading things from the network is *extremely* I/O-bound.
So, as you have discovered, the GIL is going to make essentially
no difference whatsoever.
--
https://mail.python.org/mailman/listinfo/python-list
x27;''This takes a long time'''
print('Expensive:', first, par)
return par * 2
for i in range(10):
r = expensive(i, 100)
sleep(1)
print(r)
--
https://mail.python.org/mailman/listinfo/python-list
but Py_INCREF didn’t solve it.
I’m using Python 3.8 on Ubuntu.
Thanks for any ideas on how to solve this.
Jen
--
https://mail.python.org/mailman/listinfo/python-list
27;s key lookup mechanism. Is there some other
method? Just curious.
--
https://mail.python.org/mailman/listinfo/python-list
cremented the reference to all objects in Get_LibModules, but I still
get the same segfault at PyObject_CallFunctionObjArgs. Unfortunately,
reference counting is not well documented so I’m not clear what’s wrong.
Sep 29, 2022, 10:06 by [email protected]:
> On 2022-09-29 16:5
0x769be120 <_Py_NoneStruct>
Thanks again.
Jen
Sep 29, 2022, 13:02 by [email protected]:
> Thanks very much to @MRAB for taking time to answer. I changed my code to
> conform to your answer (as best I understand your comments on references),
> but I still get the sam
PyLong, it'll set an error and return -1.
>
>> So my question is why do I get -1 as return value? When I query p_seed calc
>> : get:
>>
>> (gdb) p p_seed_calc
>> $2 = (PyObject *) 0x769be120 <_Py_NoneStruct>
>>
> Exactly. It's Py_None, n
4_t C_API_12(PyObject * pAttr_randrange, Py_ssize_t value_1) {
> PyObject * value_ptr = PyLong_FromLong(value_1);
> //> value_ptr+?
> if (!value_ptr) {
> PyErr_Print();
> return 1;
> }
>
> //> value_ptr+
> PyObject * p_randrange_calc = PyObject_CallFunctionObjArgs(pAttr_randrange,
> value_ptr, NULL);
> //> value_ptr+ p_randrange_calc+?
> Py_DECREF(value_ptr);
> //> p_randrange_calc+?
> if (!p_randrange_calc) {
> PyErr_Print();
> return 1;
> }
>
> //Prepare return values
> //> p_randrange_calc+
> return_val = PyLong_AsLong(p_randrange_calc);
> Py_DECREF(p_randrange_calc);
>
> return return_val;
> }
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
1601 - 1700 of 5868 matches
Mail list logo