Commit ad89a017 authored by Nanshu Chen's avatar Nanshu Chen Committed by Facebook GitHub Bot

refactor Enum code generation

Summary:
Changed the way how enums generated in thrift-py3:

1. Use C++ map to store name to unique Enum Python instances cache
2. Dynamically find instances from cache (or create one and add to cache) instead of populating all instances at module load time
3. use `__getattr__` and `__getitem__` instead of code-gen all the getters

Reviewed By: asp2insp

Differential Revision: D23182622

fbshipit-source-id: 75baef997ee2d604b4ef7606f282cfc3306208ac
parent 1ceb5acb
......@@ -3,6 +3,8 @@ cdef extern from "folly/Range.h" namespace "folly":
Range()
Range(T, int)
T data()
T begin()
T end()
int size()
ctypedef Range[const char*] StringPiece
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment