Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: third_party/google-endpoints/enum34-1.1.6.dist-info/DESCRIPTION.rst

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 enum --- support for enumerations
2 ========================================
3
4 An enumeration is a set of symbolic names (members) bound to unique, constant
5 values. Within an enumeration, the members can be compared by identity, and
6 the enumeration itself can be iterated over.
7
8 from enum import Enum
9
10 class Fruit(Enum):
11 apple = 1
12 banana = 2
13 orange = 3
14
15 list(Fruit)
16 # [<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>]
17
18 len(Fruit)
19 # 3
20
21 Fruit.banana
22 # <Fruit.banana: 2>
23
24 Fruit['banana']
25 # <Fruit.banana: 2>
26
27 Fruit(2)
28 # <Fruit.banana: 2>
29
30 Fruit.banana is Fruit['banana'] is Fruit(2)
31 # True
32
33 Fruit.banana.name
34 # 'banana'
35
36 Fruit.banana.value
37 # 2
38
39 Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.
40
41
OLDNEW
« no previous file with comments | « third_party/google-endpoints/enum/__init__.py ('k') | third_party/google-endpoints/enum34-1.1.6.dist-info/INSTALLER » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698