並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 7 件 / 7件

新着順 人気順

python typing enum literalの検索結果1 - 7 件 / 7件

  • Python 3.11の新機能:型チェッカーでロジックの間違いを検出できるtyping.assert_never関数とtyping.Never型 | gihyo.jp

    Python Monthly Topics Python 3.11の新機能:型チェッカーでロジックの間違いを検出できるtyping.assert_never関数とtyping.Never型 筒井@ryu22eです。2023年5月の「Python Monthly Topics」のテーマは、Python 3.11からtypingモジュールに追加された「assert_never関数、Never型」です。 みなさんは「この行には仕様上絶対に到達しないはず」というコードを書いたことはありますか? そして、バグが原因で到達しないはずの行に到達してしまった経験はありませんか? assert_never関数、Never型にはこのようなミスを型チェッカー(Mypy、Pyrightなど)で検出してくれる便利な機能があります。 本記事では、サンプルコードを交えて実際にassert_never関数、Never型が

      Python 3.11の新機能:型チェッカーでロジックの間違いを検出できるtyping.assert_never関数とtyping.Never型 | gihyo.jp
    • A string formatting library in 65 lines of C++

      In this write-up, I will walk you through an implementation of a string formatting library for C++ I came up with for my video game. The end result came out really compact, at only 65 lines of code—providing a skeleton that can be supplemented with additional functionality at low cost. Usage Given a format buffer… char buffer[64]; String_Buffer buf = {str, sizeof str}; …the fmt::format function pr

      • An Experienced (Neo)Vimmer's Workflow

        Motivation Ever since TJ said “Personalized Development Environment,” the phrase latched onto me like a cobweb in a mineshaft. A Personalized Development Environment (PDE) describes an ideal setup that is tailored to your needs and preferences – it lies between a bare-bone text editor and a full-fledged IDE. It is a place where you can be productive, efficient, and comfortable. It is a place that

        • Rust vs C++ Formatting

          In Rust, if I want to print some 32-bit unsigned value in hex, with the leading 0x, padded out with zeros, I would write that as: println!("{:#010x}", value); In C++23, if I want to do the same, that’s: std::println("{:#010x}", value); The only difference is the spelling of the name of the thing we’re calling (which is a function template in C++ and a macro in Rust) - otherwise, identical. Neverth

          • 爆速で多言語SDKをリリースする「Stainless」の紹介

            こちらはGaudiy アドベントカレンダー 202420 日目の記事です。社内のことを書こうと思ったのですが間に合わなかったので、今回は自分が調査したサービスについて紹介しようと思います。 概要 OpenAPI から数種類のプログラミング言語の SDK が生成できるStainlessの紹介と、実際にデモで使ってみた手順や感想を述べます。 導入 弊社のようなプラットフォームを提供する会社では、サービスの API や SDK を提供するケースは多いかと思います。しかし、多言語の SDK を開発・運用することは簡単ではありません。 例えば Node.js の SDK を作る必要が出てきたとき、必要なセットアップはいくつか存在します。 コード 環境構築 TypeScript 整備 使用するライブラリの選定 ESlint や Prittier 等のツール npm package の設定 CICD の

              爆速で多言語SDKをリリースする「Stainless」の紹介
            • Exhaustive Union Matching in Python - Preferred Networks Tech Blog

              Pattern matching on algebraic data types is a powerful technique to process a given input and many programming languages have adopted it in one way or another. A check on whether a given match is “exhaustive”, i.e., covers all possible inputs, is helpful to avoid bugs when the set of possible inputs is extended; for example, when new enumeration values are added. In this blog post I will first bri

                Exhaustive Union Matching in Python - Preferred Networks Tech Blog
              • jax-js: an ML library for the web

                I’m excited to release jax-js, a machine learning library for the web. You can think of it as a reimplementation of Google DeepMind’s JAX framework (similar to PyTorch) in pure JavaScript. jax-js runs completely in the browser by generating fast WebGPU and Wasm kernels. Numerical computing on the webStarting in February this year, I spent nights and weekends working on a new ML library for the bro

                  jax-js: an ML library for the web
                1