e updated.
(This is not yet filed as a bug report; as first I am requesting a call to
something like `_PyType_Lookup` that is efficent; and once we agree on
that, we can created an updated reproduction of `type.__getattribute__`).
Thanks,
Joy Diamond.
#
# The following reproduces (and tests) `objec
and `fixed__Type__getattribute`
3. The invalid value of `Point.y` is `2` as returned by the [emulated]
`__getattribute__` documented
https://docs.python.org/3/howto/descriptor.html
So I am requesting:
1. An efficient python way to test for `tp_descr_get` slot (and other
descriptor) slots.
2.
accurate and consistent the
documentation is.
This request is to keep these high standards.
Thanks,
Joy Diamond.
NOTE: I'm not sure where to post this, so posting to python-ideas, in case
people want to discuss getting rid of the optimization in
PyObject_IsInstance ... which I am not suggesting
On Sat, Oct 27, 2018 at 8:02 PM Steven D'Aprano wrote:
> I don't think it is obvious that the behaviour is correct. Presumably
> Joy had a use-case for overriding isinstance(), and this optimization
> prevented it.
>
> Joy, can you comment on your use-case, and did you come up with a
>
On Sat, Oct 27, 2018 at 10:00 PM Chris Angelico wrote:
> On Sun, Oct 28, 2018 at 12:53 PM Joy Diamond wrote:
> >> - type(x) and x.__class__ don't necessarily agree; under what
> >> circumstances are each used?
> >>
> >> (I've asked this before, and eit
of it.
Am I missing something? Is this supposed to work? Is the documentation
wrong?
Thanks,
Joy Diamond.
Program that shows that the class dictionary created is not what we pass in
--- Shows the actual symbol table is `dict` not `SymbolTable`
class SymbolTable(dict):
pass
members = SymbolTable(
Thanks, Terry.
As per your suggestion, I have submitted it as a bug report to:
https://bugs.python.org/issue35083
On Sat, Oct 27, 2018 at 4:09 PM Terry Reedy wrote:
> On 10/27/2018 2:53 PM, Joy Diamond wrote:
> > Chris,
> >
> > Yes, the following works:
> > "
e(x)`.
For example the actual code reference above:
https://github.com/python/cpython/blob/master/Objects/abstract.c#L2397-L2405
Says "if (Py_TYPE(inst) == (PyTypeObject *)cls)" in the actual C Python
implementation:
So it using `type(x)` not `x.__class__`
Thanks,
Joy Diamond.
A
ocumented.
Thanks,
Joy Diamond.
1. The google search: "site:docs.python.org __subclasses__" finds no
instances of the word "__subclasses__"
2. As for what the function does, it returns the subclasses of a class:
Consider the following program:
class Cryptog
type checking, and yes, this will
> occasionally result in changed recommendations for how the language should
> be used or how APIs should be designed, but no, this does not mean that
> we're planning to deprecate or remove existing runtime features.
>
> On Mon, Oct 29, 2018 at 11:12
20:11, Joy Diamond пише:
> > Currently `type.__subclasses__` is not documented at docs.python.org
> > <http://docs.python.org> (and works in both python 2 & python 3).
> >
> > I would like to keep `.__subclasses__` and have it documented at
> &
11 matches
Mail list logo