r/Python 8d ago

Discussion TIL: Dict Patterns Don't Match Dict Shapes

42 Upvotes

TL;DR: Unlike sequence patterns (which require an exact shape match), pattern matching on dictionaries simply ignores any unspecified keys rather than failing.

If you care about the details, I wrote about it on my blog: https://ravencentri.cc/blog/dict-patterns-dont-match-dict-shapes/


r/Python 8d ago

Discussion How are you all testing boto3-heavy tools without hitting real AWS?

14 Upvotes

Building a tool that walks a live AWS account checking for

misconfigurations, and testing has been the hardest part not the

detection logic itself, but avoiding either (a) hitting real AWS

constantly in CI or (b) mocking so much the tests stop meaning

anything.

Using moto for the straightforward stuff, but some checks need

multi-service interactions (cross-referencing an EC2 instance's

security group with its actual open ports) that get awkward to mock

realistically. What do you all reach for here moto, LocalStack, a

disposable AWS test account, something else?


r/Python 8d ago

Daily Thread Tuesday Daily Thread: Advanced questions

5 Upvotes

Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

How it Works:

  1. Ask Away: Post your advanced Python questions here.
  2. Expert Insights: Get answers from experienced developers.
  3. Resource Pool: Share or discover tutorials, articles, and tips.

Guidelines:

  • This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.
  • Questions that are not advanced may be removed and redirected to the appropriate thread.

Recommended Resources:

Example Questions:

  1. How can you implement a custom memory allocator in Python?
  2. What are the best practices for optimizing Cython code for heavy numerical computations?
  3. How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
  4. Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
  5. How would you go about implementing a distributed task queue using Celery and RabbitMQ?
  6. What are some advanced use-cases for Python's decorators?
  7. How can you achieve real-time data streaming in Python with WebSockets?
  8. What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
  9. Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
  10. What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)

Let's deepen our Python knowledge together. Happy coding! 🌟


r/Python 7d ago

Discussion Benchmarking Popular Python Runtime Type Checkers: Beartype, Typeguard, type_enforced, Pydantic

0 Upvotes

Below are benchmark results comparing the execution time of runtime type-checking tools in Python 3.14 across various data types and nested collections.

The checkers tested include Beartype (1-item sampling), Typeguard (@typechecked, 1-item sampling), type_enforced (@Enforcer 1-item sample & 100% validation), and Pydantic (@validate_call, 100% validation).

Benchmark Results

Average execution time per single function call over 100 runs (in microseconds, µs):

Type / Structure Beartype (1 sample) Typeguard (1 sample) type_enforced (1 sample) Pydantic (100%) type_enforced (100%)
int 0.29 µs 2.41 µs 0.15 µs 1.27 µs 0.17 µs
Union[int, float] 0.31 µs 5.56 µs 0.17 µs 1.48 µs 0.17 µs
str 0.30 µs 2.39 µs 0.15 µs 1.25 µs 0.15 µs
dict[str, int] (5 keys) 0.46 µs ⚠️ 4.98 µs ⚠️ 0.27 µs ⚠️ 1.75 µs 0.40 µs
dict[str, int] (1,000 keys) 0.46 µs ⚠️ 4.97 µs ⚠️ 0.27 µs ⚠️ 81.49 µs 27.50 µs
dict[str, int] (10,000 keys) 0.45 µs ⚠️ 5.14 µs ⚠️ 0.27 µs ⚠️ 881.63 µs 278.38 µs
list[int] (5 items) 0.41 µs ⚠️ 3.76 µs ⚠️ 0.18 µs ⚠️ 1.49 µs 0.26 µs
list[int] (1,000 items) 0.52 µs ⚠️ 3.72 µs ⚠️ 0.18 µs ⚠️ 22.49 µs 12.57 µs
list[int] (10,000 items) 0.61 µs ⚠️ 3.72 µs ⚠️ 0.18 µs ⚠️ 212.59 µs 122.58 µs
list[Union[int, float]] (5 items) 0.48 µs ⚠️ 4.68 µs ⚠️ 0.18 µs ⚠️ 1.86 µs 0.33 µs
list[Union[int, float]] (1,000 items) 0.58 µs ⚠️ 4.87 µs ⚠️ 0.19 µs ⚠️ 106.14 µs 12.60 µs
list[Union[int, float]] (10,000 items) 0.67 µs ⚠️ 4.88 µs ⚠️ 0.18 µs ⚠️ 1,062.99 µs 122.87 µs
list[dict[str, int]] (5 × 5 items) 0.59 µs ⚠️ 6.27 µs ⚠️ 0.30 µs ⚠️ 3.80 µs 1.39 µs
list[dict[str, int]] (100 × 10 items) 0.69 µs ⚠️ 6.31 µs ⚠️ 0.29 µs ⚠️ 85.05 µs 43.68 µs
list[dict[str, int]] (100 × 100 items) 0.78 µs ⚠️ 6.45 µs ⚠️ 0.29 µs ⚠️ 788.38 µs 310.50 µs

