r/pythoncoding • u/genericlemon24 • May 12 '21
New major versions of Flask, Jinja, Click, and Werkzeug released!
r/pythoncoding • u/genericlemon24 • May 12 '21
r/pythoncoding • u/genericlemon24 • May 12 '21
r/pythoncoding • u/genericlemon24 • May 09 '21
r/pythoncoding • u/AutoModerator • May 03 '21
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.
r/pythoncoding • u/monica_b1998 • May 01 '21
r/pythoncoding • u/bobcodes247365 • Apr 19 '21
Here is an update on my Python Project, last time I posted here there were a couple bugs and it was not functioning correctly. As of now everything should be up and running and I was hoping to get some constructive criticism on how the tool works. I thought people in this subreddit would be interested
A few repositories I visualized as an example are:
https://metabob.com/gh/galt2x/sherlock
https://metabob.com/gh/galt2x/fastapi
The program works best on Google Chrome, If you would like to check out the website, it is metabob.com
r/pythoncoding • u/AutoModerator • Apr 19 '21
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.
r/pythoncoding • u/hrshah14 • Apr 18 '21
r/pythoncoding • u/genericlemon24 • Apr 16 '21
r/pythoncoding • u/sofloLinuxuser • Apr 15 '21
I have a few recordings I want to upload for a podcast I'm working on but we tend to be wild boyd and say some things that might not be appropriate for the public during this sensitive climate.
I'm looking to find a tool or a python library that will search through an audio file, pick up a specific string (examples would be finding the word f-u-c-k) and cresting a text file with timestamps of all the times the word is used so I can mask or cut them out of the file manually.
Does anyone know if there is a project on the web like this or a python library that would help me build out a small tool?
r/pythoncoding • u/RojerGS • Apr 12 '21
r/pythoncoding • u/genericlemon24 • Apr 08 '21
r/pythoncoding • u/AutoModerator • Apr 05 '21
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.
r/pythoncoding • u/genericlemon24 • Mar 24 '21
r/pythoncoding • u/AutoModerator • Mar 22 '21
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.
r/pythoncoding • u/genericlemon24 • Mar 21 '21
r/pythoncoding • u/genericlemon24 • Mar 19 '21
r/pythoncoding • u/monica_b1998 • Mar 19 '21
r/pythoncoding • u/audentis • Mar 09 '21
As we all know, Python is a dynamic language. This provides many strengths, and offers a lot of flexibility, but in larger code bases it can also become a hindrance. Type hints are often considered a solution to keep large code bases manageable.
A trend towards more and more type information - such as type hints (PEP 484) and their postponed evaluation (PEP 563), easier writing of union types (PEP 604), or TypedDicts (PEP 589) just to name a few- enables developers and their tools to have more information available about the types of objects they're working with. Linters catch more errors, and developers can stay sane.
However, this also requires discipline. Take the following example:
from random import random, seed
seed(2)
class MyClass:
def __init__(self, arg):
self.val = arg
def my_func(x: MyClass):
print(x.val)
a = MyClass(10)
b = MyClass(10)
x = random()
if x > 0.5:
del a.val
print(type(a) is type(b)) # True, even though we potentially modified the instance!
my_func(a) # 50/50: succesful print or AttributeErrorIn other words, type hints are demonstrably fallible. If you use the object model's flexibility, the type hints will no longer be reliable.
What are your thoughts on this trend? On the trade off between extra information during development, versus the loss of flexibility?
r/pythoncoding • u/RojerGS • Mar 08 '21
r/pythoncoding • u/AutoModerator • Mar 08 '21
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.
r/pythoncoding • u/sobolevn • Mar 02 '21
My new article is out!
This time I want to discuss a pretty useful idea for library authors and their users: there are better ways to test your code!
I give three examples (in #python, but the idea itself applies to almost any language) of how user projects can be self-tested without actually writing any real test cases by the end-user. One is hypothetical about django and two examples are real and working: featuring deal and dry-python/returns.
Short example with deal:
import deal
@deal.pre(lambda a, b: a >= 0 and b >= 0)
@deal.raises(ZeroDivisionError) # this function can raise if `b=0`, it is ok
def div(a: int, b: int) -> float:
if a > 50: # Custom, in real life this would be a bug in our logic:
raise Exception('Oh no! Bug happened!')
return a / bThis bug can be automatically found by writing a single line of test code: test_div = deal.cases(div). As easy as it gets!
From this article you will learn: -How to use property-based testing on the next level
How a simple decorator @deal.pre(lambda a, b: a >= 0 and b >= 0) can help you to generate hundreds of test cases with almost no effort
What "Monad laws as values" is all about and how dry-python/returns helps its users to build their own monads
I really like this idea! And I would appreciate your feedback on it. Link: https://sobolevn.me/2021/02/make-tests-a-part-of-your-app
r/pythoncoding • u/Elgon2003 • Feb 26 '21
Hey, guys, I recently made a library for python, and I wanted to share it with you to give some feedback. The library is a python downloader. You give it an URL, and it displays a pretty progress bar of your download.
I built this library because I always develop apps that require downloading files, and this way, it's easier to get some feedback from the download progress.
r/pythoncoding • u/genericlemon24 • Feb 24 '21