Metadata-Version: 1.1
Name: brackets
Version: 0.1.0
Summary: Use brackets instead of indentation.
Home-page: https://github.com/pooya-eghbali/brackets
Author: Pooya Eghbali
Author-email: persian.writer@gmail.com
License: BSD
Description: ========
        brackets
        ========
        Use c-style brackets instead of indentation. This is an encoding, you can also import this module in sites.py, it will register the encoding on import.
        
        to use this, add the magic encoding comment to your source file::
        
            # coding: brackets
        
        Then you can import it directly (obvsly brackets should be imported first), or if you added the encoding to your sites.py, you can use idle to view the decoded file.
        
        
        Currently just works for "if|elif|else|for|while|def|with" statements. It's also possible to mix indentation and brackets. You can do that, but it is not recommended.
        This started as a code, a hobby project in 2014, but now I started working on it again.
        
        You can also decode brackets literals::
        
            import brackets
          	a = b'brackets code'
          	a.decode('brackets')
        
        To know how to code with brackets examine the examples provided here. There's no warranty. There might be parsing errors, report if there are any, feel free to make a pull request.
        
        What this can do?
        =================
        This will convert::
        
            if(1 in {1,2,3}){
                print(5)
                for(x in c){
                    print(c)
                }
            }
        
        To this::
        
            if(1 in {1,2,3}):
                print(5)
                for x in c:
                    print(c)
        
        It works for messy code too. see how this can work on this one-line code::
        
            def fib(n){if(n in 0){return n}else{return fib(n-1)+fib(n-2)}}
        
        The result from the previous is::
        
            def fib(n):
            if(n in 0):
                return n
            else:
                return fib(n-1)+fib(n-2)
        
        using ; is supported::
        
            import io; def fib(n){/* code */} ; print("hello");
        
        You can also write anonymous functions like this:
        
            print([def(x, y) {return x + y}(x, y) for x in range(0, 5) for y in range(-5, 0)])
            print([def(x) { if(x in [0, 1]) {return x}; while (x < 100) { x = x ** 2} return x}(x) for x in range(0, 10)])
        
        Not necessarily in one line:
        
            print([def(x) {
                    if(x in [0, 1]) {
                      return x
                    };
                    while (x < 100) {
                      x = x ** 2
                    };
                    return x
                  }(x) for x in range(0, 10)])
        
        Note that this anonymous function isn't Python lambda, they're real functions, without limitations of lambda.
        
        Project Info
        ============
        
        Github project page: https://github.com/pooya-eghbali/brackets
        Mail me at: persian.writer [at] Gmail.com
        
Keywords: brackets,indentation,indent,indenting,parser,encoding
Platform: Any
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