Notes on Methodology & Results

  • Environment & Methodology: Tested with Python 3.14.5 on an Ubutnu 24.04 (Ryzen Threadripper 3770 with 128gb RAM). Every checker received identical test inputs and type definitions. Timings represent the average duration of a single function call over 100 executions (discarding an initial warm-up run).
  • The ⚠️ Warning: Indicates that the checker did not catch an invalid item placed in the collection during test runs because the invalid element fell outside the sampled index.
  • Full vs. Sampled Validation:
    • Full (100%) Validation (Pydantic, type_enforced 100%): Iterates and checks every item in collections (O(N) time).
    • Sampled Validation (Beartype, Typeguard, type_enforced 1-sample): Checks 1 element (O(1) time), which keeps execution flat regardless of collection size, but without full-containment safety guarantees.

I realize that there may be optimizations I missed when calling various validation decorators. Please let me know of any optimizations or other packages to try out.


r/Python 9d ago

Tutorial GUI based Python Tkinter Serial Port Program for communicating with Arduino Microcontroller from PC

22 Upvotes

I recently created a Python Serial Communication program with GUI (Graphical User Interface) based on the Tkinter Library with ttkbootstrap theming .

The Python Tkinter Serial Port Program can communicate with an Arduino or other Microcontroller boards via serial port to send and receive the data from your PC.

You can find the link to the GUI here.

Full tutorial along with Source Code here

Youtube Tutorial for Python Tkinter Serial Port Programming here


r/Python 8d ago

Discussion Updating Python (sub)versions

2 Upvotes

Since the introduction of python install manager some developers like it and started using it in miniforge's stead, or even other python IDEs or IDE-like managers.

Question is, how to keep the subversions up to date? Install manager doesn't have an update command.

I am able to install an outdated version - say 3.13.7 but the latest of that flavor is 3.13.15. All the openSSL libs are outdated in 3.13.7 and so we have a lot of reports of vulnerable python installs.

I wonder how you are solving this


r/Python 8d ago

Discussion Is this valid Python syntax?

0 Upvotes
.... _( () ( )) . _ (...() )()

Ignoring any runtime errors, is this valid Python syntax? Try to work it out from the grammar alone before pasting it into a REPL. Bonus points for explaining the parse.


r/Python 9d ago

Daily Thread Monday Daily Thread: Project ideas!

20 Upvotes

Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

How it Works:

  1. Suggest a Project: Comment your project idea—be it beginner-friendly or advanced.
  2. Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.
  3. Explore: Looking for ideas? Check out Al Sweigart's "The Big Book of Small Python Projects" for inspiration.

Guidelines:

  • Clearly state the difficulty level.
  • Provide a brief description and, if possible, outline the tech stack.
  • Feel free to link to tutorials or resources that might help.

Example Submissions:

Project Idea: Chatbot

Difficulty: Intermediate

Tech Stack: Python, NLP, Flask/FastAPI/Litestar

Description: Create a chatbot that can answer FAQs for a website.

