Re: What is the meaning of Building Wheel for ?

2020-02-29 Thread Terry Reedy

On 2/29/2020 11:23 AM, Souvik Dutta wrote:

What is the meaning of the subject I mean what does python internally do
when it says this?


Python does not normally 'build wheels'.  So you must be running some 
particular program.  Check the docs for that program.



--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


What is the meaning of Building Wheel for ?

2020-02-29 Thread Souvik Dutta
What is the meaning of the subject I mean what does python internally do
when it says this?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of @@?

2017-12-24 Thread Richard Damon

On 12/24/17 8:33 PM, Peng Yu wrote:

See for example this file.

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell.py

On Sat, Dec 23, 2017 at 12:03 AM, Steve D'Aprano
 wrote:

On Sat, 23 Dec 2017 04:38 pm, Peng Yu wrote:


Hi, I only can find the doc for @. What does @@ mean in python?

I don't think that @@ means anything yet.

There was a proposal to use @@ for matrix exponentiation in Numpy, as @ is
used for matrix multiplication, but that was left on hold to see whether it
is really needed or not.

Where did you find @@ in Python?


(By the way, @ for matrix multiplication only works in Python 3.5 or better.)

https://www.python.org/dev/peps/pep-0465/



--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

--
https://mail.python.org/mailman/listinfo/python-list




Note, the @@ is inside a triple quoted string, so this is just part of a 
multi-line string.


--
Richard Damon

--
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of @@?

2017-12-24 Thread Ian Kelly
On Sun, Dec 24, 2017 at 7:33 PM, Peng Yu  wrote:
> See for example this file.
>
> https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell.py
>
> On Sat, Dec 23, 2017 at 12:03 AM, Steve D'Aprano
>  wrote:
>> On Sat, 23 Dec 2017 04:38 pm, Peng Yu wrote:
>>
>>> Hi, I only can find the doc for @. What does @@ mean in python?

The examples there occur inside of a doc string, so that's not Python.
It's part of the syntax of whatever software is used to generate the
documentation for that code.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of @@?

2017-12-24 Thread Peng Yu
See for example this file.

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell.py

On Sat, Dec 23, 2017 at 12:03 AM, Steve D'Aprano
 wrote:
> On Sat, 23 Dec 2017 04:38 pm, Peng Yu wrote:
>
>> Hi, I only can find the doc for @. What does @@ mean in python?
>
> I don't think that @@ means anything yet.
>
> There was a proposal to use @@ for matrix exponentiation in Numpy, as @ is
> used for matrix multiplication, but that was left on hold to see whether it
> is really needed or not.
>
> Where did you find @@ in Python?
>
>
> (By the way, @ for matrix multiplication only works in Python 3.5 or better.)
>
> https://www.python.org/dev/peps/pep-0465/
>
>
>
> --
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
>
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of @@?

2017-12-22 Thread Ian Kelly
@@ is a syntax error. Where did you encounter this?

On Fri, Dec 22, 2017 at 10:38 PM, Peng Yu  wrote:
> Hi, I only can find the doc for @. What does @@ mean in python?
>
> --
> Regards,
> Peng
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of @@?

2017-12-22 Thread Steve D'Aprano
On Sat, 23 Dec 2017 04:38 pm, Peng Yu wrote:

> Hi, I only can find the doc for @. What does @@ mean in python?

I don't think that @@ means anything yet.

There was a proposal to use @@ for matrix exponentiation in Numpy, as @ is
used for matrix multiplication, but that was left on hold to see whether it
is really needed or not.

Where did you find @@ in Python?


(By the way, @ for matrix multiplication only works in Python 3.5 or better.)

https://www.python.org/dev/peps/pep-0465/



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


What is the meaning of @@?

2017-12-22 Thread Peng Yu
Hi, I only can find the doc for @. What does @@ mean in python?

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-13 Thread Oscar Benjamin
On 13 November 2015 at 03:08, Xiang Zhang <18518281...@126.com> wrote:
> I think the meaning of Py_INCREF a static type object is to prevent it from
> being deallocated when it is Py_DECREFed somehow later. Just as you said, it
> may be somehow deallocated when using.
>
> NoddyType is a static struct so I don't think it lives on Python's heap and
> deallocating it is a wrong action. Just as I mentioned, type_dealloc seems
> to only deallocated HEAPTYPE. And by the way, when NoddyType is created, it
> has a reference count 1 with PyVarObject_HEAD_INIT. So if I don't Py_INCREF
> it, when it is somehow Py_DECREDed later, it will reach reference count 0
> and fail the assert in type_dealloc. If it is Py_INCREFed, just like the
> module holds a reference to it, it will at least have a reference count 1
> and never reach 0.

Other code shouldn't Py_DECREF it unless it owns a reference meaning
that it has first called Py_INCREF. The only exception I can think is
possibly that someone would do:

>>> import noddy
>>> del noddy.Noddy

For that to work properly I guess that Noddy needs a reference count
of 2: one for being a module attribute and an extra one to prevent it
from ever being deallocated.

