Giter Site home page Giter Site logo

desugar's Introduction

desugar

Unravelling Python source code.

Unravelled syntax

  1. obj.attrbuiltins.getattr(obj, "attr") (including object.__getattribute__())
  2. a + boperator.__add__(a, b)
  3. a - boperator.__sub__(a, b)
  4. a * boperator.__mul__(a, b)
  5. a @ boperator.__matmul__(a, b)
  6. a / boperator.__truediv__(a, b)
  7. a // boperator.__floordiv__(a, b)
  8. a % boperator.__mod__(a, b)
  9. a ** boperator.__pow__(a, b)
  10. a << boperator.__lshift__(a, b)
  11. a >> boperator.__rshift__(a, b)
  12. a & boperator.__and__(a, b)
  13. a ^ boperator.__xor__(a, b)
  14. a | boperator.__or__(a, b)
  15. a += ba = operator.__iadd__(a, b)
  16. a -= ba = operator.__isub__(a, b)
  17. a *= ba = operator.__imul__(a, b)
  18. a @= ba = operator.__imatmul__(a, b)
  19. a /= ba = operator.__itruediv__(a, b)
  20. a //= ba = operator.__ifloordiv__(a, b)
  21. a %= ba = operator.__imod__(a, b)
  22. a **= ba = operator.__ipow__(a, b)
  23. a <<= ba = operator.__ilshift__(a, b)
  24. a >>= ba = operator.__irshift__(a, b)
  25. a &= ba = operator.__iand__(a, b)
  26. a ^= ba = operator.__ixor__(a, b)
  27. a |= ba = operator.__ior__(a, b)
  28. ~ aoperator.__invert__(a)
  29. - aoperator.__neg__(a)
  30. + aoperator.__pos__(a)
  31. a == boperator.__eq__(a, b) (including object.__eq__())
  32. a != boperator.__ne__(a, b) (including object.__ne__())
  33. a < boperator.__lt__(a, b)
  34. a <= boperator.__le__(a, b)
  35. a > boperator.__gt__(a, b)
  36. a >= boperator.__ge__(a, b)

Syntax to (potentially) unravel

Keywords

Taken from the keyword module.

  1. None

  2. False~

  3. True~

  4. and~

  5. or~

  6. assert*

  7. await~

  8. break

  9. continue

  10. pass*

  11. def

  12. class*

  13. async~

  14. lambda~

  15. if

  16. elif

  17. else

  18. while

  19. for*

  20. with*

  21. try

  22. except

  23. finally

  24. global

  25. nonlocal

  26. import*

  27. from*

  28. as

  29. del

  30. not

  31. in*

  32. is*

  33. raise

  34. return

  35. yield

Tokens

Taken from the token module.

  1. =

  2. :=

  3. []*

  4. {}*

  5. ()

  6. ,

  7. :

  8. ;*

  9. ->*

  10. ...*

Literals

The list below ignores literals which are represented via syntax above. For instance, lists are ignored as they are represented by [] tokens.

  1. Bytes (b, r)
  2. Strings (u, f, r; single line, multi-line)
  3. Integers (base-10, b, o, x)
  4. Floats (point, e)
  5. Complex/imaginary numbers

desugar's People

Contributors

brettcannon avatar

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.