Resources: Building a Chatbot with Python

Project Idea: Weather Dashboard

Difficulty: Beginner

Tech Stack: HTML, CSS, JavaScript, API

Description: Build a dashboard that displays real-time weather information using a weather API.

Resources: Weather API Tutorial

Project Idea: File Organizer

Difficulty: Beginner

Tech Stack: Python, File I/O

Description: Create a script that organizes files in a directory into sub-folders based on file type.

Resources: Automate the Boring Stuff: Organizing Files

Let's help each other grow. Happy coding! 🌟


r/Python 10d ago

Daily Thread Sunday Daily Thread: What's everyone working on this week?

16 Upvotes

Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

How it Works:

  1. Show & Tell: Share your current projects, completed works, or future ideas.
  2. Discuss: Get feedback, find collaborators, or just chat about your project.
  3. Inspire: Your project might inspire someone else, just as you might get inspired here.

Guidelines:

  • Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
  • Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

Example Shares:

  1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
  2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
  3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟


r/Python 11d ago

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

9 Upvotes

Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!
  2. Share: Found something useful? Share it with the community.
  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.
  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.
  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.
  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.
  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟


r/Python 11d ago

Discussion VS Code vs Pycharm for more than python?

12 Upvotes

Hey guys, I actually am trying to build a fast API based application and I really love to use pycharm community edition but the problem is that it sucks in Jinja templates and writing something other than python and I kind of hate doing those in python I also really like the way pycharm handles python coding, like it gives me the best practices and stuff. What should I do? Is there any IDE that has it all or should I just use pycharm for the python part and for other things I should keep VS code open simultaneously?

I like the way pycharm handles, importing and other stuff but I really don't write just python. So should I try to install IntelliJ and like be a total jet brains boy. Should I just wish to VS code?


r/Python 10d ago

Resource Any free STT/TTS APIs for a voice AI app?

0 Upvotes

I'm building a small voice-based AI interview app and I'm planning to deploy the backend(fastapi) on Render's free tier.

I'm considering using open-source/self-hosted options like Whisper/PocketSphinx for STT and Piper for TTS, instead of paid APIs.

My concern is whether running STT/TTS on the same free Render instance would use too much CPU/RAM and make the whole application slow, especially during a real-time interview.

Has anyone tried running STT/TTS models on Render's free tier?


r/Python 12d ago

Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays

9 Upvotes

Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?
  2. Community Events: Any Python meetups or webinars coming up?
  3. Learning Resources: Found a great Python tutorial? Share it here!
  4. Job Market: How has Python impacted your career?
  5. Hot Takes: Got a controversial Python opinion? Let's hear it!
  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟


r/Python 13d ago

Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

3 Upvotes

Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
  • Keep discussions relevant to Python in the professional and educational context.

Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?
  2. Certifications: Are Python certifications worth it?
  3. Course Recommendations: Any good advanced Python courses to recommend?
  4. Workplace Tools: What Python libraries are indispensable in your professional work?
  5. Interview Tips: What types of Python questions are commonly asked in interviews?

Let's help each other grow in our careers and education. Happy discussing! 🌟


r/Python 13d ago

Discussion Docling in databricks

11 Upvotes

Anyone used docling Parsing tool on databricks.

Me and my team started using this, though its a great tool. It has its own limitations. Example GILBERt issues happening here and there.

Any suggestions on to use databricks agent bricks ke free docling?


r/Python 15d ago

Daily Thread Tuesday Daily Thread: Advanced questions

11 Upvotes

Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

How it Works:

  1. Ask Away: Post your advanced Python questions here.
  2. Expert Insights: Get answers from experienced developers.
  3. Resource Pool: Share or discover tutorials, articles, and tips.

Guidelines:

  • This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.
  • Questions that are not advanced may be removed and redirected to the appropriate thread.

Recommended Resources:

