Questions tagged [slots]

`__slots__` is a python language feature to reduce size of object instances by dropping the builtin dictionary every python instance normally features in order to support dynamic assignment of attributes and replacing it with a fixed set of attributes (the 'slots').

__slots__ is a python language feature to reduce size of object instances by dropping the builtin dictionary every python instance normally features in order to support dynamic assignment of attributes and replacing it with a fixed set of attributes (the 'slots'). See: https://docs.python.org/2/reference/datamodel.html#slots

306 questions
0
votes
1 answer

How to reference a Stenciljs from the HTML page?

In case I have multiple s nested inside my Stencil component, I would need to give them names, and then reference them inside my HTML page when using that component. So, how do I do that? Example: render() { return(
happy_story
  • 1
  • 1
  • 7
  • 17
0
votes
1 answer

Vue 3 slots variable is empty for no reason

Using the setup syntax, I started a new projet week ago and when I try to use "slots" in the template or even a computed with useSlots. The slots variable is always empty even if the v-slots are working great (passing datas like I…
Jer
  • 183
  • 3
  • 13
0
votes
0 answers

how to get signal when field is activated (Python, PyQt5, QDateEdit)

I need to receive a signal when the field (QDateEdit) is activated. I did not find such a signal in the documentation. Perhaps i need to redefine the class for this? but I don't know how to describe it all in working code
Pihto
  • 15
  • 3
0
votes
0 answers

vue.js 2 use scoped slots in custom element

I'll try to explain my problem. I have a VueJS component, that uses slots in its template. For example: App.vue:

{hi}

./index.svelte

This is my awesome index page!

./route/to/something/index.svelte

in this page we…

Angel Ponce
  • 105
  • 6
0
votes
1 answer

Alexa: How to assign a slot response to a variable. (Python)

I'm not sure how to assign a slot to a variable in an Alexa skill. I've found several tutorials, but most of them are in JS (I wrote this code in Python) or outdated, since even using them precisely as presented does not work. Alexa is meant to ask…
Jared
  • 22
  • 3
0
votes
0 answers

I have a class Task and I want to save memory and efficiency, should I use __slots__?

this is my class: class Task: __slots__ = ('callback', 'args') def __init__(self, callback: 'Callable', *args): self.callback = callback self.args = args def execute(self): try: …
0
votes
1 answer

UserWarning: constrain_similarities is set to `False`. It is recommended to set it to `True` when using cross-entropy loss NLU model loaded

actually I am learning how to build AI chatbot using RASA ,I am doing course from Udemy called : RASA for beginner it's a great course but due to version differences I am facing a problem when i (run rasa shell) as well as (rasa actions) so please…
0
votes
1 answer

How can I validate __slots__ in child classes?

From the python docs 3.3.2.4.1, it says "__slots__ declared in parents are available in child classes. However, child subclasses will get a __dict__ and __weakref__ unless they also define __slots__ (which should only contain names of any…
Grylls Leong
  • 11
  • 1
  • 3
0
votes
1 answer

QT Signals and Slots, dynamic menubar

I am new to qt and I want to know how to make a dynamic menu. I did get it to make new submenus but I don't know how I can implement the "triggered() function" of these dynamic made submenus, so that I have access to what happens if I want to click…
cretos
  • 27
  • 4
0
votes
1 answer

django include_javascript/use_javascript and similar

I'm searching for the way to include javascript/css files inside django templates using symfony-like style or similar. My base/layout.html template looks like this:
Gray Hound
  • 1
  • 1
  • 2
0
votes
0 answers

can't emit a signal from a QThread that is inside of QThread in QT(GUI)

/////////// this is the parent thread class //// serverstartThread.h #ifndef SERVERSTARTTHREAD_H #define SERVERSTARTTHREAD_H #include #include #include "QThread" #include "listenerthread.h" class ServerStart : public QObject { …
0
votes
1 answer

What happens to empty ng-content fields

Simple question: The Angular docs suggest not using ng-content in the case of conditional rendering on the component end: If your component needs to conditionally render content, or render content multiple times, you should configure that component…
daxicks
  • 108
  • 2
  • 7