jump to:all–mastodon–bluesky–lemmy–lobsters–dev–stack–wiki–rss–hn
wwebbit
view: | | |

Front page / everything · hot matching “python”

4 shown · updated 1m ago · read only
  1. Can I broadcast with numpy character find (stackoverflow.com)stack

    26 points by I.P. Freeley in stackoverflow.com · 6h ago · stack comments

    I have an array of potential substrings and an array of full strings. I'd like to know which elements of the potential substrings are indeed found as substrings in the full array. import numpy as np potential_substrings = np.array(["visit a", "visit b", "visit c, 1", "visit d"])…
  2. How to express a conditionally required parameter in a Pydantic-validated tool/API schema, without losing the upfront schema validation? (stackoverflow.com)stack

    21 points by stefisha in stackoverflow.com · 18h ago · stack comments

    I have a function (specifically an MCP tool built with FastMCP, but this is really a Pydantic/JSON Schema question) where one parameter is required in the normal case, but must be optional when a separate flag parameter is set, since in that branch it genuinely doesn't apply. Si…
  3. Should I capitalize constant in Python? (stackoverflow.com)stack

    8 points by boh in stackoverflow.com · 8y ago · stack comments

    In PEP8, the general rule is to declare constants in UPPER_CASE chars. In real life, there can be a number of situations: #!env python DATABASE_HOST = 'localhost' app = Flask('myapp') base_two = partial(int, base=2) Typically we consider string-type or numeric-type variables as…
    filed under python