Example Questions:

  1. How can you implement a custom memory allocator in Python?
  2. What are the best practices for optimizing Cython code for heavy numerical computations?
  3. How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?
  4. Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?
  5. How would you go about implementing a distributed task queue using Celery and RabbitMQ?
  6. What are some advanced use-cases for Python's decorators?
  7. How can you achieve real-time data streaming in Python with WebSockets?
  8. What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?
  9. Best practices for securing a Flask (or similar) REST API with OAuth 2.0?
  10. What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)

Let's deepen our Python knowledge together. Happy coding! 🌟


r/Python 16d ago

Discussion What are some Python automations you built for your life?

312 Upvotes

What Python scripts/projects did you built to use on a day to day basis? Or maybe someone else built it, but it’s useful for your personal life in some way

I think the “projects ideas” thread is really missing those useful opportunities

I myself thought about automating tax calculations, but still didn’t take the time to do it hah


r/Python 16d ago

Daily Thread Monday Daily Thread: Project ideas!

11 Upvotes

Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

How it Works:

  1. Suggest a Project: Comment your project idea—be it beginner-friendly or advanced.
  2. Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.
  3. Explore: Looking for ideas? Check out Al Sweigart's "The Big Book of Small Python Projects" for inspiration.

Guidelines:

  • Clearly state the difficulty level.
  • Provide a brief description and, if possible, outline the tech stack.
  • Feel free to link to tutorials or resources that might help.

Example Submissions:

Project Idea: Chatbot

Difficulty: Intermediate

Tech Stack: Python, NLP, Flask/FastAPI/Litestar

Description: Create a chatbot that can answer FAQs for a website.

Resources: Building a Chatbot with Python

Project Idea: Weather Dashboard

Difficulty: Beginner

Tech Stack: HTML, CSS, JavaScript, API

Description: Build a dashboard that displays real-time weather information using a weather API.

Resources: Weather API Tutorial

Project Idea: File Organizer

Difficulty: Beginner

Tech Stack: Python, File I/O

Description: Create a script that organizes files in a directory into sub-folders based on file type.

Resources: Automate the Boring Stuff: Organizing Files

Let's help each other grow. Happy coding! 🌟


r/Python 17d ago

Discussion What are some fun Python-heavy niches?

153 Upvotes

I going to try making a Discord bot in py. Pygame and Raspberry Pi intrigue me as well

Curious what other fun Py rabbit holes are out there that I don't know of!


r/Python 17d ago

Daily Thread Sunday Daily Thread: What's everyone working on this week?

11 Upvotes

Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

How it Works:

  1. Show & Tell: Share your current projects, completed works, or future ideas.
  2. Discuss: Get feedback, find collaborators, or just chat about your project.
  3. Inspire: Your project might inspire someone else, just as you might get inspired here.

Guidelines:

  • Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
  • Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

Example Shares:

  1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
  2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
  3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟


r/Python 17d ago

Discussion Composable, reusable WebSocket components for any ASGI framework (Django, FastAPI, Litestar)

29 Upvotes

Hi all, I'm the maintainer of a small channels (WebSocket) extension library for Django (and FastAPI too). While using and maintaining it, I started thinking it could become a small framework as well: composable and framework-independent, so it could be reused across Django/FastAPI/Litestar/... as long as the framework supports ASGI. Before going further, I'm putting the blueprint out here to compare notes with people who work with WebSockets regularly. If you have ever worked with WebSockets, I hope you can share any ideas, info, pain points, or suggestions you have.

Prerequisites, what my library already has:

  • Function-like handlers rather than while True + if/else
  • Automatic AsyncAPI doc generation
  • Full type hints
  • A testing kit
  • Support for all ASGI-based frameworks (Django, FastAPI, ...)

At a glance, it looks like this:

@ws_handler(output_type=ChatNotificationMessage)
async def handle_chat(self, message: ChatMessage) -> None:
    # Automatically routed, validated, and type-safe
    await self.broadcast_message(
        ChatNotificationMessage(payload=message.payload)
    )

@ws_handler
async def handle_ping(self, message: PingMessage) -> PongMessage:
    return PongMessage()  # Auto-documented in AsyncAPI

