<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Clément Dethoor</title>
    <description>The latest articles on DEV Community by Clément Dethoor (@2thor).</description>
    <link>https://dev.to/2thor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3203861%2F585a0b00-ef9d-47fe-8b69-1efae88e8282.jpeg</url>
      <title>DEV Community: Clément Dethoor</title>
      <link>https://dev.to/2thor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/2thor"/>
    <language>en</language>
    <item>
      <title>Python data types reminder</title>
      <dc:creator>Clément Dethoor</dc:creator>
      <pubDate>Sat, 24 May 2025 19:24:21 +0000</pubDate>
      <link>https://dev.to/2thor/python-data-types-reminder-4k2b</link>
      <guid>https://dev.to/2thor/python-data-types-reminder-4k2b</guid>
      <description>&lt;h2&gt;
  
  
  🐍 Python Built-in Data Types
&lt;/h2&gt;

&lt;p&gt;Python has several built-in data types grouped into categories:&lt;/p&gt;




&lt;h2&gt;
  
  
  📦 Basic Types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;int&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Integer numbers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x = 10&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;float&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Floating-point numbers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pi = 3.14&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;complex&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Complex numbers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;z = 2 + 3j&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bool&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Boolean values (&lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;is_valid = True&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;str&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Text (string)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;name = "Alice"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;NoneType&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Represents the absence of a value&lt;/td&gt;
&lt;td&gt;&lt;code&gt;x = None&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  📚 Sequence Types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;list&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ordered, mutable sequence&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fruits = ["apple", "banana"]&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tuple&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ordered, immutable sequence&lt;/td&gt;
&lt;td&gt;&lt;code&gt;point = (1, 2)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;range&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sequence of numbers (typically for loops)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;range(5)&lt;/code&gt; → &lt;code&gt;0,1,2,3,4&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔑 Mapping Type
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dict&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Key-value pairs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;user = {"name": "Alice", "age": 30}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔢 Set Types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;set&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unordered, unique items&lt;/td&gt;
&lt;td&gt;&lt;code&gt;colors = {"red", "blue"}&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;frozenset&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Immutable set&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fs = frozenset([1, 2, 3])&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧵 Binary Types
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bytes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Immutable sequence of bytes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;b = b"hello"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bytearray&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Mutable sequence of bytes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ba = bytearray(b"hello")&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;memoryview&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Memory view of a byte object&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mv = memoryview(b"hello")&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🛠️ Type Checking
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# &amp;lt;class 'int'&amp;gt;
&lt;/span&gt;&lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hi&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧠 Tip
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;type()&lt;/code&gt; to inspect a value’s type, and &lt;code&gt;isinstance()&lt;/code&gt; to check if a value matches a certain type.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to UV</title>
      <dc:creator>Clément Dethoor</dc:creator>
      <pubDate>Sat, 24 May 2025 19:20:19 +0000</pubDate>
      <link>https://dev.to/2thor/introduction-to-uv-o46</link>
      <guid>https://dev.to/2thor/introduction-to-uv-o46</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://github.com/astral-sh/uv" rel="noopener noreferrer"&gt;UV – Ultra Fast Python Package Manager&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  🧾 Overview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;UV&lt;/strong&gt; is an extremely fast Python project and package manager written in &lt;strong&gt;Rust&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manages dependencies, virtual environments, and Python versions.&lt;/li&gt;
&lt;li&gt;Can replace &lt;code&gt;pip&lt;/code&gt;, &lt;code&gt;pipx&lt;/code&gt;, &lt;code&gt;pip-tools&lt;/code&gt;, or &lt;code&gt;poetry&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Blazing fast due to being built in Rust.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  On macOS (via Homebrew)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install uv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using pip
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install uv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Enable shell auto-completion (e.g., for zsh)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;eval "$(uv generate-shell-completion zsh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Example: &lt;code&gt;uv c[TAB]&lt;/code&gt; will autocomplete the command.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🚀 Setting Up a Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Initialize a project
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv init --app my_app_name        # Default type (application)
uv init --package my_package_name
uv init --lib my_lib_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run a script and create a virtual environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv run hello.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This will create a virtual environment automatically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Add or remove dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv add pandas
uv remove pandas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Sync environment and workspace
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv sync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Upgrade a specific package
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv lock --upgrade pandas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Show dependency tree
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv tree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📦 Dependency Management (Workspaces)
&lt;/h2&gt;

&lt;p&gt;UV supports &lt;strong&gt;workspaces&lt;/strong&gt;, allowing you to manage multiple virtual environments in a single directory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running &lt;code&gt;uv init&lt;/code&gt; inside an existing UV project creates a sub-project with its own virtual environment:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv init new_project
uv add pandas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To create a fully isolated project (not in the workspace):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv init another_project --no-workspace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛠️ UV Tools
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Run a tool (e.g., &lt;code&gt;ruff&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv tool run ruff check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Check where tools are installed
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv tool dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install a tool
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv tool install ruff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🐍 Python Version Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  List available Python versions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv python list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install a specific version
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv python install 3.12.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set Python version for a virtual environment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv venv --python 3.12.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
