Hello -
I wish to bring to your kind notice a bug in Python.
Given any matrix X. While trying to compute the CoVariance matrix of that
matrix X, Python does NOT compute the CoVarianceof the given matrix X.
Instead, Python comptes the CoVariance of the Transpose of the given matrix
X.
This appears to be a bug in Python.
Please refer to the below website for a given matrix and what the result
should be after the computation of it's CoVariance. And I have provided a
screenshot of what Python is returning.
https://www.itl.nist.gov/div898/handbook/pmc/section5/pmc541.htm
Please let me know if you have any questions.
Regards,
Prakash
So, I've been trying to make a memory game.. kind of..
And I noticed a bug and it was buggy every code where I was using this
The bug is, when I Try to print a random generated number with IDLE,
nothing wrong but when I open it as a regular app, it do not working,
sending pictures
screen1 is the code
screen2 is the code running in IDLE perfectly
screen3 is the buggy stuff
Hi,
Are there some tools to auto-format the doc? Something similar to
flake8, black, that would allow to call "make format" and get the
documentation formatted. Or at least would ensure that I get warning if
a documentation PR do not follow the norm.
I was checking whether doctest was doing what I want, but doctest failed
(see https://bugs.python.org/issue45920 for the report about it). `make
check` accepted my code even when it had lines that were more than 80
chars long without need for it
Hi,
I'm new to contributing to python-docs. I've opened 5 PRs, two are now
merged, two have been reviewed and one received comment on bpo but no
review on github, after being opened for three weeks.
I'd love if you can help me understand why those differences. Is it just
pure luck depending on who is available the day I open the PR? Is there
something that https://github.com/python/cpython/pull/29303 that makes
it more complex to review and that I should change first.
Regards,
Arthur
In docs.python.org/3/extending/extending.html, one of the examples says
static int PySpam_System(...) { ... }
...
{
static void *PySpamAPI[...];
...
PySpamAPI[...] = (void *)PySpam_System;
... PyCapsule_New((void *)PySpamAPI, ...) ...
This is nonportable from a C perspective; C does not promise that it is
possible to usefully convert between pointers to functions and pointers
to objects. (They can be fundamentally different beasts, especially on
Harvard architectures.)
It's not clear to me whether Python cares about portability to systems
where pointer-to-function and pointer-to-object are different enough
for this to matter. But I think it would be good to either fix the
example or specifically document that CPython isn't portable to systems
where the casting doesn't work.
As for fixing the example, if that's the direction chosen - I'd be
inclined to do this particular case as
static int (*)(const char *)PySpam_API[] = { [PySpam_System_NUM] = &PySpam_System };
...
... PyCapsule_New(&PySpam_API[0], ...) ...
(using &array[0] instead of just array is a personal quirk of mine) and
then, in the non-SPAM_MODULE case in spammodule.h, either
static void *PySpam_API;
#define PySpam_System (((int (*)(const char *))PySpam_API)[PySpam_System_NUM])
or
static int (**PySpam_API)(const char *);
#define PySpam_System (PySpam_API[PySpam_System_NUM])
The latter is simpler; the former is easier to extend when including
functions with other call signatures. (In either case, the cast in
import_spam() needs to change or disappear - it's not necessary in any
case, because void * is special.)
There also is a language mistake:
All that a client module must do ... call the function (or
rather macro) import_spam() ...
Assuming use of the spammodule.h given earlier, import_spam() is a
static function (more strictly, a function whose name has internal
linkage), not a macro. For it to be a macro it would need to be
created with #define, not with a function definition.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse(a)rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
My input code is
list1=[1,2,3,4,5,6,7,8,9]
for i in range(len(list1)-1,-1,-1):
print(list[i],end=' ')
print()
Output:
list[8] list[7] list[6] list[5] list[4] list[3] list[2] list[1] list[0]
I am not sure if you would classify this as a documentation bug or minor software bug
I have been teaching an Introduction to Programming using Python at Lehman College for more than half a dozen years.
For the first problem covering "if", I ask the students to write a program where the user is prompted to enter an integer and the program logic determines whether the number is odd or even.
I was surprised to see a student submission contain:
if number % 2 == int() : #even
rather than
if number % 2 == 0: #even
The Documentation did not say what happens if there was no argument.
I though an Exception would be thrown, but "no", int( ) returned a 0
Also float() returns 0.0
Jeff Gitlin
Lehman College
Bronx, New York