If you have ever worked with WebSockets, I think you get the idea of what it does here.

Recently I added the Topic feature, which is composable and reusable. It came out of a multiplexing feature request, and I was inspired by Phoenix Channels. It looks something like this:

class DiscussionTopic(Topic):
    pattern = "discussion:{pk}"

    async def authorize(self, pk: str) -> bool:
        return await user_can_view(self.scope["user"], pk)

    @ws_handler
    async def handle_reply(self, message: ReplyMessage) -> ReplyCreatedMessage:
        return ReplyCreatedMessage(payload=message.payload)

    @event_handler
    async def handle_new_reply(self, event: NewReplyEvent) -> ReplyCreatedMessage:
        return ReplyCreatedMessage(payload=event.payload)

And you use it like this:

class HubConsumer(AsyncJsonWebsocketConsumer):
    authenticator_class = JWTAuthenticator
    topics = [DiscussionTopic, RoomTopic]

In short, topics let you multiplex: subscribe, publish messages, unsubscribe, and so on, all over the same socket. So you can reuse a single WebSocket connection and just add or compose multiple topics, i.e. multiple WebSocket handlers.

That made me think: if we could create reusable topics such as Notification, Streaming, Voice, AI Agent, and so on, which users could easily install or copy and then modify or inherit from in a structured way, WebSocket handling would become much more structured and easier. The idea is similar to DRF and its ecosystem, and the composable/reusable part would work like shadcn: copy it, own it, and modify the code freely.

What would you use it for? As I mentioned above: notifications, streaming, voice, AI agents, and so on. I have done a lot of WebSocket work, and I keep having to redefine the same things over and over. There is no reusable approach like the ones we have for REST APIs. Another example is using Pydantic AI with the AG-UI protocol but over WebSockets, defined in a reusable way.

So, if you already know of an existing open source solution or library similar to this idea, it would be great if you could share it here. And if this resonates with you, a comment would help, both to add more insight and to give some encouragement to actually build this.


r/Python 18d ago

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

9 Upvotes

Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!
  2. Share: Found something useful? Share it with the community.
  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.
  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.
  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.
  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.
  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟


r/Python 19d ago

Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays

18 Upvotes

Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?
  2. Community Events: Any Python meetups or webinars coming up?
  3. Learning Resources: Found a great Python tutorial? Share it here!
  4. Job Market: How has Python impacted your career?
  5. Hot Takes: Got a controversial Python opinion? Let's hear it!
  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟


r/Python 18d ago

Discussion Other Python forums - Stack Overflow

0 Upvotes

Not sure if I am allowed to discuss other forums on here but I'm sure someone will tell me if not.

It is just me of has anybody else encountered problems with the 'moderators' on Stack Overflow Python forums recently? To say I've found them to be a self-righteous bunch of destructive power-crazy control-freaks would be a bit of an understatement. Anyone else had problems on there?


r/Python 18d ago

Discussion Is Python an industry-ready technology for backends?

0 Upvotes

I mean specifically backend services, RESTful API's and very sensitive data in the DB. I mean middle-load (_not_ social networking, _not_ some purchasing platform for millions of users). How would you define your position that Python _is_ ready for that? E.g. in front of a mature Java backend developer? My line of defense is as follows. What are the weak points of Python code?

  1. Multi-threading (GIL-free is a very recent feature of python, cannot be considered even remotely industry-ready). This is probably the weakest point of all. But if the service has no data shared between API requests, why bother, right? Just spawn as many worker-processes as it makes sense for the current hardware setup and execute the requests one by one. Still, this is like one dimension less in the space of engineering possibilities, so to say.
  2. Dynamic typing means you have to run the whole CI/CD chain in order to find type system related errors. I really cannot find arguments against that point;
  3. This is true at least for banking sector. Libraries are developed by individuals (whereas in Java world there are companies behind some libraries). One would have a real hard time arguing with the management, that "those individuals are as qualified as those behind some company banner".

What is your take on the matter?