--
Oscar
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-13 Thread Xiang Zhang
Thanks for your reply jason. Your reply does give me hints and then I 
read more code and find maybe you are wrong in some points.


I think the meaning of Py_INCREF a static type object is to prevent it 
from being deallocated when it is Py_DECREFed somehow later. Just as you 
said, it may be somehow deallocated when using.


NoddyType is a static struct so I don't think it lives on Python's heap 
and deallocating it is a wrong action. Just as I mentioned, type_dealloc 
seems to only deallocated HEAPTYPE. And by the way, when NoddyType is 
created, it has a reference count 1 with PyVarObject_HEAD_INIT. So if I 
don't Py_INCREF it, when it is somehow Py_DECREDed later, it will reach 
reference count 0 and fail the assert in type_dealloc. If it is 
Py_INCREFed, just like the module holds a reference to it, it will at 
least have a reference count 1 and never reach 0.


On 11/13/2015 02:52 AM, Jason Swails wrote:



On Thu, Nov 12, 2015 at 3:05 AM, Xiang Zhang <18518281...@126.com 
> wrote:


Recently I am learning Python C API.

When I read the tutorial
,
defining new types, I feel confused. After
PyType_Ready(_NoddyType) comes Py_INCREF(_NoddyType).
Actually noddy_NoddyType is a static struct so I don't understand
why I need to Py_INCREF it. Since it's Py_INCREFed, does it mean
sometimes we also need to Py_DECREF it? But then it seems that
type_dealloc will be invoked and it will fail
assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);


​It is a module attribute, so when the module is imported it has to 
have a single reference (the reference *in* the module).  If you don't 
INCREF it, then it will have a refcount of 0, and immediately be ready 
for garbage collection.  So if you try to use the type from the 
module, you could get a segfault because it's trying to use an object 
(type definition) that was already destroyed.


Note that you don't *always* have to INCREF objects after you create 
them in C.  Some macros and function do that for you. And in some 
cases, all you want or need is a borrowed reference.  In those cases, 
Py_INCREF is unnecessary.


The DECREF will be done when it's normally done in Python.  If you do 
something like


import noddy
del noddy.NoddyType

​All that's really doing is removing NoddyType from the noddy 
namespace and Py_DECREFing it.  Alternatively, doing


import noddy
noddy.NoddyType = 10 # rebind the name

Then the original object NoddyType was pointing to will be DECREFed 
and NoddyType will point to an object taking the value of 10.


HTH,
Jason


--
https://mail.python.org/mailman/listinfo/python-list


What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-12 Thread Xiang Zhang

Recently I am learning Python C API.

When I read the tutorial 
, defining 
new types, I feel confused. After PyType_Ready(_NoddyType) comes 
Py_INCREF(_NoddyType). Actually noddy_NoddyType is a static struct 
so I don't understand why I need to Py_INCREF it. Since it's 
Py_INCREFed, does it mean sometimes we also need to Py_DECREF it? But 
then it seems that type_dealloc will be invoked and it will fail 
assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);


I haven't read the typeobject.c source code totally so I think I must 
have missed something. But I am quite confused. Hope someone can give me 
some hints. Thanks in advance.

--
https://mail.python.org/mailman/listinfo/python-list


Re: What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-12 Thread Jason Swails
On Thu, Nov 12, 2015 at 3:05 AM, Xiang Zhang <18518281...@126.com> wrote:

> Recently I am learning Python C API.
>
> When I read the tutorial <
> https://docs.python.org/3/extending/newtypes.html#the-basics>, defining
> new types, I feel confused. After PyType_Ready(_NoddyType) comes
> Py_INCREF(_NoddyType). Actually noddy_NoddyType is a static struct so
> I don't understand why I need to Py_INCREF it. Since it's Py_INCREFed, does
> it mean sometimes we also need to Py_DECREF it? But then it seems that
> type_dealloc will be invoked and it will fail assert(type->tp_flags &
> Py_TPFLAGS_HEAPTYPE);
>

​It is a module attribute, so when the module is imported it has to have a
single reference (the reference *in* the module).  If you don't INCREF it,
then it will have a refcount of 0, and immediately be ready for garbage
collection.  So if you try to use the type from the module, you could get a
segfault because it's trying to use an object (type definition) that was
already destroyed.

Note that you don't *always* have to INCREF objects after you create them
in C.  Some macros and function do that for you.  And in some cases, all
you want or need is a borrowed reference.  In those cases, Py_INCREF is
unnecessary.

The DECREF will be done when it's normally done in Python.  If you do
something like

import noddy
del noddy.NoddyType

​All that's really doing is removing NoddyType from the noddy namespace and
Py_DECREFing it.  Alternatively, doing

import noddy
noddy.NoddyType = 10 # rebind the name

Then the original object NoddyType was pointing to will be DECREFed and
NoddyType will point to an object taking the value of 10.

HTH,
Jason
-- 
https://mail.python.org/mailman/listinfo/python-list