I rewrote my programming language from Python into Go to see the speed up.
What my project does:
I wrote a tree-walk interpreter in Python a while ago and posted it here.
Target Audience:
Python and programming entusiasts.
I was curious to see how much of a performance bump I could get by doing a 1-1 port to Go without any optimizations.
Turns out, it's around 10X faster, plus now I can create compiled binaries and include them in my Github releases.
Take my lang for a spin and leave some feedback :)
Utility:
None - It solves no practical problem that is not currently being done better.
/r/Python
https://redd.it/1i1ppr7
What my project does:
I wrote a tree-walk interpreter in Python a while ago and posted it here.
Target Audience:
Python and programming entusiasts.
I was curious to see how much of a performance bump I could get by doing a 1-1 port to Go without any optimizations.
Turns out, it's around 10X faster, plus now I can create compiled binaries and include them in my Github releases.
Take my lang for a spin and leave some feedback :)
Utility:
None - It solves no practical problem that is not currently being done better.
/r/Python
https://redd.it/1i1ppr7
Reddit
From the Python community on Reddit: I wrote a Turing complete language / interpreter on top of Python.
Explore this post and more from the Python community
I have 0 experience in Django but have to Interview Candidates. Help!
Hi every one I an working in a company where we have just received a project in Django or are about to. But no one in the company has experience in Django development.
So HR has given me the job of handling Django interviews as I am the only one who has some knowledge Django and python but no work experience.
Can u guys give me some Questions and coding exercises that I can ask the candidate to know if they are suitable for the job. I have not been told about if we have to hire Junior or Senior devs.
Thanks to all the answers.
/r/django
https://redd.it/1i1ssz1
Hi every one I an working in a company where we have just received a project in Django or are about to. But no one in the company has experience in Django development.
So HR has given me the job of handling Django interviews as I am the only one who has some knowledge Django and python but no work experience.
Can u guys give me some Questions and coding exercises that I can ask the candidate to know if they are suitable for the job. I have not been told about if we have to hire Junior or Senior devs.
Thanks to all the answers.
/r/django
https://redd.it/1i1ssz1
Reddit
From the django community on Reddit
Explore this post and more from the django community
R Transformer²: Self-Adaptive LLMs
Paper: https://arxiv.org/abs/2501.06252
Abstract
Self-adaptive large language models (LLMs) aim to solve the challenges posed by traditional fine-tuning methods, which are often computationally intensive and static in their ability to handle diverse tasks. We introduce Transformer², a novel self-adaptation framework that adapts LLMs for unseen tasks in real-time by selectively adjusting only the singular components of their weight matrices. During inference, Transformer² employs a two-pass mechanism: first, a dispatch system identifies the task properties, and then task-specific "expert" vectors, trained using reinforcement learning, are dynamically mixed to obtain targeted behavior for the incoming prompt. Our method outperforms ubiquitous approaches such as LoRA, with fewer parameters and greater efficiency. Transformer² demonstrates versatility across different LLM architectures and modalities, including vision-language tasks. Transformer² represents a significant leap forward, offering a scalable, efficient solution for enhancing the adaptability and task-specific performance of LLMs, paving the way for truly dynamic, self-organizing AI systems.
Blog Summary: https://sakana.ai/transformer-squared/
GitHub: https://github.com/SakanaAI/self-adaptive-llms
/r/MachineLearning
https://redd.it/1i1l8d4
Paper: https://arxiv.org/abs/2501.06252
Abstract
Self-adaptive large language models (LLMs) aim to solve the challenges posed by traditional fine-tuning methods, which are often computationally intensive and static in their ability to handle diverse tasks. We introduce Transformer², a novel self-adaptation framework that adapts LLMs for unseen tasks in real-time by selectively adjusting only the singular components of their weight matrices. During inference, Transformer² employs a two-pass mechanism: first, a dispatch system identifies the task properties, and then task-specific "expert" vectors, trained using reinforcement learning, are dynamically mixed to obtain targeted behavior for the incoming prompt. Our method outperforms ubiquitous approaches such as LoRA, with fewer parameters and greater efficiency. Transformer² demonstrates versatility across different LLM architectures and modalities, including vision-language tasks. Transformer² represents a significant leap forward, offering a scalable, efficient solution for enhancing the adaptability and task-specific performance of LLMs, paving the way for truly dynamic, self-organizing AI systems.
Blog Summary: https://sakana.ai/transformer-squared/
GitHub: https://github.com/SakanaAI/self-adaptive-llms
/r/MachineLearning
https://redd.it/1i1l8d4
arXiv.org
Transformer-Squared: Self-adaptive LLMs
Self-adaptive large language models (LLMs) aim to solve the challenges posed by traditional fine-tuning methods, which are often computationally intensive and static in their ability to handle...
Deploy React/Django in GCP Compute
Hi, did anyone have a detailed guide on how can I deploy my App using google compute? I have tried but unable to expose my app in port 3000 and 8000. Any help please. Thanks.
/r/django
https://redd.it/1i1oiwj
Hi, did anyone have a detailed guide on how can I deploy my App using google compute? I have tried but unable to expose my app in port 3000 and 8000. Any help please. Thanks.
/r/django
https://redd.it/1i1oiwj
Reddit
From the django community on Reddit
Explore this post and more from the django community
Running Django’s test suite for the first time problem
https://preview.redd.it/yikxryyv76de1.png?width=690&format=png&auto=webp&s=abb125ae95949ec2c4bcbef6c905f04bd1a003db
Hi. I found an instruction to run test suite for the first time here:
https://docs.djangoproject.com/en/dev/intro/contributing/
i have done everything written there but have some issues:
One of the tests (last on the screen) runs for a very long time and does not change its state
Can anyone suggest - what could be the problem?
/r/django
https://redd.it/1i1z193
https://preview.redd.it/yikxryyv76de1.png?width=690&format=png&auto=webp&s=abb125ae95949ec2c4bcbef6c905f04bd1a003db
Hi. I found an instruction to run test suite for the first time here:
https://docs.djangoproject.com/en/dev/intro/contributing/
i have done everything written there but have some issues:
One of the tests (last on the screen) runs for a very long time and does not change its state
Can anyone suggest - what could be the problem?
/r/django
https://redd.it/1i1z193
I've Created a Python Library That Tracks and Misleads Hackers
Background
Hello everyone! A few months ago, I created a small web platform. Since I have many security engineer followers, I knew they would actively search for vulnerabilities. So, I decided to plant some realistic-looking fake vulnerabilities for fun. It was fun, and I realized that it can be actually very useful in other projects as well. I could monitor how many people were probing the platform while having them waste time on decoy vulnerabilities. Therefore, I've created BaitRoute: https://github.com/utkusen/baitroute
What My Project Does
It’s a web honeypot project that serves realistic, vulnerable-looking endpoints to detect vulnerability scans and mislead attackers by providing false positive results. It can be loaded as a library to your current project. It currently supports Django, FastAPI and Flask frameworks. When somebody hits a decoy endpoint, you can send that alarm to another service such as Sentry, Datadog, etc. to track hackers. Also, if you enable all rules, attackers' vulnerability scans become a mess with false-positive results. They'll waste considerable time trying to determine which vulnerabilities are genuine.
Target Audience
It can be used in web applications and API services.
Comparison
I’m not aware of any similar projects.
/r/Python
https://redd.it/1i208uo
Background
Hello everyone! A few months ago, I created a small web platform. Since I have many security engineer followers, I knew they would actively search for vulnerabilities. So, I decided to plant some realistic-looking fake vulnerabilities for fun. It was fun, and I realized that it can be actually very useful in other projects as well. I could monitor how many people were probing the platform while having them waste time on decoy vulnerabilities. Therefore, I've created BaitRoute: https://github.com/utkusen/baitroute
What My Project Does
It’s a web honeypot project that serves realistic, vulnerable-looking endpoints to detect vulnerability scans and mislead attackers by providing false positive results. It can be loaded as a library to your current project. It currently supports Django, FastAPI and Flask frameworks. When somebody hits a decoy endpoint, you can send that alarm to another service such as Sentry, Datadog, etc. to track hackers. Also, if you enable all rules, attackers' vulnerability scans become a mess with false-positive results. They'll waste considerable time trying to determine which vulnerabilities are genuine.
Target Audience
It can be used in web applications and API services.
Comparison
I’m not aware of any similar projects.
/r/Python
https://redd.it/1i208uo
GitHub
GitHub - utkusen/baitroute: A web honeypot library to create vulnerable-looking endpoints to detect and mislead attackers
A web honeypot library to create vulnerable-looking endpoints to detect and mislead attackers - utkusen/baitroute
Dash app down , 502 error randomly
I’ve deployed a dash app on one of my corporate servers (linux) and i have users complaining from application being down for no reason. (502 error)
Anyone has an idea about this issue ? maybe a tiemout from dash ?
THANKS
/r/flask
https://redd.it/1i21gni
I’ve deployed a dash app on one of my corporate servers (linux) and i have users complaining from application being down for no reason. (502 error)
Anyone has an idea about this issue ? maybe a tiemout from dash ?
THANKS
/r/flask
https://redd.it/1i21gni
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Hard to master topics in Django
Recently I have been using Django quite alot I have about 2 years of experience in it now and I can almost always think of a solution in django when implementing new features, so I am starting to think that I am entering a comfort zone and not really learning new things.
So I wanted to get recommendations about features or changes that people may have struggled with and if I like something I may end up implementing it.
Thank you all for the suggestions.
/r/django
https://redd.it/1i22cpz
Recently I have been using Django quite alot I have about 2 years of experience in it now and I can almost always think of a solution in django when implementing new features, so I am starting to think that I am entering a comfort zone and not really learning new things.
So I wanted to get recommendations about features or changes that people may have struggled with and if I like something I may end up implementing it.
Thank you all for the suggestions.
/r/django
https://redd.it/1i22cpz
Reddit
From the django community on Reddit
Explore this post and more from the django community
WASM-powered codespaces for Python notebooks on GitHub
What my project does
During a hackweek, we built this project that allows you to run marimo and Jupyter notebooks directly from GitHub in a Wasm-powered, codespace-like environment. What makes this powerful is that we mount the GitHub repository's contents as a filesystem in the notebook, making it really easy to share notebooks with data.
All you need to do is prepend 'https://marimo.app' to any Python notebook on GitHub. Some examples:
Jupyter Notebook: [https://marimo.app/github.com/jakevdp/PythonDataScienceHandb...](https://marimo.app/github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.08-Sorting.ipynb)
marimo notebook: https://marimo.app/github.com/marimo-team/marimo/blob/07e8d1...
Jupyter notebooks are automatically converted into marimo notebooks using basic static analysis and source code transformations. Our conversion logic assumes the notebook was meant to be run top-down, which is usually but not always true [2\]. It can convert many notebooks, but there are still some edge cases.
We implemented the filesystem mount using our own FUSE-like adapter that links the GitHub repository’s contents to the Python filesystem, leveraging Emscripten’s filesystem API. The file tree is loaded on startup to avoid waterfall requests when reading many directories deep, but loading the file contents is lazy. For example, when you write Python that looks like
with open("./data/cars.csv") as f:
print(f.read())
# or
/r/Python
https://redd.it/1i270co
What my project does
During a hackweek, we built this project that allows you to run marimo and Jupyter notebooks directly from GitHub in a Wasm-powered, codespace-like environment. What makes this powerful is that we mount the GitHub repository's contents as a filesystem in the notebook, making it really easy to share notebooks with data.
All you need to do is prepend 'https://marimo.app' to any Python notebook on GitHub. Some examples:
Jupyter Notebook: [https://marimo.app/github.com/jakevdp/PythonDataScienceHandb...](https://marimo.app/github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.08-Sorting.ipynb)
marimo notebook: https://marimo.app/github.com/marimo-team/marimo/blob/07e8d1...
Jupyter notebooks are automatically converted into marimo notebooks using basic static analysis and source code transformations. Our conversion logic assumes the notebook was meant to be run top-down, which is usually but not always true [2\]. It can convert many notebooks, but there are still some edge cases.
We implemented the filesystem mount using our own FUSE-like adapter that links the GitHub repository’s contents to the Python filesystem, leveraging Emscripten’s filesystem API. The file tree is loaded on startup to avoid waterfall requests when reading many directories deep, but loading the file contents is lazy. For example, when you write Python that looks like
with open("./data/cars.csv") as f:
print(f.read())
# or
/r/Python
https://redd.it/1i270co
GitHub
GitHub - marimo-team/marimo: A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script…
A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor....
What is the best way to ban someone's IP?
Long story short, I operate a golf wiki, and it's grown enough to have my first horrific and racist troll updating courses with wildly inappropriate things.
It's pretty clear that this person *doesn't realize your full IP is posted with any anonymous edit*.
Having never encountered this problem before, I'm trying to figure out an effective way of taking edit privileges away without the user trying to find a workaround.
First however, I need to know which IP to ban. I've been using **request.access_route** rather than **request.remote_addr** because it seems to be more complete, but I'm going to be honest that I'm not entirely sure whether that is necessary.
It seem like the best method would be to use **request.access_route**, but then to take the -1th list item from that list and ban that? Or should I simple ban the entire access route.
I don't want to accidentally ban the public library, but we don't exactly have access to mac addresses... so... I'm not entirely sure what to do.
Any advice from someone who is better informed on networking stuff?
/r/flask
https://redd.it/1i27y66
Long story short, I operate a golf wiki, and it's grown enough to have my first horrific and racist troll updating courses with wildly inappropriate things.
It's pretty clear that this person *doesn't realize your full IP is posted with any anonymous edit*.
Having never encountered this problem before, I'm trying to figure out an effective way of taking edit privileges away without the user trying to find a workaround.
First however, I need to know which IP to ban. I've been using **request.access_route** rather than **request.remote_addr** because it seems to be more complete, but I'm going to be honest that I'm not entirely sure whether that is necessary.
It seem like the best method would be to use **request.access_route**, but then to take the -1th list item from that list and ban that? Or should I simple ban the entire access route.
I don't want to accidentally ban the public library, but we don't exactly have access to mac addresses... so... I'm not entirely sure what to do.
Any advice from someone who is better informed on networking stuff?
/r/flask
https://redd.it/1i27y66
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Apache or Nginx
What's better to use on Django project with mysql bd as a web-server, apache or nginx?
/r/django
https://redd.it/1i213fe
What's better to use on Django project with mysql bd as a web-server, apache or nginx?
/r/django
https://redd.it/1i213fe
Reddit
From the django community on Reddit
Explore this post and more from the django community
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# 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
https://redd.it/1i2botq
# 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
https://redd.it/1i2botq
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Explore OSS built in the Flask ecosystem!
Hi r/flask ! I'm part of a small team building a new discovery tool for open source called **market.dev**. It's a way to easily search and browse what's happening in OSS - for projects, people, and resources. Here's the Flask ecosystem at a glance.
We built this because we wanted an ecosystem centric view of open source, auto-categorized and easily to keep up with. We also wanted to explore a **redesigned project view** with focus on what the repo is about, community info, package downloads where available, related projects and the ability to compare repos easily.
Here's what else you can use this for:
[Find other people in the Flask comunity](https://market.dev/ecosystems/flask/experts), and filter by location
Find Flask projects looking for contributors
There's a lot still to do - search and comparisons are two things we're focused on right now. But I would love some feedback from this sub to see how useful this is to you, and any features you'd like to see!
Thanks so much in advance for any feedback!
/r/flask
https://redd.it/1i27xs4
Hi r/flask ! I'm part of a small team building a new discovery tool for open source called **market.dev**. It's a way to easily search and browse what's happening in OSS - for projects, people, and resources. Here's the Flask ecosystem at a glance.
We built this because we wanted an ecosystem centric view of open source, auto-categorized and easily to keep up with. We also wanted to explore a **redesigned project view** with focus on what the repo is about, community info, package downloads where available, related projects and the ability to compare repos easily.
Here's what else you can use this for:
[Find other people in the Flask comunity](https://market.dev/ecosystems/flask/experts), and filter by location
Find Flask projects looking for contributors
There's a lot still to do - search and comparisons are two things we're focused on right now. But I would love some feedback from this sub to see how useful this is to you, and any features you'd like to see!
Thanks so much in advance for any feedback!
/r/flask
https://redd.it/1i27xs4
market.dev
Business tools for developers.
Any well known open-source python packages use Astral's uv tool?
I'm looking a Astral's uv, and it seems very interesting to manage applications and their dependencies. Even for internal packages I can see its use, but I'm having a hard time seen the workflow for an open-source public package where you need to support multiple Python versions and test with them.
Do you know of any open-source package project that uses uv in its workflow?
/r/Python
https://redd.it/1i20lvm
I'm looking a Astral's uv, and it seems very interesting to manage applications and their dependencies. Even for internal packages I can see its use, but I'm having a hard time seen the workflow for an open-source public package where you need to support multiple Python versions and test with them.
Do you know of any open-source package project that uses uv in its workflow?
/r/Python
https://redd.it/1i20lvm
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How do I run a standlone function in Django?
I have this function in a module. (not in views). Which processes some data periodically and saves the results. But Celery is giving me issues running it and I don't know if the function actually works as intended or not. So I want to run that function only for testing. How do I do this?
/r/djangolearning
https://redd.it/1i2ka0x
I have this function in a module. (not in views). Which processes some data periodically and saves the results. But Celery is giving me issues running it and I don't know if the function actually works as intended or not. So I want to run that function only for testing. How do I do this?
/r/djangolearning
https://redd.it/1i2ka0x
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
AutoResearch: A Pure-Python open-source LLM-driven research automation tool
Hello, everyone
I recently developed a new open-source LLM-driven research automation tool, called AutoResearch. It can automatically conduct various tasks related to machine learning research, the key function is:
Topic-to-Survey Automation \- In one sentence, it converts a topic or research question into a comprehensive survey of relevant papers. It generates keywords, retrieves articles for each keyword, merges duplicate articles, ranks articles based on their impacts, summarizes the articles from the topic, method, to results, and optionally checks code availability. It also organizes and zips results for easy access.
When searching for research papers, the results from a search engine can vary significantly depending on the specific keywords used, even if those keywords are conceptually similar. For instance, searching for "LLMs" versus "Large Language Models" may yield different sets of papers. Additionally, when experimenting with new keywords, it can be challenging to remember whether a particular paper has already been checked. Furthermore, the process of downloading papers and organizing them with appropriate filenames can be tedious and time-consuming.
This tool streamlines the entire process by automating several key tasks. It suggests multiple related keywords to ensure comprehensive coverage of the topic, merges duplicate results to avoid redundancy, and automatically names downloaded files using the paper
/r/Python
https://redd.it/1i2lw4i
Hello, everyone
I recently developed a new open-source LLM-driven research automation tool, called AutoResearch. It can automatically conduct various tasks related to machine learning research, the key function is:
Topic-to-Survey Automation \- In one sentence, it converts a topic or research question into a comprehensive survey of relevant papers. It generates keywords, retrieves articles for each keyword, merges duplicate articles, ranks articles based on their impacts, summarizes the articles from the topic, method, to results, and optionally checks code availability. It also organizes and zips results for easy access.
When searching for research papers, the results from a search engine can vary significantly depending on the specific keywords used, even if those keywords are conceptually similar. For instance, searching for "LLMs" versus "Large Language Models" may yield different sets of papers. Additionally, when experimenting with new keywords, it can be challenging to remember whether a particular paper has already been checked. Furthermore, the process of downloading papers and organizing them with appropriate filenames can be tedious and time-consuming.
This tool streamlines the entire process by automating several key tasks. It suggests multiple related keywords to ensure comprehensive coverage of the topic, merges duplicate results to avoid redundancy, and automatically names downloaded files using the paper
/r/Python
https://redd.it/1i2lw4i
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
DeepEval: The Open-Source LLM Evaluation Framework
Hello everyone, I've been working on DeepEval over the past \~1 year and managed to somehow grow it to almost half a million monthly downloads now. I thought it would be nice to share what it does and how may it help.
What My Project Does
DeepEval is an open source LLM evaluation framework that started off as "Pytest for LLMs". This resonated surprisingly well with the python community and those on hackernews, which really motivated me to keep working on it since. DeepEval offers a ton of evaluation metrics powered by LLMs (yes a bit weird I know, but trust me on this one), as well as a whole ecosystem to generate evaluation datasets to help you get up and running with LLM testing even if you have no testset to start with.
In a nutshell, it has:
(Mostly) Research backed, SOTA metrics covering chatbots, agents, and RAG.
Dataset generation, very useful for those with no evaluation dataset and don't have time to prepare one.
Tightly integrated with Pytest. Lots of big companies turns out are including DeepEval in their CI/Cd pipelines
Free platform to store datasets, evaluation results, catch regressions, etc.
Who is this for?
DeepEval is for anyone building LLM applications, or
/r/Python
https://redd.it/1i2kafp
Hello everyone, I've been working on DeepEval over the past \~1 year and managed to somehow grow it to almost half a million monthly downloads now. I thought it would be nice to share what it does and how may it help.
What My Project Does
DeepEval is an open source LLM evaluation framework that started off as "Pytest for LLMs". This resonated surprisingly well with the python community and those on hackernews, which really motivated me to keep working on it since. DeepEval offers a ton of evaluation metrics powered by LLMs (yes a bit weird I know, but trust me on this one), as well as a whole ecosystem to generate evaluation datasets to help you get up and running with LLM testing even if you have no testset to start with.
In a nutshell, it has:
(Mostly) Research backed, SOTA metrics covering chatbots, agents, and RAG.
Dataset generation, very useful for those with no evaluation dataset and don't have time to prepare one.
Tightly integrated with Pytest. Lots of big companies turns out are including DeepEval in their CI/Cd pipelines
Free platform to store datasets, evaluation results, catch regressions, etc.
Who is this for?
DeepEval is for anyone building LLM applications, or
/r/Python
https://redd.it/1i2kafp
Reddit
From the Python community on Reddit: DeepEval: The Open-Source LLM Evaluation Framework
Explore this post and more from the Python community
Is it a good practice to wrap immutable values in list's or other mutable types to make them mutable
so the question is really simple is it this good practice
def modx(x):
x[0] += 1
val = [42]
modx(val)
is this ok to do I dont have a spesific use case for this except maybe implementing a some data structures. I am just wondering if this is a good/bad practice GENERALLY
/r/Python
https://redd.it/1i25y78
so the question is really simple is it this good practice
def modx(x):
x[0] += 1
val = [42]
modx(val)
is this ok to do I dont have a spesific use case for this except maybe implementing a some data structures. I am just wondering if this is a good/bad practice GENERALLY
/r/Python
https://redd.it/1i25y78
Reddit
From the Python community on Reddit
Explore this post and more from the Python community