Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
52f629d4
Commit
52f629d4
authored
Jul 06, 2018
by
scoder
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2412 from gabrieldemarmiesse/test_language_basics_2
Added tests for "language basics" part 2
parents
6529f9bc
9426f662
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
docs/src/userguide/language_basics.rst
docs/src/userguide/language_basics.rst
+2
-14
No files found.
docs/src/userguide/language_basics.rst
View file @
52f629d4
...
...
@@ -107,21 +107,9 @@ You can declare classes with :keyword:`cdef`, making them :ref:`extension-types`
have a behavior very close to python classes, but are faster because they use a ``struct``
internally to store attributes.
Here is a simple example:
:
Here is a simple example:
from __future__ import print_function
cdef class Shrubbery:
cdef int width, height
def __init__(self, w, h):
self.width = w
self.height = h
def describe(self):
print("This shrubbery is", self.width,
"by", self.height, "cubits.")
.. literalinclude:: ../../examples/userguide/extension_types/shrubbery.pyx
You can read more about them in :ref:`extension-types`.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment