Coder Social home page Coder Social logo

pyschemes's Introduction

Hi there ๐Ÿ‘‹

I am Shivaprasad Bhat. A Software Engineer (Since 2016) from India.

  • โ™ฅ๏ธ I love building interesting things. They may not always be useful or unique ๐Ÿ˜. Feel free to checkout my repositories.

  • ๐Ÿ—๏ธ I build SaaS tools in my free time

  • ๐Ÿคฉ Apart from tech & brain things, I also watch a lot of movies & play a lot of Arma 3 (King of the Hill mainly. Add me on Steam if you know what I am talking about ) ๐Ÿ˜Ž.

  • โœ๏ธ I blog very rarely at https://spy16.in


๐Ÿ“ก LinkedIn | E-mail | Website

pyschemes's People

Contributors

gador avatar jaysoffian avatar sobolevn avatar spy16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyschemes's Issues

Simple Choices Validation error message could be clearer

>>> choices = validators.Any(["choiceA", "choiceB", "choiceC"])

>>> Scheme(choices).validate("choiceA")
'choiceA'

Instead of:


>>> Scheme(choices).validate("hello")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: value did not pass any validation

This would be clearer


>>> Scheme(choices).validate("hello")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: value was not one of "choiceA", "choiceB", "choiceC".

General question.

Hi,
I came across pyschemes recently on HN. My question is where would someone use pyschemes? If it is supposed to be used in testing, how is it better than using asserts. Also is there a possibility of using this for type-checking function arguments?

Validating False

What if we want to validate the value False (and other values which evaluate to False, like "" [] and 0)?
As in your example :

>>> def CustomValidator(value):
...    if value == False or value in range(100):
...       return value
...    else:
...       return False
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.