TIL that the iPhone Air camera bump is thicker than the main body
1 pointsby fdomingues0 comments
class Book(objects.Object):
title: Optional[str]
And the generated class code is: class Book(Base):
__slots__ = ('title', )
title: typing.Optional[str]
def __init__(self, title=None):
self.title = title
@classmethod
def from_data(cls, data):
title = data.get('title', None)
return cls(title=title)
def to_data(self):
data = {}
if self.title is not None:
data['title'] = self.title
return data
@classmethod
def from_oracle_object(cls, obj):
return cls(title=obj.title)
def to_oracle_object(self, connection):
obj = connection.gettype('Book').newobject()
obj.title = self.title
return obj
[1]https://github.com/domingues/oracle-object-mapping (venv) $ python prime.py
Number of primes between 0 to 1000000 = 78498
Elapsed time: 6.502481937408447
(venv) $ python prime.py
Number of primes between 0 to 1000000 = 78498
Elapsed time: 0.6258630752563477
Diff: 3c3,5
<
---
> import numba
>
> @numba.njit
14a17
> @numba.njit from __future__ import annotations
Class Node:
parent: Optional[Node]
[1] https://www.python.org/dev/peps/pep-0563/