jump to:allmastodonblueskylemmylobstersdevstackwikirsshn
wwebbit
view: | | |

Knowledge / Stack Overflow · hot matching “python”

6 shown · updated 10m ago · read only
  1. Type hint a stored type or value (stackoverflow.com)stack

    30 points by Jerakin in stackoverflow.com · 22m ago · stack

    I have a manager of sorts. This manager accepts a class (or type) as an argument to its initializer and can later return this value. Can I type hint that the .get() method returns the same type as what the class was initialized with? class ClassStore: def __init__(self, base_cla…
  2. How to expose a multi-model, case-scoped "detail" read in DRF without adding a new endpoint? (stackoverflow.com)stack

    21 points by Paul 054m41 in stackoverflow.com · 8h ago · stack

    I have a Django REST Framework app with an established pattern: a generic detail view dispatches by an entity string to one of ~14 model/serializer/service triples, looked up by that record's own primary key: class HandleEntityDetails(APIView): MODELS = {"foo": Foo, "bar": Bar,…
  3. HackerRank won't accept my code for the Set .discard(), .remove() & .pop() challenge (stackoverflow.com)stack

    13 points by David Willis in stackoverflow.com · 3y ago · stack

    Here's the prompt: You have a non-empty set s, and you have to execute N commands given in N lines. The commands will be pop, remove and discard. Input Format: The first line contains integer n, the number of elements in the set s. The second line contains n space separated elem…
    filed under pythonset
  4. Creating a sequence in python 3 (stackoverflow.com)stack

    9 points by Daniel in stackoverflow.com · 6y ago · stack

    a=1 b=1 sum=(a+b) for i in range(100): print(a) print(b) print(sum) This is my current code, but I don't know how to create a code to do continuous addition to produce a sequence in python with basic math computation. I need a+b to equal c and b+c=d and so on but I don't know ho…
    filed under python
  5. How to mark an Airflow DAG run as failed if any task fails? (stackoverflow.com)stack

    5 points by BelowZero in stackoverflow.com · 8y ago · stack

    Is it possible to make an Airflow DAG fail if any task fails? I usually have some cleaning up tasks at the end of a DAG and as it is now, whenever the last task succeeds the whole DAG is marked as a success.
    filed under pythonairflow
  6. Auto connect on my Gmail account with Python Selenium (stackoverflow.com)stack

    4 points by pi-2r in stackoverflow.com · 10y ago · stack

    I am trying to auto-login with my GMail account with Selenium in Python, but I am getting this error: selenium.common.exceptions.ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with My code looks like this: #!/usr/bin/python # c…